@automattic/eslint-plugin-wpvip 0.4.13 → 0.5.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.md +1 -0
- package/configs/javascript.js +9 -0
- package/configs/typescript.js +10 -8
- package/configs/weak-typescript.js +25 -1
- package/package.json +2 -1
package/README.md
CHANGED
package/configs/javascript.js
CHANGED
|
@@ -207,4 +207,13 @@ module.exports = {
|
|
|
207
207
|
|
|
208
208
|
'wrap-iife': ['error', 'any'],
|
|
209
209
|
},
|
|
210
|
+
|
|
211
|
+
settings: {
|
|
212
|
+
'import/resolver': {
|
|
213
|
+
node: {
|
|
214
|
+
extensions: ['.js', '.jsx', '.ts', '.tsx'],
|
|
215
|
+
},
|
|
216
|
+
typescript: 'eslint-import-resolver-typescript',
|
|
217
|
+
},
|
|
218
|
+
},
|
|
210
219
|
};
|
package/configs/typescript.js
CHANGED
|
@@ -18,11 +18,21 @@ module.exports = {
|
|
|
18
18
|
|
|
19
19
|
parser: '@typescript-eslint/parser',
|
|
20
20
|
|
|
21
|
+
parserOptions: {
|
|
22
|
+
project: './tsconfig.json',
|
|
23
|
+
},
|
|
24
|
+
|
|
21
25
|
rules: {
|
|
22
26
|
// TypeScript `any` type must not be used. This is a warning in the base
|
|
23
27
|
// config, and is elevated to an error here.
|
|
24
28
|
'@typescript-eslint/no-explicit-any': 'error',
|
|
25
29
|
|
|
30
|
+
// Disable some rules that TypeScript handles and are also a Performance
|
|
31
|
+
// issue. See:
|
|
32
|
+
// https://github.com/typescript-eslint/typescript-eslint/blob/main/docs/linting/troubleshooting/Performance.md#eslint-plugin-import
|
|
33
|
+
'import/default': 'off',
|
|
34
|
+
'import/named': 'off',
|
|
35
|
+
|
|
26
36
|
// Don't require redundant JSDoc types in TypeScript files.
|
|
27
37
|
'jsdoc/require-param-type': 'off',
|
|
28
38
|
'jsdoc/require-returns-type': 'off',
|
|
@@ -40,12 +50,4 @@ module.exports = {
|
|
|
40
50
|
],
|
|
41
51
|
|
|
42
52
|
plugins: ['@typescript-eslint', 'jsdoc'],
|
|
43
|
-
|
|
44
|
-
settings: {
|
|
45
|
-
'import/resolver': {
|
|
46
|
-
node: {
|
|
47
|
-
extensions: ['.js', '.jsx', '.ts', '.tsx'],
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
53
|
};
|
|
@@ -13,7 +13,31 @@ module.exports = {
|
|
|
13
13
|
* Downgrade rules from the base preset to "warn". Do not disable rules (set
|
|
14
14
|
* to "off"). If a rule is already set to a warning, do not disable it.
|
|
15
15
|
*/
|
|
16
|
-
rules: {
|
|
16
|
+
rules: {
|
|
17
|
+
'@typescript-eslint/no-explicit-any': 'warn',
|
|
18
|
+
|
|
19
|
+
'@typescript-eslint/no-floating-promises': 'warn',
|
|
20
|
+
|
|
21
|
+
'@typescript-eslint/no-misused-promises': 'warn',
|
|
22
|
+
|
|
23
|
+
'@typescript-eslint/no-unsafe-argument': 'warn',
|
|
24
|
+
|
|
25
|
+
'@typescript-eslint/no-unsafe-assignment': 'warn',
|
|
26
|
+
|
|
27
|
+
'@typescript-eslint/no-unsafe-call': 'warn',
|
|
28
|
+
|
|
29
|
+
'@typescript-eslint/no-unsafe-member-access': 'warn',
|
|
30
|
+
|
|
31
|
+
'@typescript-eslint/no-unsafe-return': 'warn',
|
|
32
|
+
|
|
33
|
+
'@typescript-eslint/require-await': 'warn',
|
|
34
|
+
|
|
35
|
+
'@typescript-eslint/restrict-plus-operands': 'warn',
|
|
36
|
+
|
|
37
|
+
'@typescript-eslint/restrict-template-expressions': 'warn',
|
|
38
|
+
|
|
39
|
+
'@typescript-eslint/unbound-method': 'warn',
|
|
40
|
+
},
|
|
17
41
|
},
|
|
18
42
|
],
|
|
19
43
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@automattic/eslint-plugin-wpvip",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "ESLint plugin for internal WordPress VIP projects",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"@typescript-eslint/eslint-plugin": "5.55.0",
|
|
31
31
|
"@typescript-eslint/parser": "5.55.0",
|
|
32
32
|
"eslint-config-prettier": "8.7.0",
|
|
33
|
+
"eslint-import-resolver-typescript": "3.5.3",
|
|
33
34
|
"eslint-plugin-import": "2.27.5",
|
|
34
35
|
"eslint-plugin-jest": "27.2.1",
|
|
35
36
|
"eslint-plugin-jsdoc": "40.0.2",
|