@cookshack/eslint-config 0.1.1 → 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 +18 -1
- package/dist/index.js +19 -2
- package/index.js +18 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2,7 +2,21 @@
|
|
|
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' ],
|
|
@@ -32,8 +46,11 @@ exports.rules = {
|
|
|
32
46
|
{ blankLine: 'never', prev: 'let', next: 'let' } ],
|
|
33
47
|
'no-case-declarations': 'error',
|
|
34
48
|
'no-global-assign': 'error',
|
|
49
|
+
'cookshack/no-logical-not': 'error',
|
|
35
50
|
'no-multi-spaces': 'error',
|
|
36
51
|
'no-multiple-empty-lines': [ 'error', { max: 1, maxEOF: 0 } ],
|
|
52
|
+
'no-negated-condition': 'error',
|
|
53
|
+
'no-unsafe-negation': 'error',
|
|
37
54
|
'no-redeclare': 'error',
|
|
38
55
|
'no-tabs': 'error',
|
|
39
56
|
'no-trailing-spaces': 'error',
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,20 @@
|
|
|
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' ],
|
|
@@ -30,8 +44,11 @@ rules = {
|
|
|
30
44
|
{ blankLine: 'never', prev: 'let', next: 'let' } ],
|
|
31
45
|
'no-case-declarations': 'error',
|
|
32
46
|
'no-global-assign': 'error',
|
|
47
|
+
'cookshack/no-logical-not': 'error',
|
|
33
48
|
'no-multi-spaces': 'error',
|
|
34
49
|
'no-multiple-empty-lines': [ 'error', { max: 1, maxEOF: 0 } ],
|
|
50
|
+
'no-negated-condition': 'error',
|
|
51
|
+
'no-unsafe-negation': 'error',
|
|
35
52
|
'no-redeclare': 'error',
|
|
36
53
|
'no-tabs': 'error',
|
|
37
54
|
'no-trailing-spaces': 'error',
|
|
@@ -55,4 +72,4 @@ languageOptions = {
|
|
|
55
72
|
},
|
|
56
73
|
};
|
|
57
74
|
|
|
58
|
-
export { languageOptions, rules };
|
|
75
|
+
export { languageOptions, plugins, rules };
|
package/index.js
CHANGED
|
@@ -1,6 +1,20 @@
|
|
|
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' ],
|
|
@@ -30,8 +44,11 @@ rules = {
|
|
|
30
44
|
{ blankLine: 'never', prev: 'let', next: 'let' } ],
|
|
31
45
|
'no-case-declarations': 'error',
|
|
32
46
|
'no-global-assign': 'error',
|
|
47
|
+
'cookshack/no-logical-not': 'error',
|
|
33
48
|
'no-multi-spaces': 'error',
|
|
34
49
|
'no-multiple-empty-lines': [ 'error', { max: 1, maxEOF: 0 } ],
|
|
50
|
+
'no-negated-condition': 'error',
|
|
51
|
+
'no-unsafe-negation': 'error',
|
|
35
52
|
'no-redeclare': 'error',
|
|
36
53
|
'no-tabs': 'error',
|
|
37
54
|
'no-trailing-spaces': 'error',
|