@perfective/eslint-config 0.18.0-alpha → 0.18.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 +2 -2
- package/README.md +2 -2
- package/package.json +12 -12
- package/rules/eslint/possible-problems.js +3 -0
- package/rules/eslint/suggestions.js +1 -0
- package/rules/import/static-analysis.js +1 -1
- package/rules/jest/index.js +1 -0
- package/rules/typescript-eslint/extension-rules.js +1 -1
- package/rules/typescript-eslint/supported-rules.js +8 -1
- package/rules/unicorn/index.js +4 -4
package/README.adoc
CHANGED
|
@@ -7,7 +7,7 @@ As the `@perfective` library itself,
|
|
|
7
7
|
these rules are configured for the TypeScript projects only.
|
|
8
8
|
|
|
9
9
|
In addition to the core https://eslint.org/docs/rules/[ESLint rules]
|
|
10
|
-
and the `link:https://
|
|
10
|
+
and the `link:https://typescript-eslint.io/rules/[@typescript-eslint]` plugin rules,
|
|
11
11
|
`@perfective/eslint-config` configures:
|
|
12
12
|
|
|
13
13
|
* `link:https://github.com/freaktechnik/eslint-plugin-array-func[eslint-plugin-array-func]`;
|
|
@@ -131,7 +131,7 @@ and override `options` for the `unicorn/prevent-abbreviation` rule.
|
|
|
131
131
|
ESLint and its plugins replace most of the https://palantir.github.io/tslint/[TSLint] rules.
|
|
132
132
|
Yet, there are few rules that still need to be supported.
|
|
133
133
|
TSLint rules are executed using the
|
|
134
|
-
https://github.com/typescript-eslint/typescript-eslint/tree/
|
|
134
|
+
https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin-tslint[ESLint Plugin TSLint].
|
|
135
135
|
|
|
136
136
|
`eslint-plugin-tslint` provides only one rule `@typescript-eslint/tslint/config`
|
|
137
137
|
that configures all the remaining TSLint rules,
|
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@ As the `@perfective` library itself,
|
|
|
7
7
|
these rules are configured for the TypeScript projects only.
|
|
8
8
|
|
|
9
9
|
In addition to the core [ESLint rules](https://eslint.org/docs/rules/)
|
|
10
|
-
and the [`@typescript-eslint`](https://
|
|
10
|
+
and the [`@typescript-eslint`](https://typescript-eslint.io/rules/) plugin rules,
|
|
11
11
|
`@perfective/eslint-config` configures:
|
|
12
12
|
|
|
13
13
|
- [`eslint-plugin-array-func`](https://github.com/freaktechnik/eslint-plugin-array-func);
|
|
@@ -79,7 +79,7 @@ Require the configuration in your root `.eslintrc.js` or `.eslintrc.json`.
|
|
|
79
79
|
ESLint and its plugins replace most of the [TSLint](https://palantir.github.io/tslint/) rules.
|
|
80
80
|
Yet, there are few rules that still need to be supported.
|
|
81
81
|
TSLint rules are executed using the
|
|
82
|
-
[ESLint Plugin TSLint](https://github.com/typescript-eslint/typescript-eslint/tree/
|
|
82
|
+
[ESLint Plugin TSLint](https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin-tslint).
|
|
83
83
|
|
|
84
84
|
Read the [full documentation](https://github.com/perfective/eslint-config/blob/main/README.adoc)
|
|
85
85
|
in the repository.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@perfective/eslint-config",
|
|
3
|
-
"version": "0.18.0-
|
|
3
|
+
"version": "0.18.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>",
|
|
@@ -12,28 +12,28 @@
|
|
|
12
12
|
"license": "MIT",
|
|
13
13
|
"peerDependencies": {
|
|
14
14
|
"@babel/eslint-parser": "^7.17.0",
|
|
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": "^2.
|
|
15
|
+
"@typescript-eslint/eslint-plugin": "^5.30.5",
|
|
16
|
+
"@typescript-eslint/eslint-plugin-tslint": "^5.30.5",
|
|
17
|
+
"@typescript-eslint/parser": "^5.30.5",
|
|
18
|
+
"eslint": "^8.19.0",
|
|
19
|
+
"eslint-import-resolver-typescript": "^3.2.4",
|
|
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
|
-
"eslint-plugin-import": "^2.
|
|
25
|
-
"eslint-plugin-jest": "^26.
|
|
26
|
-
"eslint-plugin-jest-dom": "^4.0.
|
|
24
|
+
"eslint-plugin-import": "^2.26.0",
|
|
25
|
+
"eslint-plugin-jest": "^26.5.3",
|
|
26
|
+
"eslint-plugin-jest-dom": "^4.0.2",
|
|
27
27
|
"eslint-plugin-jest-formatting": "^3.1.0",
|
|
28
|
-
"eslint-plugin-jsdoc": "^
|
|
28
|
+
"eslint-plugin-jsdoc": "^39.3.3",
|
|
29
29
|
"eslint-plugin-node": "^11.1.0",
|
|
30
30
|
"eslint-plugin-prefer-arrow": "^1.2.3",
|
|
31
31
|
"eslint-plugin-promise": "^6.0.0",
|
|
32
32
|
"eslint-plugin-rxjs": "^5.0.2",
|
|
33
33
|
"eslint-plugin-simple-import-sort": "^7.0.0",
|
|
34
34
|
"eslint-plugin-sonarjs": "^0.13.0",
|
|
35
|
-
"eslint-plugin-testing-library": "^5.
|
|
36
|
-
"eslint-plugin-unicorn": "^
|
|
35
|
+
"eslint-plugin-testing-library": "^5.5.1",
|
|
36
|
+
"eslint-plugin-unicorn": "^43.0.0",
|
|
37
37
|
"tslint": "^6.1.3"
|
|
38
38
|
},
|
|
39
39
|
"main": "./index.js",
|
|
@@ -13,6 +13,7 @@ module.exports = {
|
|
|
13
13
|
'no-compare-neg-zero': 'error',
|
|
14
14
|
'no-cond-assign': ['error', 'always'],
|
|
15
15
|
'no-const-assign': 'error',
|
|
16
|
+
'no-constant-binary-expression': 'error',
|
|
16
17
|
'no-constant-condition': 'error',
|
|
17
18
|
'no-constructor-return': 'error',
|
|
18
19
|
'no-control-regex': 'error',
|
|
@@ -66,6 +67,8 @@ module.exports = {
|
|
|
66
67
|
'no-use-before-define': ['error', {
|
|
67
68
|
functions: false,
|
|
68
69
|
classes: false,
|
|
70
|
+
variables: false,
|
|
71
|
+
allowNamedExports: false,
|
|
69
72
|
}],
|
|
70
73
|
'no-useless-backreference': 'error',
|
|
71
74
|
'require-atomic-updates': ['error', {
|
package/rules/jest/index.js
CHANGED
|
@@ -51,6 +51,7 @@ module.exports = {
|
|
|
51
51
|
'jest/prefer-equality-matcher': 'error',
|
|
52
52
|
'jest/prefer-expect-assertions': 'off',
|
|
53
53
|
'jest/prefer-expect-resolves': 'warn',
|
|
54
|
+
'jest/prefer-hooks-in-order': 'error',
|
|
54
55
|
'jest/prefer-hooks-on-top': 'error',
|
|
55
56
|
'jest/prefer-lowercase-title': ['error', {
|
|
56
57
|
allowedPrefixes: [],
|
|
@@ -55,7 +55,7 @@ module.exports = {
|
|
|
55
55
|
'no-dupe-class-members': 'off',
|
|
56
56
|
'@typescript-eslint/no-dupe-class-members': 'error',
|
|
57
57
|
'no-duplicate-imports': 'off',
|
|
58
|
-
'@typescript-eslint/no-duplicate-imports': ['
|
|
58
|
+
'@typescript-eslint/no-duplicate-imports': ['off', {
|
|
59
59
|
includeExports: true,
|
|
60
60
|
}],
|
|
61
61
|
'no-empty-function': 'off',
|
|
@@ -24,6 +24,7 @@ module.exports = {
|
|
|
24
24
|
extendDefaults: true,
|
|
25
25
|
}],
|
|
26
26
|
'@typescript-eslint/class-literal-property-style': 'off',
|
|
27
|
+
'@typescript-eslint/consistent-generic-constructors': ['warn', 'type-annotation'],
|
|
27
28
|
'@typescript-eslint/consistent-indexed-object-style': ['warn', 'record'],
|
|
28
29
|
'@typescript-eslint/consistent-type-assertions': ['error', {
|
|
29
30
|
assertionStyle: 'as',
|
|
@@ -117,6 +118,7 @@ module.exports = {
|
|
|
117
118
|
ignoreArrowShorthand: true,
|
|
118
119
|
ignoreVoidOperator: false,
|
|
119
120
|
}],
|
|
121
|
+
'@typescript-eslint/no-duplicate-enum-values': 'error',
|
|
120
122
|
'@typescript-eslint/no-dynamic-delete': 'warn',
|
|
121
123
|
'@typescript-eslint/no-empty-interface': ['off', {
|
|
122
124
|
allowSingleExtends: true,
|
|
@@ -174,6 +176,9 @@ module.exports = {
|
|
|
174
176
|
'@typescript-eslint/no-unsafe-return': 'error',
|
|
175
177
|
'@typescript-eslint/no-var-requires': 'error',
|
|
176
178
|
'@typescript-eslint/non-nullable-type-assertion-style': 'error',
|
|
179
|
+
'@typescript-eslint/parameter-properties': ['error', {
|
|
180
|
+
prefer: 'parameter-property',
|
|
181
|
+
}],
|
|
177
182
|
'@typescript-eslint/prefer-as-const': 'warn',
|
|
178
183
|
'@typescript-eslint/prefer-enum-initializers': 'error',
|
|
179
184
|
'@typescript-eslint/prefer-for-of': 'error',
|
|
@@ -256,7 +261,9 @@ module.exports = {
|
|
|
256
261
|
'@typescript-eslint/unbound-method': ['error', {
|
|
257
262
|
ignoreStatic: true,
|
|
258
263
|
}],
|
|
259
|
-
'@typescript-eslint/unified-signatures': 'error',
|
|
264
|
+
'@typescript-eslint/unified-signatures': ['error', {
|
|
265
|
+
ignoreDifferentlyNamedParameters: true,
|
|
266
|
+
}],
|
|
260
267
|
'@typescript-eslint/no-useless-empty-export': 'warn',
|
|
261
268
|
},
|
|
262
269
|
};
|
package/rules/unicorn/index.js
CHANGED
|
@@ -20,7 +20,7 @@ module.exports = {
|
|
|
20
20
|
'unicorn/filename-case': ['error', {
|
|
21
21
|
case: 'kebabCase',
|
|
22
22
|
}],
|
|
23
|
-
'unicorn/import-index': '
|
|
23
|
+
'unicorn/import-index': 'off',
|
|
24
24
|
'unicorn/import-style': 'off',
|
|
25
25
|
'unicorn/new-for-builtins': 'warn',
|
|
26
26
|
'unicorn/no-abusive-eslint-disable': 'error',
|
|
@@ -98,19 +98,19 @@ module.exports = {
|
|
|
98
98
|
'unicorn/prefer-dom-node-dataset': 'warn',
|
|
99
99
|
'unicorn/prefer-dom-node-remove': 'warn',
|
|
100
100
|
'unicorn/prefer-dom-node-text-content': 'warn',
|
|
101
|
+
'unicorn/prefer-event-target': 'error',
|
|
101
102
|
'unicorn/prefer-export-from': 'warn',
|
|
102
103
|
'unicorn/prefer-includes': 'warn',
|
|
103
104
|
'unicorn/prefer-json-parse-buffer': 'warn',
|
|
104
105
|
'unicorn/prefer-keyboard-event-key': 'warn',
|
|
106
|
+
'unicorn/prefer-logical-operator-over-ternary': 'error',
|
|
105
107
|
'unicorn/prefer-math-trunc': 'warn',
|
|
106
108
|
'unicorn/prefer-modern-dom-apis': 'warn',
|
|
107
109
|
'unicorn/prefer-modern-math-apis': 'warn',
|
|
108
110
|
'unicorn/prefer-module': 'off',
|
|
109
111
|
'unicorn/prefer-native-coercion-functions': 'warn',
|
|
110
112
|
'unicorn/prefer-negative-index': 'warn',
|
|
111
|
-
'unicorn/prefer-node-protocol':
|
|
112
|
-
checkRequire: false,
|
|
113
|
-
}],
|
|
113
|
+
'unicorn/prefer-node-protocol': 'warn',
|
|
114
114
|
'unicorn/prefer-number-properties': ['warn', {
|
|
115
115
|
checkInfinity: true,
|
|
116
116
|
}],
|