@ornikar/eslint-config 22.7.4 → 23.0.0
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/.eslintrc.json +4 -0
- package/CHANGELOG.md +7 -613
- package/README.md +33 -62
- package/_shared.js +11 -9
- package/graphql.js +10 -12
- package/index.js +16 -24
- package/node-module-override.js +6 -12
- package/node.js +3 -5
- package/package.json +3 -4
- package/rollup.js +5 -9
- package/root.js +14 -17
- package/rules/best-practices.js +9 -11
- package/rules/imports.js +8 -10
- package/rules/jest.js +7 -13
- package/rules/node-override.js +23 -25
- package/rules/node.js +32 -28
- package/rules/ornikar.js +4 -8
- package/rules/prettier.js +10 -13
- package/rules/security.js +19 -21
- package/rules/sort-imports-exports.js +11 -15
- package/rules/style.js +31 -33
- package/rules/unicorn.js +214 -218
- package/tests-override.js +18 -17
package/rules/security.js
CHANGED
|
@@ -1,24 +1,22 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
{
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
'security/detect-unsafe-regex': 'error',
|
|
22
|
-
},
|
|
3
|
+
module.exports = {
|
|
4
|
+
// https://github.com/nodesecurity/eslint-plugin-security
|
|
5
|
+
plugins: ['security'],
|
|
6
|
+
extends: ['plugin:security/recommended-legacy'],
|
|
7
|
+
rules: {
|
|
8
|
+
'security/detect-buffer-noassert': 'error',
|
|
9
|
+
'security/detect-child-process': 'error',
|
|
10
|
+
'security/detect-disable-mustache-escape': 'error',
|
|
11
|
+
'security/detect-eval-with-expression': 'error',
|
|
12
|
+
'security/detect-new-buffer': 'error',
|
|
13
|
+
'security/detect-no-csrf-before-method-override': 'error',
|
|
14
|
+
'security/detect-non-literal-fs-filename': 'error',
|
|
15
|
+
'security/detect-non-literal-regexp': 'error',
|
|
16
|
+
'security/detect-non-literal-require': 'error',
|
|
17
|
+
'security/detect-object-injection': 'off', // we use it when necessary and don't call it so not a security issue for us
|
|
18
|
+
'security/detect-possible-timing-attacks': 'error',
|
|
19
|
+
'security/detect-pseudoRandomBytes': 'error',
|
|
20
|
+
'security/detect-unsafe-regex': 'error',
|
|
23
21
|
},
|
|
24
|
-
|
|
22
|
+
};
|
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
},
|
|
14
|
-
],
|
|
15
|
-
'simple-import-sort/exports': 'error',
|
|
16
|
-
},
|
|
3
|
+
module.exports = {
|
|
4
|
+
plugins: ['simple-import-sort'],
|
|
5
|
+
rules: {
|
|
6
|
+
'sort-imports': [
|
|
7
|
+
'error',
|
|
8
|
+
{
|
|
9
|
+
ignoreDeclarationSort: true,
|
|
10
|
+
},
|
|
11
|
+
],
|
|
12
|
+
'simple-import-sort/exports': 'error',
|
|
17
13
|
},
|
|
18
|
-
|
|
14
|
+
};
|
package/rules/style.js
CHANGED
|
@@ -1,41 +1,39 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
module.exports =
|
|
4
|
-
{
|
|
5
|
-
rules
|
|
6
|
-
/* changed rules */
|
|
3
|
+
module.exports = {
|
|
4
|
+
rules: {
|
|
5
|
+
/* changed rules */
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
// http://eslint.org/docs/rules/no-plusplus
|
|
8
|
+
'no-plusplus': 'off',
|
|
10
9
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
// when a function is exported, it makes more sense to use curly braces, but with callbacks use expressions.
|
|
11
|
+
// We should use eslint-plugin-proper-arrows or similar
|
|
12
|
+
// http://eslint.org/docs/rules/arrow-body-style
|
|
13
|
+
'arrow-body-style': 'off',
|
|
15
14
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
15
|
+
// http://eslint.org/docs/rules/no-unused-vars
|
|
16
|
+
'no-unused-vars': [
|
|
17
|
+
'error',
|
|
18
|
+
{
|
|
19
|
+
vars: 'all',
|
|
20
|
+
args: 'none', // changed after-used to none
|
|
21
|
+
// ESLint 9 changed the default from 'none' to 'all'; restore the v8 behaviour.
|
|
22
|
+
caughtErrors: 'none',
|
|
23
|
+
ignoreRestSiblings: true,
|
|
24
|
+
},
|
|
25
|
+
],
|
|
27
26
|
|
|
28
|
-
|
|
27
|
+
/* stricter rules */
|
|
29
28
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
},
|
|
29
|
+
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/order.md
|
|
30
|
+
'import/order': [
|
|
31
|
+
'error',
|
|
32
|
+
{
|
|
33
|
+
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
|
|
34
|
+
alphabetize: { order: 'asc', caseInsensitive: false },
|
|
35
|
+
'newlines-between': 'never',
|
|
36
|
+
},
|
|
37
|
+
],
|
|
40
38
|
},
|
|
41
|
-
|
|
39
|
+
};
|