diff --git a/docs/rules/template-no-negated-comparison.md b/docs/rules/template-no-negated-comparison.md index d5383fe5ad..2b46e145b5 100644 --- a/docs/rules/template-no-negated-comparison.md +++ b/docs/rules/template-no-negated-comparison.md @@ -6,7 +6,7 @@ Disallows negated comparison operators in templates. ## Rule Details -Use positive comparison operators with `{{unless}}` instead of negated comparison operators like `not-eq` or `ne`. +Use positive comparison operators with `{{unless}}` instead of negated comparison operators like `not-eq`. ## Examples @@ -20,14 +20,6 @@ Examples of **incorrect** code for this rule: ``` -```gjs - -``` - Examples of **correct** code for this rule: ```gjs @@ -45,7 +37,3 @@ Examples of **correct** code for this rule: {{/if}} ``` - -## References - -- [eslint-plugin-ember template-no-negated-condition](https://github.com/ember-cli/eslint-plugin-ember/blob/master/docs/rules/template-no-negated-condition.md) diff --git a/lib/rules/template-no-negated-comparison.js b/lib/rules/template-no-negated-comparison.js index 3c5244d86e..6ae92584e8 100644 --- a/lib/rules/template-no-negated-comparison.js +++ b/lib/rules/template-no-negated-comparison.js @@ -21,7 +21,7 @@ module.exports = { if ( node.path && node.path.type === 'GlimmerPathExpression' && - (node.path.original === 'not-eq' || node.path.original === 'ne') + node.path.original === 'not-eq' ) { context.report({ node, diff --git a/tests/lib/rules/template-no-negated-comparison.js b/tests/lib/rules/template-no-negated-comparison.js index 187d5c0abb..c6a99f8045 100644 --- a/tests/lib/rules/template-no-negated-comparison.js +++ b/tests/lib/rules/template-no-negated-comparison.js @@ -29,6 +29,12 @@ ruleTester.run('template-no-negated-comparison', rule, { ``, + // `ne` is not a standard Ember/ember-truth-helpers helper; the rule must not flag it. + ``, ], invalid: [ @@ -46,20 +52,6 @@ ruleTester.run('template-no-negated-comparison', rule, { }, ], }, - { - code: ``, - output: null, - errors: [ - { - message: 'Use positive comparison operators instead of negated ones.', - type: 'GlimmerSubExpression', - }, - ], - }, { code: `