@cookshack/eslint-config 0.1.2 → 0.1.3

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
@@ -6,7 +6,9 @@ exports.rules = void 0; exports.languageOptions = void 0; exports.plugins = void
6
6
 
7
7
  exports.plugins = { 'cookshack': { rules: { 'no-logical-not': { meta: { type: 'problem',
8
8
  docs: { description: 'Prevent !.' },
9
- messages: { logicalNot: 'Logical not used.' },
9
+ messages: { logicalNot: 'Logical not used.',
10
+ inequality: 'Inequality operator used.',
11
+ strictInequality: 'Strict inequality operator used.' },
10
12
  schema: [] }, // options
11
13
  create(context) {
12
14
  return {
@@ -14,6 +16,14 @@ exports.plugins = { 'cookshack': { rules: { 'no-logical-not': { meta: { type: 'p
14
16
  if (node.operator == '!')
15
17
  context.report({ node,
16
18
  messageId: 'logicalNot' });
19
+ },
20
+ BinaryExpression(node) {
21
+ if (node.operator == '!=')
22
+ context.report({ node,
23
+ messageId: 'inequality' });
24
+ else if (node.operator == '!==')
25
+ context.report({ node,
26
+ messageId: 'strictInequality' });
17
27
  }
18
28
  }
19
29
  } } } } };
package/dist/index.js CHANGED
@@ -4,7 +4,9 @@ let rules, languageOptions, plugins;
4
4
 
5
5
  plugins = { 'cookshack': { rules: { 'no-logical-not': { meta: { type: 'problem',
6
6
  docs: { description: 'Prevent !.' },
7
- messages: { logicalNot: 'Logical not used.' },
7
+ messages: { logicalNot: 'Logical not used.',
8
+ inequality: 'Inequality operator used.',
9
+ strictInequality: 'Strict inequality operator used.' },
8
10
  schema: [] }, // options
9
11
  create(context) {
10
12
  return {
@@ -12,6 +14,14 @@ plugins = { 'cookshack': { rules: { 'no-logical-not': { meta: { type: 'problem',
12
14
  if (node.operator == '!')
13
15
  context.report({ node,
14
16
  messageId: 'logicalNot' });
17
+ },
18
+ BinaryExpression(node) {
19
+ if (node.operator == '!=')
20
+ context.report({ node,
21
+ messageId: 'inequality' });
22
+ else if (node.operator == '!==')
23
+ context.report({ node,
24
+ messageId: 'strictInequality' });
15
25
  }
16
26
  }
17
27
  } } } } };
package/index.js CHANGED
@@ -4,7 +4,9 @@ export let rules, languageOptions, plugins
4
4
 
5
5
  plugins = { 'cookshack': { rules: { 'no-logical-not': { meta: { type: 'problem',
6
6
  docs: { description: 'Prevent !.' },
7
- messages: { logicalNot: 'Logical not used.' },
7
+ messages: { logicalNot: 'Logical not used.',
8
+ inequality: 'Inequality operator used.',
9
+ strictInequality: 'Strict inequality operator used.' },
8
10
  schema: [] }, // options
9
11
  create(context) {
10
12
  return {
@@ -12,6 +14,14 @@ plugins = { 'cookshack': { rules: { 'no-logical-not': { meta: { type: 'problem',
12
14
  if (node.operator == '!')
13
15
  context.report({ node,
14
16
  messageId: 'logicalNot' })
17
+ },
18
+ BinaryExpression(node) {
19
+ if (node.operator == '!=')
20
+ context.report({ node,
21
+ messageId: 'inequality' })
22
+ else if (node.operator == '!==')
23
+ context.report({ node,
24
+ messageId: 'strictInequality' })
15
25
  }
16
26
  }
17
27
  } } } } }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cookshack/eslint-config",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "ESLint config for Cookshack projects",
5
5
  "homepage": "https://git.sr.ht/~mattmundell/eslint-config",
6
6
  "type": "module",