-
-
Notifications
You must be signed in to change notification settings - Fork 211
Expand file tree
/
Copy pathtemplate-no-negated-comparison.js
More file actions
34 lines (33 loc) · 872 Bytes
/
template-no-negated-comparison.js
File metadata and controls
34 lines (33 loc) · 872 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'disallow negated comparisons in templates',
category: 'Best Practices',
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/template-no-negated-comparison.md',
templateMode: 'both',
},
fixable: null,
schema: [],
messages: {
noNegatedComparison: 'Use positive comparison operators instead of negated ones.',
},
},
create(context) {
return {
GlimmerSubExpression(node) {
if (
node.path &&
node.path.type === 'GlimmerPathExpression' &&
node.path.original === 'not-eq'
) {
context.report({
node,
messageId: 'noNegatedComparison',
});
}
},
};
},
};