@herb-tools/linter 0.8.9 → 0.8.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -2288,7 +2288,7 @@ function splitByTopLevelComma(str) {
2288
2288
  return result;
2289
2289
  }
2290
2290
 
2291
- const STRICT_LOCALS_PATTERN = /^locals:\s+\([^)]*\)\s*$/;
2291
+ const STRICT_LOCALS_PATTERN = /^locals:\s+\(.*\)\s*$/s;
2292
2292
  function isValidStrictLocalsFormat(content) {
2293
2293
  return STRICT_LOCALS_PATTERN.test(content);
2294
2294
  }
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { getNodesBeforePosition, getNodesAfterPosition, filterNodes, ERBContentNode, isERBOutputNode, Visitor, isToken, isParseResult, getStaticAttributeName, hasDynamicAttributeName as hasDynamicAttributeName$1, getCombinedAttributeName, hasStaticContent, getStaticContentFromNodes, Location, hasERBOutput, isEffectivelyStatic, getValidatableStaticContent, isERBNode, isWhitespaceNode, isCommentNode, isLiteralNode, isHTMLTextNode, Position, filterERBContentNodes, isNode, LiteralNode, didyoumean, filterLiteralNodes, Token, getTagName as getTagName$1, isHTMLElementNode, isHTMLOpenTagNode, HTMLCloseTagNode, WhitespaceNode, filterWhitespaceNodes, HTMLOpenTagNode, isERBCommentNode } from '@herb-tools/core';
1
+ import { getNodesBeforePosition, getNodesAfterPosition, filterNodes, ERBContentNode, isERBOutputNode, Visitor, isToken, isParseResult, Location, getStaticAttributeName, getCombinedAttributeName, getStaticContentFromNodes, hasDynamicAttributeName as hasDynamicAttributeName$1, hasStaticContent, hasERBOutput, isEffectivelyStatic, getValidatableStaticContent, isERBNode, isWhitespaceNode, isCommentNode, isLiteralNode, isHTMLTextNode, Position, filterERBContentNodes, isNode, LiteralNode, didyoumean, filterLiteralNodes, Token, getTagName as getTagName$1, isHTMLElementNode, isHTMLOpenTagNode, HTMLCloseTagNode, WhitespaceNode, filterWhitespaceNodes, HTMLOpenTagNode, isERBCommentNode } from '@herb-tools/core';
2
2
  import picomatch from 'picomatch';
3
3
 
4
4
  class PrintContext {
@@ -2286,7 +2286,7 @@ function splitByTopLevelComma(str) {
2286
2286
  return result;
2287
2287
  }
2288
2288
 
2289
- const STRICT_LOCALS_PATTERN = /^locals:\s+\([^)]*\)\s*$/;
2289
+ const STRICT_LOCALS_PATTERN = /^locals:\s+\(.*\)\s*$/s;
2290
2290
  function isValidStrictLocalsFormat(content) {
2291
2291
  return STRICT_LOCALS_PATTERN.test(content);
2292
2292
  }
package/dist/loader.cjs CHANGED
@@ -182,7 +182,7 @@ class Token {
182
182
  }
183
183
 
184
184
  // NOTE: This file is generated by the templates/template.rb script and should not
185
- // be modified manually. See /Users/marcoroth/Development/herb-release-0.8.9/templates/javascript/packages/core/src/errors.ts.erb
185
+ // be modified manually. See /Users/marcoroth/Development/herb-release-0.8.10/templates/javascript/packages/core/src/errors.ts.erb
186
186
  class HerbError {
187
187
  type;
188
188
  message;
@@ -719,6 +719,40 @@ class ERBMultipleBlocksInTagError extends HerbError {
719
719
  return output;
720
720
  }
721
721
  }
