@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/README.md +2 -2
- package/dist/herb-lint.js +89 -21
- package/dist/herb-lint.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +2 -2
- package/dist/loader.cjs +40 -5
- package/dist/loader.cjs.map +1 -1
- package/dist/loader.js +40 -5
- package/dist/loader.js.map +1 -1
- package/dist/package.json +7 -7
- package/dist/src/rules/erb-strict-locals-comment-syntax.js +1 -1
- package/dist/src/rules/erb-strict-locals-comment-syntax.js.map +1 -1
- package/package.json +7 -7
- package/src/rules/erb-strict-locals-comment-syntax.ts +1 -1
package/dist/loader.js
CHANGED
|
@@ -161,7 +161,7 @@ class Token {
|
|
|
161
161
|
}
|
|
162
162
|
|
|
163
163
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
164
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
164
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.10/templates/javascript/packages/core/src/errors.ts.erb
|
|
165
165
|
class HerbError {
|
|
166
166
|
type;
|
|
167
167
|
message;
|
|
@@ -698,6 +698,40 @@ class ERBMultipleBlocksInTagError extends HerbError {
|
|
|
698
698
|
return output;
|
|
699
699
|
}
|
|
700
700
|
}
|
|
701
|
+
class ERBCaseWithConditionsError extends HerbError {
|
|
702
|
+
static from(data) {
|
|
703
|
+
return new ERBCaseWithConditionsError({
|
|
704
|
+
type: data.type,
|
|
705
|
+
message: data.message,
|
|
706
|
+
location: Location.from(data.location),
|
|
707
|
+
});
|
|
708
|
+
}
|
|
709
|
+
constructor(props) {
|
|
710
|
+
super(props.type, props.message, props.location);
|
|
711
|
+
}
|
|
712
|
+
toJSON() {
|
|
713
|
+
return {
|
|
714
|
+
...super.toJSON(),
|
|
715
|
+
type: "ERB_CASE_WITH_CONDITIONS_ERROR",
|
|
716
|
+
};
|
|
717
|
+
}
|
|
718
|
+
toMonacoDiagnostic() {
|
|
719
|
+
return {
|
|
720
|
+
line: this.location.start.line,
|
|
721
|
+
column: this.location.start.column,
|
|
722
|
+
endLine: this.location.end.line,
|
|
723
|
+
endColumn: this.location.end.column,
|
|
724
|
+
message: this.message,
|
|
725
|
+
severity: 'error'
|
|
726
|
+
};
|
|
727
|
+
}
|
|
728
|
+
treeInspect() {
|
|
729
|
+
let output = "";
|
|
730
|
+
output += `@ ERBCaseWithConditionsError ${this.location.treeInspectWithLabel()}\n`;
|
|
731
|
+
output += `└── message: "${this.message}"\n`;
|
|
732
|
+
return output;
|
|
733
|
+
}
|
|
734
|
+
}
|
|
701
735
|
function fromSerializedError(error) {
|
|
702
736
|
switch (error.type) {
|
|
703
737
|
case "UNEXPECTED_ERROR": return UnexpectedError.from(error);
|
|
@@ -712,6 +746,7 @@ function fromSerializedError(error) {
|
|
|
712
746
|
case "ERB_CONTROL_FLOW_SCOPE_ERROR": return ERBControlFlowScopeError.from(error);
|
|
713
747
|
case "MISSINGERB_END_TAG_ERROR": return MissingERBEndTagError.from(error);
|
|
714
748
|
case "ERB_MULTIPLE_BLOCKS_IN_TAG_ERROR": return ERBMultipleBlocksInTagError.from(error);
|
|
749
|
+
case "ERB_CASE_WITH_CONDITIONS_ERROR": return ERBCaseWithConditionsError.from(error);
|
|
715
750
|
default:
|
|
716
751
|
throw new Error(`Unknown node type: ${error.type}`);
|
|
717
752
|
}
|
|
@@ -726,7 +761,7 @@ function convertToUTF8(string) {
|
|
|
726
761
|
}
|
|
727
762
|
|
|
728
763
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
729
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
764
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.10/templates/javascript/packages/core/src/nodes.ts.erb
|
|
730
765
|
class Node {
|
|
731
766
|
type;
|
|
732
767
|
location;
|
|
@@ -2980,7 +3015,7 @@ class ParseResult extends Result {
|
|
|
2980
3015
|
}
|
|
2981
3016
|
|
|
2982
3017
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
2983
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
3018
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.10/templates/javascript/packages/core/src/node-type-guards.ts.erb
|
|
2984
3019
|
/**
|
|
2985
3020
|
* Type guard functions for AST nodes.
|
|
2986
3021
|
* These functions provide type checking by combining both instanceof
|
|
@@ -3683,7 +3718,7 @@ function didyoumean(input, list, threshold) {
|
|
|
3683
3718
|
}
|
|
3684
3719
|
|
|
3685
3720
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
3686
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.
|
|
3721
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.8.10/templates/javascript/packages/core/src/visitor.ts.erb
|
|
3687
3722
|
class Visitor {
|
|
3688
3723
|
visit(node) {
|
|
3689
3724
|
if (!node)
|
|
@@ -8275,7 +8310,7 @@ function splitByTopLevelComma(str) {
|
|
|
8275
8310
|
return result;
|
|
8276
8311
|
}
|
|
8277
8312
|
|
|
8278
|
-
const STRICT_LOCALS_PATTERN = /^locals:\s+\(
|
|
8313
|
+
const STRICT_LOCALS_PATTERN = /^locals:\s+\(.*\)\s*$/s;
|
|
8279
8314
|
function isValidStrictLocalsFormat(content) {
|
|
8280
8315
|
return STRICT_LOCALS_PATTERN.test(content);
|
|
8281
8316
|
}
|