@perfective/eslint-config 0.25.1 → 0.26.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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License
2
2
 
3
- Copyright (c) 2020-2022 Andrey Mikheychik (https://github.com/amikheychik)
3
+ Copyright (c) 2020-2024 Andrey Mikheychik (https://github.com/amikheychik)
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.adoc CHANGED
@@ -20,10 +20,11 @@ and https://eslint.style[ESLint Stylistic] plugin rules,
20
20
  * `link:https://github.com/dangreenisrael/eslint-plugin-jest-formatting[eslint-plugin-jest-formatting]`
21
21
  _(optional, required if `eslint-plugin-jest` is installed)_;
22
22
  * `link:https://github.com/gajus/eslint-plugin-jsdoc[eslint-plugin-jsdoc]`;
23
- * `link:https://github.com/mysticatea/eslint-plugin-node[eslint-plugin-node]`;
23
+ * `link:https://github.com/eslint-community/eslint-plugin-n[eslint-plugin-n]`;
24
24
  * `link:https://github.com/TristonJ/eslint-plugin-prefer-arrow[eslint-plugin-prefer-arrow]`;
25
25
  * `link:https://github.com/eslint-community/eslint-plugin-promise[eslint-plugin-promise]`;
26
26
  * `link:https://github.com/cartant/eslint-plugin-rxjs[eslint-plugin-rxjs]` _(optional)_;
27
+ * `link:https://github.com/eslint-community/eslint-plugin-security[eslint-plugin-security]`;
27
28
  * `link:https://github.com/lydell/eslint-plugin-simple-import-sort[eslint-plugin-simple-import-sort]`;
28
29
  * `link:https://github.com/SonarSource/eslint-plugin-sonarjs[eslint-plugin-sonarjs]`;
29
30
  * `link:https://github.com/testing-library/eslint-plugin-testing-library[eslint-plugin-testing-library]` _(optional)_;
@@ -55,9 +56,10 @@ npm install --save-dev \
55
56
  eslint-plugin-eslint-comments \
56
57
  eslint-plugin-import \
57
58
  eslint-plugin-jsdoc \
58
- eslint-plugin-node \
59
+ eslint-plugin-n \
59
60
  eslint-plugin-prefer-arrow \
60
61
  eslint-plugin-promise \
62
+ eslint-plugin-security \
61
63
  eslint-plugin-simple-import-sort \
62
64
  eslint-plugin-sonarjs \
63
65
  eslint-plugin-unicorn \
package/README.md CHANGED
@@ -20,10 +20,11 @@ and [ESlint Stylistic](https://eslint.style) plugin rules,
20
20
  - [`eslint-plugin-jest-formatting`](https://github.com/dangreenisrael/eslint-plugin-jest-formatting)
21
21
  _(optional, required if `eslint-plugin-jest` is installed)_;
22
22
  - [`eslint-plugin-jsdoc`](https://github.com/gajus/eslint-plugin-jsdoc);
23
- - [`eslint-plugin-node`](https://github.com/mysticatea/eslint-plugin-node);
23
+ - [`eslint-plugin-n`](https://github.com/eslint-community/eslint-plugin-n);
24
24
  - [`eslint-plugin-prefer-arrow`](https://github.com/TristonJ/eslint-plugin-prefer-arrow);
25
25
  - [`eslint-plugin-promise`](https://github.com/eslint-community/eslint-plugin-promise);
26
26
  - [`eslint-plugin-rxjs`](https://github.com/cartant/eslint-plugin-rxjs) _(optional)_;
27
+ - [`eslint-plugin-security`](https://github.com/eslint-community/eslint-plugin-security);
27
28
  - [`eslint-plugin-simple-import-sort`](https://github.com/lydell/eslint-plugin-simple-import-sort);
28
29
  - [`eslint-plugin-sonarjs`](https://github.com/SonarSource/eslint-plugin-sonarjs);
29
30
  - [`eslint-plugin-testing-library`](https://github.com/testing-library/eslint-plugin-testing-library) _(optional)_;
@@ -53,9 +54,10 @@ from issues that will be fixed automatically.
53
54
  eslint-plugin-eslint-comments \
54
55
  eslint-plugin-import \
55
56
  eslint-plugin-jsdoc \
56
- eslint-plugin-node \
57
+ eslint-plugin-n \
57
58
  eslint-plugin-prefer-arrow \
58
59
  eslint-plugin-promise \
60
+ eslint-plugin-security \
59
61
  eslint-plugin-simple-import-sort \
60
62
  eslint-plugin-sonarjs \
61
63
  eslint-plugin-unicorn \
package/index.js CHANGED
@@ -16,9 +16,9 @@ module.exports = {
16
16
  './rules/import',
17
17
  './rules/jsdoc',
18
18
  './rules/n',
19
- './rules/node',
20
19
  './rules/prefer-arrow',
21
20
  './rules/promise',
21
+ './rules/security',
22
22
  './rules/simple-import-sort',
23
23
  './rules/sonarjs',
24
24
  './rules/stylistic/js',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@perfective/eslint-config",
3
- "version": "0.25.1",
3
+ "version": "0.26.0",
4
4
  "description": "ESLint shareable rules configuration",
5
5
  "keywords": ["code quality", "code standard", "code style", "eslint", "eslint config", "lint", "perfective", "tslint", "tslint config", "typescript"],
6
6
  "author": "Andrey Mikheychik <a.mikheychik@gmail.com>",
@@ -12,10 +12,10 @@
12
12
  "license": "MIT",
13
13
  "peerDependencies": {
14
14
  "@babel/eslint-parser": "^7.24.7",
15
- "@stylistic/eslint-plugin": "^2.1.0",
16
- "@typescript-eslint/eslint-plugin": "^7.12.0",
15
+ "@stylistic/eslint-plugin": "^2.2.2",
16
+ "@typescript-eslint/eslint-plugin": "^7.13.1",
17
17
  "@typescript-eslint/eslint-plugin-tslint": "^7.0.2",
18
- "@typescript-eslint/parser": "^7.12.0",
18
+ "@typescript-eslint/parser": "^7.13.1",
19
19
  "eslint": "^8.57.0",
20
20
  "eslint-import-resolver-typescript": "^3.6.1",
21
21
  "eslint-plugin-array-func": "^4.0.0",
@@ -26,16 +26,16 @@
26
26
  "eslint-plugin-jest": "^28.6.0",
27
27
  "eslint-plugin-jest-dom": "^5.4.0",
28
28
  "eslint-plugin-jest-formatting": "^3.1.0",
29
- "eslint-plugin-jsdoc": "^48.2.9",
30
- "eslint-plugin-n": "^17.8.1",
31
- "eslint-plugin-node": "^11.1.0",
29
+ "eslint-plugin-jsdoc": "^48.2.12",
30
+ "eslint-plugin-n": "^17.9.0",
32
31
  "eslint-plugin-prefer-arrow": "^1.2.3",
33
32
  "eslint-plugin-promise": "^6.2.0",
34
33
  "eslint-plugin-rxjs": "^5.0.3",
34
+ "eslint-plugin-security": "^3.0.1",
35
35
  "eslint-plugin-simple-import-sort": "^12.1.0",
36
36
  "eslint-plugin-sonarjs": "^1.0.3",
37
37
  "eslint-plugin-testing-library": "^6.2.2",
38
- "eslint-plugin-unicorn": "^53.0.0",
38
+ "eslint-plugin-unicorn": "^54.0.0",
39
39
  "tslint": "^6.1.3"
40
40
  },
41
41
  "peerDependenciesMeta": {
package/rules/n/index.js CHANGED
@@ -29,9 +29,12 @@ module.exports = {
29
29
  allowAtRootLevel: false,
30
30
  }],
31
31
  'n/no-unpublished-bin': 'error',
32
- 'n/no-unpublished-import': 'error',
32
+ 'n/no-unpublished-import': ['error', {
33
+ ignorePrivate: false,
34
+ }],
33
35
  'n/no-unpublished-require': ['error', {
34
36
  allowModules: [],
37
+ ignorePrivate: false,
35
38
  tryExtensions: ['.js', '.json', '.node'],
36
39
  }],
37
40
  'n/no-unsupported-features/es-builtins': ['error', {
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ module.exports = {
3
+ plugins: [
4
+ 'security',
5
+ ],
6
+ rules: {
7
+ 'security/detect-bidi-characters': 'error',
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': 'error',
18
+ 'security/detect-possible-timing-attacks': 'error',
19
+ 'security/detect-pseudoRandomBytes': 'error',
20
+ 'security/detect-unsafe-regex': 'error',
21
+ },
22
+ };
@@ -156,6 +156,7 @@ module.exports = {
156
156
  '@stylistic/js/quotes': ['warn', 'single', {
157
157
  avoidEscape: true,
158
158
  allowTemplateLiterals: true,
159
+ ignoreStringLiterals: false,
159
160
  }],
160
161
  '@stylistic/js/rest-spread-spacing': ['warn', 'never'],
161
162
  '@stylistic/js/semi': ['warn', 'always'],
@@ -51,6 +51,7 @@ module.exports = {
51
51
  'unicorn/no-lonely-if': 'warn',
52
52
  'unicorn/no-magic-array-flat-depth': 'error',
53
53
  'unicorn/no-negated-condition': 'warn',
54
+ 'unicorn/no-negation-in-equality-check': 'error',
54
55
  'unicorn/no-nested-ternary': 'off',
55
56
  'unicorn/no-new-array': 'warn',
56
57
  'unicorn/no-new-buffer': 'warn',
@@ -97,7 +98,9 @@ module.exports = {
97
98
  },
98
99
  }],
99
100
  'unicorn/prefer-add-event-listener': 'warn',
100
- 'unicorn/prefer-array-find': 'warn',
101
+ 'unicorn/prefer-array-find': ['warn', {
102
+ checkFromLast: true,
103
+ }],
101
104
  'unicorn/prefer-array-flat': 'off',
102
105
  'unicorn/prefer-array-flat-map': 'off',
103
106
  'unicorn/prefer-array-index-of': 'warn',
@@ -1,6 +0,0 @@
1
- "use strict";
2
- module.exports = {
3
- rules: {
4
- 'node/no-deprecated-api': 'off',
5
- },
6
- };
@@ -1,11 +0,0 @@
1
- "use strict";
2
- module.exports = {
3
- plugins: [
4
- 'node',
5
- ],
6
- extends: [
7
- './possible-errors',
8
- './best-practices',
9
- './stylistic-issues',
10
- ],
11
- };
@@ -1,23 +0,0 @@
1
- "use strict";
2
- module.exports = {
3
- rules: {
4
- 'node/handle-callback-err': 'off',
5
- 'node/no-callback-literal': 'off',
6
- 'node/no-exports-assign': 'off',
7
- 'node/no-extraneous-import': 'off',
8
- 'node/no-extraneous-require': 'off',
9
- 'node/no-missing-import': 'off',
10
- 'node/no-missing-require': 'off',
11
- 'node/no-new-require': 'off',
12
- 'node/no-path-concat': 'off',
13
- 'node/no-process-exit': 'off',
14
- 'node/no-unpublished-bin': 'off',
15
- 'node/no-unpublished-import': 'off',
16
- 'node/no-unpublished-require': 'off',
17
- 'node/no-unsupported-features/es-builtins': 'off',
18
- 'node/no-unsupported-features/es-syntax': 'off',
19
- 'node/no-unsupported-features/node-builtins': 'off',
20
- 'node/process-exit-as-throw': 'off',
21
- 'node/shebang': 'off',
22
- },
23
- };
@@ -1,23 +0,0 @@
1
- "use strict";
2
- module.exports = {
3
- rules: {
4
- 'node/callback-return': 'off',
5
- 'node/exports-style': ['off', 'module.exports', { allowBatchAssign: false }],
6
- 'node/file-extension-in-import': 'off',
7
- 'node/global-require': 'off',
8
- 'node/no-mixed-requires': 'off',
9
- 'node/no-process-env': 'off',
10
- 'node/no-restricted-import': 'off',
11
- 'node/no-restricted-require': 'off',
12
- 'node/no-sync': 'off',
13
- 'node/prefer-global/buffer': ['off', 'always'],
14
- 'node/prefer-global/console': ['off', 'always'],
15
- 'node/prefer-global/process': ['off', 'always'],
16
- 'node/prefer-global/text-decoder': ['off', 'always'],
17
- 'node/prefer-global/text-encoder': ['off', 'always'],
18
- 'node/prefer-global/url-search-params': ['off', 'always'],
19
- 'node/prefer-global/url': ['off', 'always'],
20
- 'node/prefer-promises/dns': 'off',
21
- 'node/prefer-promises/fs': 'off',
22
- },
23
- };