@perfective/eslint-config 0.18.0 → 0.19.0-beta
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/README.adoc +1 -1
- package/README.md +1 -1
- package/package.json +14 -14
- package/rules/eslint/suggestions.js +3 -0
- package/rules/jest/index.js +3 -1
- package/rules/promise/index.js +1 -0
- package/rules/simple-import-sort/rules/imports.js +4 -0
- package/rules/typescript-eslint/extension-rules.js +4 -0
- package/rules/typescript-eslint/supported-rules.js +1 -0
- package/rules/unicorn/index.js +2 -0
package/README.adoc
CHANGED
|
@@ -20,7 +20,7 @@ and the `link:https://typescript-eslint.io/rules/[@typescript-eslint]` plugin ru
|
|
|
20
20
|
* `link:https://github.com/gajus/eslint-plugin-jsdoc[eslint-plugin-jsdoc]`;
|
|
21
21
|
* `link:https://github.com/mysticatea/eslint-plugin-node[eslint-plugin-node]`;
|
|
22
22
|
* `link:https://github.com/TristonJ/eslint-plugin-prefer-arrow[eslint-plugin-prefer-arrow]`;
|
|
23
|
-
* `link:https://github.com/
|
|
23
|
+
* `link:https://github.com/eslint-community/eslint-plugin-promise[eslint-plugin-promise]`;
|
|
24
24
|
* `link:https://github.com/cartant/eslint-plugin-rxjs[eslint-plugin-rxjs]`;
|
|
25
25
|
* `link:https://github.com/lydell/eslint-plugin-simple-import-sort[eslint-plugin-simple-import-sort]`;
|
|
26
26
|
* `link:https://github.com/SonarSource/eslint-plugin-sonarjs[eslint-plugin-sonarjs]`;
|
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@ and the [`@typescript-eslint`](https://typescript-eslint.io/rules/) plugin rules
|
|
|
19
19
|
- [`eslint-plugin-jsdoc`](https://github.com/gajus/eslint-plugin-jsdoc);
|
|
20
20
|
- [`eslint-plugin-node`](https://github.com/mysticatea/eslint-plugin-node);
|
|
21
21
|
- [`eslint-plugin-prefer-arrow`](https://github.com/TristonJ/eslint-plugin-prefer-arrow);
|
|
22
|
-
- [`eslint-plugin-promise`](https://github.com/
|
|
22
|
+
- [`eslint-plugin-promise`](https://github.com/eslint-community/eslint-plugin-promise);
|
|
23
23
|
- [`eslint-plugin-rxjs`](https://github.com/cartant/eslint-plugin-rxjs);
|
|
24
24
|
- [`eslint-plugin-simple-import-sort`](https://github.com/lydell/eslint-plugin-simple-import-sort);
|
|
25
25
|
- [`eslint-plugin-sonarjs`](https://github.com/SonarSource/eslint-plugin-sonarjs);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@perfective/eslint-config",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.19.0-beta",
|
|
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>",
|
|
@@ -11,29 +11,29 @@
|
|
|
11
11
|
},
|
|
12
12
|
"license": "MIT",
|
|
13
13
|
"peerDependencies": {
|
|
14
|
-
"@babel/eslint-parser": "^7.
|
|
15
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
16
|
-
"@typescript-eslint/eslint-plugin-tslint": "^5.
|
|
17
|
-
"@typescript-eslint/parser": "^5.
|
|
18
|
-
"eslint": "^8.
|
|
19
|
-
"eslint-import-resolver-typescript": "
|
|
14
|
+
"@babel/eslint-parser": "^7.19.1",
|
|
15
|
+
"@typescript-eslint/eslint-plugin": "^5.41.0",
|
|
16
|
+
"@typescript-eslint/eslint-plugin-tslint": "^5.41.0",
|
|
17
|
+
"@typescript-eslint/parser": "^5.41.0",
|
|
18
|
+
"eslint": "^8.26.0",
|
|
19
|
+
"eslint-import-resolver-typescript": "^3.5.2",
|
|
20
20
|
"eslint-plugin-array-func": "^3.1.7",
|
|
21
21
|
"eslint-plugin-cypress": "^2.12.1",
|
|
22
22
|
"eslint-plugin-deprecation": "^1.3.2",
|
|
23
23
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
24
24
|
"eslint-plugin-import": "^2.26.0",
|
|
25
|
-
"eslint-plugin-jest": "^
|
|
25
|
+
"eslint-plugin-jest": "^27.1.3",
|
|
26
26
|
"eslint-plugin-jest-dom": "^4.0.2",
|
|
27
27
|
"eslint-plugin-jest-formatting": "^3.1.0",
|
|
28
|
-
"eslint-plugin-jsdoc": "^39.
|
|
28
|
+
"eslint-plugin-jsdoc": "^39.4.0",
|
|
29
29
|
"eslint-plugin-node": "^11.1.0",
|
|
30
30
|
"eslint-plugin-prefer-arrow": "^1.2.3",
|
|
31
|
-
"eslint-plugin-promise": "^6.
|
|
31
|
+
"eslint-plugin-promise": "^6.1.1",
|
|
32
32
|
"eslint-plugin-rxjs": "^5.0.2",
|
|
33
|
-
"eslint-plugin-simple-import-sort": "^
|
|
34
|
-
"eslint-plugin-sonarjs": "^0.
|
|
35
|
-
"eslint-plugin-testing-library": "^5.
|
|
36
|
-
"eslint-plugin-unicorn": "^
|
|
33
|
+
"eslint-plugin-simple-import-sort": "^8.0.0",
|
|
34
|
+
"eslint-plugin-sonarjs": "^0.16.0",
|
|
35
|
+
"eslint-plugin-testing-library": "^5.9.1",
|
|
36
|
+
"eslint-plugin-unicorn": "^44.0.2",
|
|
37
37
|
"tslint": "^6.1.3"
|
|
38
38
|
},
|
|
39
39
|
"main": "./index.js",
|
|
@@ -30,6 +30,9 @@ module.exports = {
|
|
|
30
30
|
'id-length': 'off',
|
|
31
31
|
'id-match': 'off',
|
|
32
32
|
'init-declarations': ['error', 'always'],
|
|
33
|
+
'logical-assignment-operators': ['warn', 'always', {
|
|
34
|
+
enforceForIfStatements: true,
|
|
35
|
+
}],
|
|
33
36
|
'max-classes-per-file': ['error', 1],
|
|
34
37
|
'max-depth': ['error', 4],
|
|
35
38
|
'max-lines': 'off',
|
package/rules/jest/index.js
CHANGED
|
@@ -36,9 +36,9 @@ module.exports = {
|
|
|
36
36
|
'jest/no-if': 'off',
|
|
37
37
|
'jest/no-interpolation-in-snapshots': 'error',
|
|
38
38
|
'jest/no-jasmine-globals': 'warn',
|
|
39
|
-
'jest/no-jest-import': 'error',
|
|
40
39
|
'jest/no-large-snapshots': 'error',
|
|
41
40
|
'jest/no-mocks-import': 'error',
|
|
41
|
+
'jest/no-restricted-jest-methods': 'off',
|
|
42
42
|
'jest/no-restricted-matchers': ['error', {
|
|
43
43
|
resolves: 'Use `expect(await promise)` instead.',
|
|
44
44
|
toBeFalsy: 'Avoid `toBeFalsy`',
|
|
@@ -51,6 +51,7 @@ module.exports = {
|
|
|
51
51
|
'jest/no-test-return-statement': 'error',
|
|
52
52
|
'jest/prefer-called-with': 'error',
|
|
53
53
|
'jest/prefer-comparison-matcher': 'warn',
|
|
54
|
+
'jest/prefer-each': 'error',
|
|
54
55
|
'jest/prefer-equality-matcher': 'error',
|
|
55
56
|
'jest/prefer-expect-assertions': 'off',
|
|
56
57
|
'jest/prefer-expect-resolves': 'warn',
|
|
@@ -61,6 +62,7 @@ module.exports = {
|
|
|
61
62
|
ignore: [],
|
|
62
63
|
ignoreTopLevelDescribe: true,
|
|
63
64
|
}],
|
|
65
|
+
'jest/prefer-mock-promise-shorthand': 'warn',
|
|
64
66
|
'jest/prefer-snapshot-hint': ['error', 'always'],
|
|
65
67
|
'jest/prefer-spy-on': 'warn',
|
|
66
68
|
'jest/prefer-strict-equal': 'warn',
|
package/rules/promise/index.js
CHANGED
|
@@ -8,6 +8,7 @@ module.exports = {
|
|
|
8
8
|
'promise/no-return-wrap': 'error',
|
|
9
9
|
'promise/param-names': 'warn',
|
|
10
10
|
'promise/always-return': 'error',
|
|
11
|
+
'promise/no-multiple-resolved': 'error',
|
|
11
12
|
'promise/no-native': 'off',
|
|
12
13
|
'promise/no-nesting': 'error',
|
|
13
14
|
'promise/no-promise-in-callback': 'error',
|
|
@@ -5,6 +5,7 @@ function simpleImportSortImports(internal = []) {
|
|
|
5
5
|
return {
|
|
6
6
|
groups: [
|
|
7
7
|
sideEffects(),
|
|
8
|
+
nodePrefixedModules(),
|
|
8
9
|
unscopedPackages(),
|
|
9
10
|
scopedPackages(internal),
|
|
10
11
|
...internalPackages(internal),
|
|
@@ -18,6 +19,9 @@ exports.simpleImportSortImports = simpleImportSortImports;
|
|
|
18
19
|
function sideEffects() {
|
|
19
20
|
return ['^\\u0000'];
|
|
20
21
|
}
|
|
22
|
+
function nodePrefixedModules() {
|
|
23
|
+
return ['^node:'];
|
|
24
|
+
}
|
|
21
25
|
function unscopedPackages() {
|
|
22
26
|
return ['^[a-zA-Z]'];
|
|
23
27
|
}
|
|
@@ -108,7 +108,11 @@ module.exports = {
|
|
|
108
108
|
'@typescript-eslint/no-use-before-define': ['error', {
|
|
109
109
|
functions: false,
|
|
110
110
|
classes: false,
|
|
111
|
+
variables: false,
|
|
112
|
+
allowNamedExports: false,
|
|
113
|
+
enums: false,
|
|
111
114
|
typedefs: false,
|
|
115
|
+
ignoreTypeReferences: false,
|
|
112
116
|
}],
|
|
113
117
|
'no-useless-constructor': 'off',
|
|
114
118
|
'@typescript-eslint/no-useless-constructor': 'error',
|
|
@@ -172,6 +172,7 @@ module.exports = {
|
|
|
172
172
|
'@typescript-eslint/no-unsafe-argument': 'error',
|
|
173
173
|
'@typescript-eslint/no-unsafe-assignment': 'error',
|
|
174
174
|
'@typescript-eslint/no-unsafe-call': 'error',
|
|
175
|
+
'@typescript-eslint/no-unsafe-declaration-merging': 'error',
|
|
175
176
|
'@typescript-eslint/no-unsafe-member-access': 'error',
|
|
176
177
|
'@typescript-eslint/no-unsafe-return': 'error',
|
|
177
178
|
'@typescript-eslint/no-var-requires': 'error',
|
package/rules/unicorn/index.js
CHANGED
|
@@ -54,6 +54,7 @@ module.exports = {
|
|
|
54
54
|
'unicorn/no-static-only-class': 'error',
|
|
55
55
|
'unicorn/no-thenable': 'error',
|
|
56
56
|
'unicorn/no-this-assignment': 'error',
|
|
57
|
+
'unicorn/no-unnecessary-await': 'warn',
|
|
57
58
|
'unicorn/no-unreadable-array-destructuring': 'error',
|
|
58
59
|
'unicorn/no-unreadable-iife': 'error',
|
|
59
60
|
'unicorn/no-unsafe-regex': 'error',
|
|
@@ -142,6 +143,7 @@ module.exports = {
|
|
|
142
143
|
'unicorn/require-number-to-fixed-digits-argument': 'warn',
|
|
143
144
|
'unicorn/require-post-message-target-origin': 'error',
|
|
144
145
|
'unicorn/string-content': 'off',
|
|
146
|
+
'unicorn/switch-case-braces': 'off',
|
|
145
147
|
'unicorn/template-indent': 'warn',
|
|
146
148
|
'unicorn/text-encoding-identifier-case': 'error',
|
|
147
149
|
'unicorn/throw-new-error': 'warn',
|