Skip to content

Commit b10dfa0

Browse files
NullVoxPopuliclaude
andcommitted
Remove HTML comment support for template-lint-disable
Only mustache comments ({{! ... }} and {{!-- ... --}}) are supported for the template-lint-disable directive. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
1 parent e93b01f commit b10dfa0

2 files changed

Lines changed: 3 additions & 19 deletions

File tree

lib/processors/template-lint-disable.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@
33
const noop = require('ember-eslint-parser/noop');
44

55
/**
6-
* Regex patterns for template-lint-disable comments:
6+
* Regex pattern for template-lint-disable mustache comments:
77
* {{! template-lint-disable rule1 rule2 }}
88
* {{!-- template-lint-disable rule1 rule2 --}}
9-
* <!-- template-lint-disable rule1 rule2 -->
109
*/
1110
const TEMPLATE_LINT_DISABLE_REGEX =
12-
/(?:{{!-*\s*template-lint-disable\s*([\s\S]*?)-*}}|<!--\s*template-lint-disable\s*([\s\S]*?)-->)/g;
11+
/{{!-*\s*template-lint-disable\s*([\s\S]*?)-*}}/g;
1312

1413
// Store disable directives per file
1514
const fileDisableDirectives = new Map();
@@ -30,7 +29,7 @@ function parseDisableDirectives(text) {
3029
let match;
3130

3231
while ((match = TEMPLATE_LINT_DISABLE_REGEX.exec(line)) !== null) {
33-
const rulesPart = (match[1] || match[2] || '').trim();
32+
const rulesPart = (match[1] || '').trim();
3433
// Strip trailing -- from mustache block comments
3534
const cleaned = rulesPart.replace(/-+$/, '').trim();
3635

tests/lib/rules-preprocessor/gjs-gts-parser-test.js

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -918,21 +918,6 @@ describe('supports template-lint-disable directive', () => {
918918
expect(resultErrors).toHaveLength(0);
919919
});
920920

921-
it('disables all rules on the next line with HTML comment', async () => {
922-
const eslint = initESLint();
923-
const code = `
924-
<template>
925-
<div>
926-
<!-- template-lint-disable -->
927-
{{test}}
928-
</div>
929-
</template>
930-
`;
931-
const results = await eslint.lintText(code, { filePath: 'my-component.gjs' });
932-
const resultErrors = results.flatMap((result) => result.messages);
933-
expect(resultErrors).toHaveLength(0);
934-
});
935-
936921
it('disables a specific rule by eslint rule name', async () => {
937922
const eslint = initESLint();
938923
const code = `

0 commit comments

Comments
 (0)