@cookshack/eslint-config 0.1.0 → 0.1.2

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
@@ -2,11 +2,26 @@
2
2
 
3
3
  var globals = require('globals');
4
4
 
5
- exports.rules = void 0; exports.languageOptions = void 0;
5
+ exports.rules = void 0; exports.languageOptions = void 0; exports.plugins = void 0;
6
+
7
+ exports.plugins = { 'cookshack': { rules: { 'no-logical-not': { meta: { type: 'problem',
8
+ docs: { description: 'Prevent !.' },
9
+ messages: { logicalNot: 'Logical not used.' },
10
+ schema: [] }, // options
11
+ create(context) {
12
+ return {
13
+ UnaryExpression(node) {
14
+ if (node.operator == '!')
15
+ context.report({ node,
16
+ messageId: 'logicalNot' });
17
+ }
18
+ }
19
+ } } } } };
6
20
 
7
21
  exports.rules = {
8
22
  'array-bracket-newline': [ 'error', 'never' ],
9
23
  'array-bracket-spacing': [ 'error', 'always' ],
24
+ 'arrow-parens': [ 'error', 'as-needed' ],
10
25
  'brace-style': [ 'error', 'stroustrup' ],
11
26
  'curly': [ 'error', 'multi' ],
12
27
  'eol-last': [ 'error', 'always' ],
@@ -31,8 +46,11 @@ exports.rules = {
31
46
  { blankLine: 'never', prev: 'let', next: 'let' } ],
32
47
  'no-case-declarations': 'error',
33
48
  'no-global-assign': 'error',
49
+ 'cookshack/no-logical-not': 'error',
34
50
  'no-multi-spaces': 'error',
35
- 'no-multiple-empty-lines': [ 'error', { max: 2, maxEOF: 0 } ],
51
+ 'no-multiple-empty-lines': [ 'error', { max: 1, maxEOF: 0 } ],
52
+ 'no-negated-condition': 'error',
53
+ 'no-unsafe-negation': 'error',
36
54
  'no-redeclare': 'error',
37
55
  'no-tabs': 'error',
38
56
  'no-trailing-spaces': 'error',
package/dist/index.js CHANGED
@@ -1,10 +1,25 @@
1
1
  import globals from 'globals';
2
2
 
3
- let rules, languageOptions;
3
+ let rules, languageOptions, plugins;
4
+
5
+ plugins = { 'cookshack': { rules: { 'no-logical-not': { meta: { type: 'problem',
6
+ docs: { description: 'Prevent !.' },
7
+ messages: { logicalNot: 'Logical not used.' },
8
+ schema: [] }, // options
9
+ create(context) {
10
+ return {
11
+ UnaryExpression(node) {
12
+ if (node.operator == '!')
13
+ context.report({ node,
14
+ messageId: 'logicalNot' });
15
+ }
16
+ }
17
+ } } } } };
4
18
 
5
19
  rules = {
6
20
  'array-bracket-newline': [ 'error', 'never' ],
7
21
  'array-bracket-spacing': [ 'error', 'always' ],
22
+ 'arrow-parens': [ 'error', 'as-needed' ],
8
23
  'brace-style': [ 'error', 'stroustrup' ],
9
24
  'curly': [ 'error', 'multi' ],
10
25
  'eol-last': [ 'error', 'always' ],
@@ -29,8 +44,11 @@ rules = {
29
44
  { blankLine: 'never', prev: 'let', next: 'let' } ],
30
45
  'no-case-declarations': 'error',
31
46
  'no-global-assign': 'error',
47
+ 'cookshack/no-logical-not': 'error',
32
48
  'no-multi-spaces': 'error',
33
- 'no-multiple-empty-lines': [ 'error', { max: 2, maxEOF: 0 } ],
49
+ 'no-multiple-empty-lines': [ 'error', { max: 1, maxEOF: 0 } ],
50
+ 'no-negated-condition': 'error',
51
+ 'no-unsafe-negation': 'error',
34
52
  'no-redeclare': 'error',
35
53
  'no-tabs': 'error',
36
54
  'no-trailing-spaces': 'error',
@@ -54,4 +72,4 @@ languageOptions = {
54
72
  },
55
73
  };
56
74
 
57
- export { languageOptions, rules };
75
+ export { languageOptions, plugins, rules };
package/index.js CHANGED
@@ -1,10 +1,25 @@
1
1
  import globals from 'globals'
2
2
 
3
- export let rules, languageOptions
3
+ export let rules, languageOptions, plugins
4
+
5
+ plugins = { 'cookshack': { rules: { 'no-logical-not': { meta: { type: 'problem',
6
+ docs: { description: 'Prevent !.' },
7
+ messages: { logicalNot: 'Logical not used.' },
8
+ schema: [] }, // options
9
+ create(context) {
10
+ return {
11
+ UnaryExpression(node) {
12
+ if (node.operator == '!')
13
+ context.report({ node,
14
+ messageId: 'logicalNot' })
15
+ }
16
+ }
17
+ } } } } }
4
18
 
5
19
  rules = {
6
20
  'array-bracket-newline': [ 'error', 'never' ],
7
21
  'array-bracket-spacing': [ 'error', 'always' ],
22
+ 'arrow-parens': [ 'error', 'as-needed' ],
8
23
  'brace-style': [ 'error', 'stroustrup' ],
9
24
  'curly': [ 'error', 'multi' ],
10
25
  'eol-last': [ 'error', 'always' ],
@@ -29,8 +44,11 @@ rules = {
29
44
  { blankLine: 'never', prev: 'let', next: 'let' } ],
30
45
  'no-case-declarations': 'error',
31
46
  'no-global-assign': 'error',
47
+ 'cookshack/no-logical-not': 'error',
32
48
  'no-multi-spaces': 'error',
33
- 'no-multiple-empty-lines': [ 'error', { max: 2, maxEOF: 0 } ],
49
+ 'no-multiple-empty-lines': [ 'error', { max: 1, maxEOF: 0 } ],
50
+ 'no-negated-condition': 'error',
51
+ 'no-unsafe-negation': 'error',
34
52
  'no-redeclare': 'error',
35
53
  'no-tabs': 'error',
36
54
  'no-trailing-spaces': 'error',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cookshack/eslint-config",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "ESLint config for Cookshack projects",
5
5
  "homepage": "https://git.sr.ht/~mattmundell/eslint-config",
6
6
  "type": "module",