722
+ class ERBCaseWithConditionsError extends HerbError {
723
+ static from(data) {
724
+ return new ERBCaseWithConditionsError({
725
+ type: data.type,
726
+ message: data.message,
727
+ location: Location.from(data.location),
728
+ });
729
+ }
730
+ constructor(props) {
731
+ super(props.type, props.message, props.location);
732
+ }
733
+ toJSON() {
734
+ return {
735
+ ...super.toJSON(),
736
+ type: "ERB_CASE_WITH_CONDITIONS_ERROR",
737
+ };
738
+ }
739
+ toMonacoDiagnostic() {
740
+ return {
741
+ line: this.location.start.line,
742
+ column: this.location.start.column,
743
+ endLine: this.location.end.line,
744
+ endColumn: this.location.end.column,
745
+ message: this.message,
746
+ severity: 'error'
747
+ };
748
+ }
749
+ treeInspect() {
750
+ let output = "";
751
+ output += `@ ERBCaseWithConditionsError ${this.location.treeInspectWithLabel()}\n`;
752
+ output += `└── message: "${this.message}"\n`;
753
+ return output;
754
+ }
755
+ }
722
756
  function fromSerializedError(error) {
723
757
  switch (error.type) {
724
758
  case "UNEXPECTED_ERROR": return UnexpectedError.from(error);
@@ -733,6 +767,7 @@ function fromSerializedError(error) {
733
767
  case "ERB_CONTROL_FLOW_SCOPE_ERROR": return ERBControlFlowScopeError.from(error);
734
768
  case "MISSINGERB_END_TAG_ERROR": return MissingERBEndTagError.from(error);
735
769
  case "ERB_MULTIPLE_BLOCKS_IN_TAG_ERROR": return ERBMultipleBlocksInTagError.from(error);
770
+ case "ERB_CASE_WITH_CONDITIONS_ERROR": return ERBCaseWithConditionsError.from(error);
736
771
  default:
737
772
  throw new Error(`Unknown node type: ${error.type}`);
738
773
  }
@@ -747,7 +782,7 @@ function convertToUTF8(string) {
747
782
  }
748
783
 
749
784
  // NOTE: This file is generated by the templates/template.rb script and should not
750
- // be modified manually. See /Users/marcoroth/Development/herb-release-0.8.9/templates/javascript/packages/core/src/nodes.ts.erb
785
+ // be modified manually. See /Users/marcoroth/Development/herb-release-0.8.10/templates/javascript/packages/core/src/nodes.ts.erb
751
786
  class Node {
752
787
  type;
753
788
  location;
@@ -3001,7 +3036,7 @@ class ParseResult extends Result {
3001
3036
  }
3002
3037
 
3003
3038
  // NOTE: This file is generated by the templates/template.rb script and should not
3004
- // be modified manually. See /Users/marcoroth/Development/herb-release-0.8.9/templates/javascript/packages/core/src/node-type-guards.ts.erb
3039
+ // be modified manually. See /Users/marcoroth/Development/herb-release-0.8.10/templates/javascript/packages/core/src/node-type-guards.ts.erb
3005
3040
  /**
3006
3041
  * Type guard functions for AST nodes.
3007
3042
  * These functions provide type checking by combining both instanceof
@@ -3704,7 +3739,7 @@ function didyoumean(input, list, threshold) {
3704
3739
  }
3705
3740
 
3706
3741
  // NOTE: This file is generated by the templates/template.rb script and should not
3707
- // be modified manually. See /Users/marcoroth/Development/herb-release-0.8.9/templates/javascript/packages/core/src/visitor.ts.erb
3742
+ // be modified manually. See /Users/marcoroth/Development/herb-release-0.8.10/templates/javascript/packages/core/src/visitor.ts.erb
3708
3743
  class Visitor {
3709
3744
  visit(node) {
3710
3745
  if (!node)
@@ -8296,7 +8331,7 @@ function splitByTopLevelComma(str) {
8296
8331
  return result;
8297
8332
  }
8298
8333
 
8299
- const STRICT_LOCALS_PATTERN = /^locals:\s+\([^)]*\)\s*$/;
8334
+ const STRICT_LOCALS_PATTERN = /^locals:\s+\(.*\)\s*$/s;
8300
8335
  function isValidStrictLocalsFormat(content) {
8301
8336
  return STRICT_LOCALS_PATTERN.test(content);
8302
8337
  }