@perfective/eslint-config 0.16.0-alpha → 0.16.0-beta.1
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/index.js +3 -3
- package/package.json +17 -17
- package/rules/cypress/index.js +1 -0
- package/rules/import/helpful-warnings.js +1 -1
- package/rules/import/static-analysis.js +4 -1
- package/rules/jest/index.js +4 -1
- package/rules/jsdoc/index.js +1 -0
- package/rules/simple-import-sort/index.js +1 -1
- package/rules/typescript-eslint/extension-rules.js +6 -0
- package/rules/typescript-eslint/supported-rules.js +9 -4
- package/rules/typescript-eslint/tslint.js +1 -1
- package/rules/unicorn/index.js +8 -1
package/README.adoc
CHANGED
|
@@ -14,7 +14,7 @@ and the `link:https://github.com/typescript-eslint/typescript-eslint/tree/master
|
|
|
14
14
|
* `link:https://github.com/cypress-io/eslint-plugin-cypress[eslint-plugin-cypress]`;
|
|
15
15
|
* `link:https://github.com/gund/eslint-plugin-deprecation[eslint-plugin-deprecation]`;
|
|
16
16
|
* `link:https://mysticatea.github.io/eslint-plugin-eslint-comments[eslint-plugin-eslint-comments]`;
|
|
17
|
-
* `link:https://github.com/
|
|
17
|
+
* `link:https://github.com/import-js/eslint-plugin-import[eslint-plugin-import]`;
|
|
18
18
|
* `link:https://github.com/jest-community/eslint-plugin-jest[eslint-plugin-jest]`;
|
|
19
19
|
* `link:https://github.com/testing-library/eslint-plugin-jest-dom[eslint-plugin-jest-dom]`;
|
|
20
20
|
* `link:https://github.com/dangreenisrael/eslint-plugin-jest-formatting[eslint-plugin-jest-formatting]`;
|
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@ and the [`@typescript-eslint`](https://github.com/typescript-eslint/typescript-e
|
|
|
14
14
|
- [`eslint-plugin-cypress`](https://github.com/cypress-io/eslint-plugin-cypress);
|
|
15
15
|
- [`eslint-plugin-deprecation`](https://github.com/gund/eslint-plugin-deprecation);
|
|
16
16
|
- [`eslint-plugin-eslint-comments`](https://mysticatea.github.io/eslint-plugin-eslint-comments);
|
|
17
|
-
- [`eslint-plugin-import`](https://github.com/
|
|
17
|
+
- [`eslint-plugin-import`](https://github.com/import-js/eslint-plugin-import);
|
|
18
18
|
- [`eslint-plugin-jest`](https://github.com/jest-community/eslint-plugin-jest);
|
|
19
19
|
- [`eslint-plugin-jest-dom`](https://github.com/testing-library/eslint-plugin-jest-dom);
|
|
20
20
|
- [`eslint-plugin-jest-formatting`](https://github.com/dangreenisrael/eslint-plugin-jest-formatting);
|
package/index.js
CHANGED
|
@@ -39,7 +39,7 @@ module.exports = {
|
|
|
39
39
|
},
|
|
40
40
|
rules: {
|
|
41
41
|
'import/no-commonjs': 'off',
|
|
42
|
-
'import/no-extraneous-dependencies': ['error', no_extraneous_dependencies_1.jsImportNoExtraneousDependencies()],
|
|
42
|
+
'import/no-extraneous-dependencies': ['error', (0, no_extraneous_dependencies_1.jsImportNoExtraneousDependencies)()],
|
|
43
43
|
'import/unambiguous': 'off',
|
|
44
44
|
'jsdoc/no-types': 'off',
|
|
45
45
|
'jsdoc/require-param': 'error',
|
|
@@ -100,7 +100,7 @@ module.exports = {
|
|
|
100
100
|
}],
|
|
101
101
|
'@typescript-eslint/init-declarations': 'off',
|
|
102
102
|
'@typescript-eslint/unbound-method': 'off',
|
|
103
|
-
'import/no-extraneous-dependencies': ['error', no_extraneous_dependencies_1.jestImportNoExtraneousDependencies()],
|
|
103
|
+
'import/no-extraneous-dependencies': ['error', (0, no_extraneous_dependencies_1.jestImportNoExtraneousDependencies)()],
|
|
104
104
|
'import/no-unassigned-import': ['error', {
|
|
105
105
|
allow: [
|
|
106
106
|
'@testing-library/jest-dom',
|
|
@@ -124,7 +124,7 @@ module.exports = {
|
|
|
124
124
|
rules: {
|
|
125
125
|
'init-declarations': 'off',
|
|
126
126
|
'@typescript-eslint/init-declarations': 'off',
|
|
127
|
-
'import/no-extraneous-dependencies': ['error', no_extraneous_dependencies_1.cypressImportNoExtraneousDependencies()],
|
|
127
|
+
'import/no-extraneous-dependencies': ['error', (0, no_extraneous_dependencies_1.cypressImportNoExtraneousDependencies)()],
|
|
128
128
|
'max-nested-callbacks': ['error', 4],
|
|
129
129
|
'new-cap': ['error', {
|
|
130
130
|
capIsNewExceptions: ['Given', 'When', 'Then', 'And', 'But', 'Before', 'After'],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@perfective/eslint-config",
|
|
3
|
-
"version": "0.16.0-
|
|
3
|
+
"version": "0.16.0-beta.1",
|
|
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": "^4.
|
|
16
|
-
"@typescript-eslint/eslint-plugin-tslint": "^4.
|
|
17
|
-
"@typescript-eslint/parser": "^4.
|
|
14
|
+
"@babel/eslint-parser": "^7.16.5",
|
|
15
|
+
"@typescript-eslint/eslint-plugin": "^4.33.0",
|
|
16
|
+
"@typescript-eslint/eslint-plugin-tslint": "^4.33.0",
|
|
17
|
+
"@typescript-eslint/parser": "^4.33.0",
|
|
18
18
|
"eslint": "^7.32.0",
|
|
19
|
-
"eslint-import-resolver-typescript": "^2.
|
|
19
|
+
"eslint-import-resolver-typescript": "^2.5.0",
|
|
20
20
|
"eslint-plugin-array-func": "^3.1.7",
|
|
21
|
-
"eslint-plugin-cypress": "^2.
|
|
22
|
-
"eslint-plugin-deprecation": "^1.2
|
|
21
|
+
"eslint-plugin-cypress": "^2.12.1",
|
|
22
|
+
"eslint-plugin-deprecation": "^1.3.2",
|
|
23
23
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
24
|
-
"eslint-plugin-import": "^2.
|
|
25
|
-
"eslint-plugin-jest": "^24.
|
|
26
|
-
"eslint-plugin-jest-dom": "^
|
|
27
|
-
"eslint-plugin-jest-formatting": "^3.
|
|
28
|
-
"eslint-plugin-jsdoc": "^
|
|
24
|
+
"eslint-plugin-import": "^2.25.3",
|
|
25
|
+
"eslint-plugin-jest": "^24.7.0",
|
|
26
|
+
"eslint-plugin-jest-dom": "^4.0.0",
|
|
27
|
+
"eslint-plugin-jest-formatting": "^3.1.0",
|
|
28
|
+
"eslint-plugin-jsdoc": "^37.4.2",
|
|
29
29
|
"eslint-plugin-node": "^11.1.0",
|
|
30
30
|
"eslint-plugin-prefer-arrow": "^1.2.3",
|
|
31
|
-
"eslint-plugin-promise": "^
|
|
31
|
+
"eslint-plugin-promise": "^6.0.0",
|
|
32
32
|
"eslint-plugin-rxjs": "^3.3.7",
|
|
33
33
|
"eslint-plugin-simple-import-sort": "^7.0.0",
|
|
34
|
-
"eslint-plugin-sonarjs": "^0.
|
|
35
|
-
"eslint-plugin-testing-library": "^4.12.
|
|
36
|
-
"eslint-plugin-unicorn": "^
|
|
34
|
+
"eslint-plugin-sonarjs": "^0.11.0",
|
|
35
|
+
"eslint-plugin-testing-library": "^4.12.4",
|
|
36
|
+
"eslint-plugin-unicorn": "^39.0.0",
|
|
37
37
|
"tslint": "^6.1.3"
|
|
38
38
|
},
|
|
39
39
|
"main": "./index.js",
|
package/rules/cypress/index.js
CHANGED
|
@@ -8,6 +8,7 @@ module.exports = {
|
|
|
8
8
|
'cypress/no-assigning-return-values': 'error',
|
|
9
9
|
'cypress/no-async-tests': 'error',
|
|
10
10
|
'cypress/no-force': 'error',
|
|
11
|
+
'cypress/no-pause': 'error',
|
|
11
12
|
'cypress/no-unnecessary-waiting': 'error',
|
|
12
13
|
'cypress/require-data-selectors': 'error',
|
|
13
14
|
},
|
|
@@ -6,7 +6,7 @@ module.exports = {
|
|
|
6
6
|
'import/no-named-as-default': 'error',
|
|
7
7
|
'import/no-named-as-default-member': 'error',
|
|
8
8
|
'import/no-deprecated': 'off',
|
|
9
|
-
'import/no-extraneous-dependencies': ['error', no_extraneous_dependencies_1.importNoExtraneousDependencies()],
|
|
9
|
+
'import/no-extraneous-dependencies': ['error', (0, no_extraneous_dependencies_1.importNoExtraneousDependencies)()],
|
|
10
10
|
'import/no-mutable-exports': 'error',
|
|
11
11
|
'import/no-unused-modules': 'error',
|
|
12
12
|
},
|
package/rules/jest/index.js
CHANGED
|
@@ -49,18 +49,21 @@ module.exports = {
|
|
|
49
49
|
'jest/no-test-return-statement': 'error',
|
|
50
50
|
'jest/prefer-called-with': 'error',
|
|
51
51
|
'jest/prefer-expect-assertions': 'off',
|
|
52
|
+
'jest/prefer-expect-resolves': 'warn',
|
|
52
53
|
'jest/prefer-hooks-on-top': 'error',
|
|
53
54
|
'jest/prefer-spy-on': 'warn',
|
|
54
55
|
'jest/prefer-strict-equal': 'warn',
|
|
56
|
+
'jest/prefer-to-be': 'warn',
|
|
55
57
|
'jest/prefer-to-be-null': 'warn',
|
|
56
58
|
'jest/prefer-to-be-undefined': 'warn',
|
|
57
59
|
'jest/prefer-to-contain': 'warn',
|
|
58
60
|
'jest/prefer-to-have-length': 'warn',
|
|
59
61
|
'jest/prefer-todo': 'warn',
|
|
62
|
+
'jest/require-hook': 'error',
|
|
60
63
|
'jest/require-top-level-describe': 'error',
|
|
61
64
|
'jest/require-to-throw-message': 'error',
|
|
62
65
|
'jest/valid-describe': 'error',
|
|
63
|
-
'jest/valid-expect-in-promise': '
|
|
66
|
+
'jest/valid-expect-in-promise': 'error',
|
|
64
67
|
'jest/valid-expect': 'error',
|
|
65
68
|
'jest/valid-title': ['warn', {
|
|
66
69
|
ignoreTypeOfDescribeName: true,
|
package/rules/jsdoc/index.js
CHANGED
|
@@ -82,6 +82,10 @@ module.exports = {
|
|
|
82
82
|
'@typescript-eslint/no-magic-numbers': 'off',
|
|
83
83
|
'no-redeclare': 'off',
|
|
84
84
|
'@typescript-eslint/no-redeclare': 'error',
|
|
85
|
+
'no-restricted-imports': 'off',
|
|
86
|
+
'@typescript-eslint/no-restricted-imports': ['error', {
|
|
87
|
+
allowTypeImports: false,
|
|
88
|
+
}],
|
|
85
89
|
'no-shadow': 'off',
|
|
86
90
|
'@typescript-eslint/no-shadow': 'off',
|
|
87
91
|
'no-throw-literal': 'off',
|
|
@@ -106,6 +110,8 @@ module.exports = {
|
|
|
106
110
|
arraysInObjects: true,
|
|
107
111
|
objectsInObjects: true,
|
|
108
112
|
}],
|
|
113
|
+
'padding-line-between-statements': 'off',
|
|
114
|
+
'@typescript-eslint/padding-line-between-statements': 'off',
|
|
109
115
|
'quotes': 'off',
|
|
110
116
|
'@typescript-eslint/quotes': ['warn', 'single', {
|
|
111
117
|
avoidEscape: true,
|
|
@@ -71,7 +71,7 @@ module.exports = {
|
|
|
71
71
|
],
|
|
72
72
|
}],
|
|
73
73
|
'@typescript-eslint/method-signature-style': ['warn', 'property'],
|
|
74
|
-
'@typescript-eslint/naming-convention': ['error', ...typescript_eslint_naming_convention_1.typescriptEslintNamingConvention()],
|
|
74
|
+
'@typescript-eslint/naming-convention': ['error', ...(0, typescript_eslint_naming_convention_1.typescriptEslintNamingConvention)()],
|
|
75
75
|
'@typescript-eslint/no-base-to-string': 'error',
|
|
76
76
|
'@typescript-eslint/no-confusing-non-null-assertion': 'warn',
|
|
77
77
|
'@typescript-eslint/no-confusing-void-expression': ['warn', {
|
|
@@ -102,9 +102,13 @@ module.exports = {
|
|
|
102
102
|
'@typescript-eslint/no-invalid-void-type': ['error', {
|
|
103
103
|
allowInGenericTypeArguments: true,
|
|
104
104
|
}],
|
|
105
|
+
'@typescript-eslint/no-meaningless-void-operator': ['warn', {
|
|
106
|
+
checkNever: true,
|
|
107
|
+
}],
|
|
105
108
|
'@typescript-eslint/no-misused-new': 'error',
|
|
106
109
|
'@typescript-eslint/no-misused-promises': 'error',
|
|
107
110
|
'@typescript-eslint/no-namespace': 'error',
|
|
111
|
+
'@typescript-eslint/no-non-null-asserted-nullish-coalescing': 'error',
|
|
108
112
|
'@typescript-eslint/no-non-null-asserted-optional-chain': 'error',
|
|
109
113
|
'@typescript-eslint/no-non-null-assertion': 'error',
|
|
110
114
|
'@typescript-eslint/no-parameter-properties': 'off',
|
|
@@ -145,7 +149,7 @@ module.exports = {
|
|
|
145
149
|
'@typescript-eslint/prefer-readonly-parameter-types': 'off',
|
|
146
150
|
'@typescript-eslint/prefer-reduce-type-parameter': 'warn',
|
|
147
151
|
'@typescript-eslint/prefer-regexp-exec': 'warn',
|
|
148
|
-
'@typescript-eslint/prefer-return-this-type': '
|
|
152
|
+
'@typescript-eslint/prefer-return-this-type': 'warn',
|
|
149
153
|
'@typescript-eslint/prefer-string-starts-ends-with': 'warn',
|
|
150
154
|
'@typescript-eslint/prefer-ts-expect-error': 'warn',
|
|
151
155
|
'@typescript-eslint/promise-function-async': ['warn', {
|
|
@@ -158,10 +162,11 @@ module.exports = {
|
|
|
158
162
|
checkCompoundAssignments: true,
|
|
159
163
|
}],
|
|
160
164
|
'@typescript-eslint/restrict-template-expressions': ['error', {
|
|
161
|
-
allowNumber: false,
|
|
162
|
-
allowBoolean: false,
|
|
163
165
|
allowAny: false,
|
|
166
|
+
allowBoolean: false,
|
|
164
167
|
allowNullish: false,
|
|
168
|
+
allowNumber: false,
|
|
169
|
+
allowRegExp: false,
|
|
165
170
|
}],
|
|
166
171
|
'@typescript-eslint/sort-type-union-intersection-members': ['off', {
|
|
167
172
|
checkIntersections: true,
|
|
@@ -5,6 +5,6 @@ module.exports = {
|
|
|
5
5
|
'@typescript-eslint/tslint',
|
|
6
6
|
],
|
|
7
7
|
rules: {
|
|
8
|
-
'@typescript-eslint/tslint/config': ['warn', typescript_eslint_tslint_config_1.typescriptEslintTslintConfig()],
|
|
8
|
+
'@typescript-eslint/tslint/config': ['warn', (0, typescript_eslint_tslint_config_1.typescriptEslintTslintConfig)()],
|
|
9
9
|
},
|
|
10
10
|
};
|
package/rules/unicorn/index.js
CHANGED
|
@@ -31,11 +31,14 @@ module.exports = {
|
|
|
31
31
|
ignore: ['readable', 'this', 'this.stream'],
|
|
32
32
|
}],
|
|
33
33
|
'unicorn/no-array-reduce': 'off',
|
|
34
|
+
'unicorn/no-await-expression-member': 'error',
|
|
34
35
|
'unicorn/no-console-spaces': 'warn',
|
|
35
36
|
'unicorn/no-document-cookie': 'error',
|
|
37
|
+
'unicorn/no-empty-file': 'error',
|
|
36
38
|
'unicorn/no-for-loop': 'warn',
|
|
37
39
|
'unicorn/no-hex-escape': 'warn',
|
|
38
40
|
'unicorn/no-instanceof-array': 'warn',
|
|
41
|
+
'unicorn/no-invalid-remove-event-listener': 'error',
|
|
39
42
|
'unicorn/no-keyword-prefix': ['off', {
|
|
40
43
|
disallowedPrefixes: ['new', 'class'],
|
|
41
44
|
checkProperties: true,
|
|
@@ -53,6 +56,7 @@ module.exports = {
|
|
|
53
56
|
'unicorn/no-unreadable-array-destructuring': 'error',
|
|
54
57
|
'unicorn/no-unsafe-regex': 'error',
|
|
55
58
|
'unicorn/no-unused-properties': 'off',
|
|
59
|
+
'unicorn/no-useless-fallback-in-spread': 'warn',
|
|
56
60
|
'unicorn/no-useless-length-check': 'warn',
|
|
57
61
|
'unicorn/no-useless-spread': 'warn',
|
|
58
62
|
'unicorn/no-useless-undefined': 'off',
|
|
@@ -83,12 +87,14 @@ module.exports = {
|
|
|
83
87
|
'unicorn/prefer-array-index-of': 'warn',
|
|
84
88
|
'unicorn/prefer-array-some': 'error',
|
|
85
89
|
'unicorn/prefer-at': 'off',
|
|
90
|
+
'unicorn/prefer-code-point': 'error',
|
|
86
91
|
'unicorn/prefer-date-now': 'warn',
|
|
87
92
|
'unicorn/prefer-default-parameters': 'warn',
|
|
88
93
|
'unicorn/prefer-dom-node-append': 'warn',
|
|
89
94
|
'unicorn/prefer-dom-node-dataset': 'warn',
|
|
90
95
|
'unicorn/prefer-dom-node-remove': 'warn',
|
|
91
96
|
'unicorn/prefer-dom-node-text-content': 'warn',
|
|
97
|
+
'unicorn/prefer-export-from': 'warn',
|
|
92
98
|
'unicorn/prefer-includes': 'warn',
|
|
93
99
|
'unicorn/prefer-keyboard-event-key': 'warn',
|
|
94
100
|
'unicorn/prefer-math-trunc': 'warn',
|
|
@@ -123,11 +129,12 @@ module.exports = {
|
|
|
123
129
|
'unicorn/prefer-ternary': 'off',
|
|
124
130
|
'unicorn/prefer-top-level-await': 'off',
|
|
125
131
|
'unicorn/prefer-type-error': 'warn',
|
|
126
|
-
'unicorn/prevent-abbreviations': ['warn', prevent_abbreviations_1.unicornPreventAbbreviations()],
|
|
132
|
+
'unicorn/prevent-abbreviations': ['warn', (0, prevent_abbreviations_1.unicornPreventAbbreviations)()],
|
|
127
133
|
'unicorn/require-array-join-separator': 'warn',
|
|
128
134
|
'unicorn/require-number-to-fixed-digits-argument': 'warn',
|
|
129
135
|
'unicorn/require-post-message-target-origin': 'error',
|
|
130
136
|
'unicorn/string-content': 'off',
|
|
137
|
+
'unicorn/template-indent': 'warn',
|
|
131
138
|
'unicorn/throw-new-error': 'warn',
|
|
132
139
|
},
|
|
133
140
|
};
|