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