New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

capsule-lint

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

capsule-lint - npm Package Compare versions

Comparing version 0.4.8 to 0.4.9

10

dist/parser.d.ts

@@ -66,11 +66,15 @@ export interface FilePosition {

export type PeggySyntaxError = _PeggySyntaxError;
export type Start = (Conditional | Tag | Text)[];
export type Start = (If | List | Assign | Tag | Text)[];
export type Text = string;
export type Char = string;
export type Tag = string;
export type Conditional = If | Elseif | Else | Endif;
export type If = string;
export type If = Openif | Elseif | Else | Endif;
export type Openif = string;
export type Elseif = string;
export type Else = "<#else>";
export type Endif = "</#if>";
export type List = Openlist | Endlist;
export type Openlist = string;
export type Endlist = "</#list>";
export type Assign = string;
export type TagExpression = any;

@@ -77,0 +81,0 @@ export type Expression = string;

{
"name": "capsule-lint",
"version": "0.4.8",
"version": "0.4.9",
"description": "The official Capsule linting package.",

@@ -5,0 +5,0 @@ "type": "module",

@@ -14,7 +14,10 @@ import { Block } from 'htmlhint/htmlparser';

const blockTags = ['#if', '#list'];
const pattern = new RegExp(`^<(${blockTags.join('|')})`)
parser.addListener('text', (event) => {
try {
for(const tag of parse(event.raw)) {
if(tag.match(/^<#if/)) {
stack.push({ tag, event });
if(tag.match(pattern)) {
stack.push({ tag, event });
}

@@ -37,3 +40,3 @@ }

parser.addListener('tagend', (event) => {
if(event.tagName !== '#if') {
if(!blockTags.includes(event.tagName)) {
return;

@@ -51,3 +54,3 @@ }

for(const { tag, event } of stack) {
reporter.error(`Conditional [${tag}] is missing a closing tag: [</#if>]`, event.line, event.col, this, event.raw)
reporter.error(`Tag [${tag}] is missing a closing tag: [</${tag.match(pattern)[1]}>]`, event.line, event.col, this, event.raw)
}

@@ -54,0 +57,0 @@ })

@@ -24,3 +24,3 @@ import { Block } from 'htmlhint/htmlparser';

if(tagName === '#if') {
if(tagName.startsWith('#')) {
return;

@@ -27,0 +27,0 @@ }

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc