@herb-tools/linter 0.8.8 → 0.8.9

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*$/;
2292
2292
  function isValidStrictLocalsFormat(content) {
2293
2293
  return STRICT_LOCALS_PATTERN.test(content);
2294
2294
  }
@@ -2318,6 +2318,9 @@ function detectSingularLocal(content) {
2318
2318
  function detectMissingColonBeforeParens(content) {
2319
2319
  return /^locals\s+\(/.test(content);
2320
2320
  }
2321
+ function detectMissingSpaceAfterColon(content) {
2322
+ return /^locals:\(/.test(content);
2323
+ }
2321
2324
  function detectMissingParentheses(content) {
2322
2325
  return /^locals:\s*[^(]/.test(content);
2323
2326
  }
@@ -2464,6 +2467,10 @@ class ERBStrictLocalsCommentSyntaxVisitor extends BaseRuleVisitor {
2464
2467
  this.addOffense("Use `locals:` with a colon before the parentheses, not `locals (`.", node.location);
2465
2468
  return;
2466
2469
  }
2470
+ if (detectMissingSpaceAfterColon(commentContent)) {
2471
+ this.addOffense("Missing space after `locals:`. Rails Strict Locals require a space after the colon: `<%# locals: (...) %>`.", node.location);
2472
+ return;
2473
+ }
2467
2474
  if (detectMissingParentheses(commentContent)) {
2468
2475
  this.addOffense("Wrap parameters in parentheses: `locals: (name:)` or `locals: (name: default)`.", node.location);
2469
2476
  return;