@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/rules/security.js CHANGED
@@ -1,24 +1,22 @@
1
1
  'use strict';
2
2
 
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
- },
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
- 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
- },
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
- // http://eslint.org/docs/rules/no-plusplus
9
- 'no-plusplus': 'off',
7
+ // http://eslint.org/docs/rules/no-plusplus
8
+ 'no-plusplus': 'off',
10
9
 
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',
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
- // 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
- ],
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
- /* stricter rules */
27
+ /* stricter rules */
29
28
 
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
- },
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
+ };