@automattic/eslint-plugin-wpvip 0.7.0 → 0.9.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/configs/javascript.js +22 -1
- package/configs/weak-javascript.js +5 -1
- package/package.json +18 -18
- package/utils/is-package-installed.js +8 -1
package/configs/javascript.js
CHANGED
|
@@ -42,6 +42,7 @@ module.exports = {
|
|
|
42
42
|
'no-compare-neg-zero': 'error',
|
|
43
43
|
// 'no-cond-assign': 'error', // extended below
|
|
44
44
|
'no-const-assign': 'error',
|
|
45
|
+
'no-constant-binary-expression': 'error',
|
|
45
46
|
'no-constant-condition': 'error',
|
|
46
47
|
'no-control-regex': 'error',
|
|
47
48
|
'no-debugger': 'error',
|
|
@@ -134,6 +135,22 @@ module.exports = {
|
|
|
134
135
|
'import/no-unresolved': 'error',
|
|
135
136
|
'unused-imports/no-unused-imports': 'warn',
|
|
136
137
|
|
|
138
|
+
// Enforce external / internal import groups and alphabetical ordering.
|
|
139
|
+
'import/order': [
|
|
140
|
+
'error',
|
|
141
|
+
{
|
|
142
|
+
'newlines-between': 'always',
|
|
143
|
+
alphabetize: {
|
|
144
|
+
order: 'asc',
|
|
145
|
+
},
|
|
146
|
+
groups: [
|
|
147
|
+
[ 'builtin', 'external' ],
|
|
148
|
+
[ 'index', 'internal', 'object', 'parent', 'sibling' ],
|
|
149
|
+
[ 'type' ],
|
|
150
|
+
],
|
|
151
|
+
},
|
|
152
|
+
],
|
|
153
|
+
|
|
137
154
|
// Enforce Unix linebreaks. Included here and not in "formatting" since it
|
|
138
155
|
// is not controversial and helps with interchange.
|
|
139
156
|
'linebreak-style': [ 'error', 'unix' ],
|
|
@@ -217,7 +234,6 @@ module.exports = {
|
|
|
217
234
|
'promise/avoid-new': 'off',
|
|
218
235
|
'promise/catch-or-return': 'off',
|
|
219
236
|
'promise/no-callback-in-promise': 'warn',
|
|
220
|
-
'promise/no-multiple-resolved': 'error',
|
|
221
237
|
'promise/no-native': 'off',
|
|
222
238
|
'promise/no-nesting': 'warn',
|
|
223
239
|
'promise/no-new-statics': 'error',
|
|
@@ -228,6 +244,11 @@ module.exports = {
|
|
|
228
244
|
'promise/prefer-await-to-callbacks': 'off',
|
|
229
245
|
'promise/prefer-await-to-then': 'off',
|
|
230
246
|
'promise/valid-params': 'error',
|
|
247
|
+
|
|
248
|
+
// This rule has been disabled because it is extremely slow:
|
|
249
|
+
// https://github.com/Automattic/vip-cli/pull/1534
|
|
250
|
+
//
|
|
251
|
+
// 'promise/no-multiple-resolved': 'error',
|
|
231
252
|
},
|
|
232
253
|
|
|
233
254
|
settings: {
|
|
@@ -53,12 +53,16 @@ module.exports = {
|
|
|
53
53
|
|
|
54
54
|
radix: 'warn',
|
|
55
55
|
|
|
56
|
-
'promise/no-multiple-resolved': 'warn',
|
|
57
56
|
'promise/no-new-statics': 'warn',
|
|
58
57
|
'promise/no-return-in-finally': 'warn',
|
|
59
58
|
'promise/no-return-wrap': 'warn',
|
|
60
59
|
'promise/param-names': 'warn',
|
|
61
60
|
'promise/valid-params': 'warn',
|
|
61
|
+
|
|
62
|
+
// This rule has been disabled because it is extremely slow:
|
|
63
|
+
// https://github.com/Automattic/vip-cli/pull/1534
|
|
64
|
+
//
|
|
65
|
+
// 'promise/no-multiple-resolved': 'warn',
|
|
62
66
|
},
|
|
63
67
|
},
|
|
64
68
|
],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@automattic/eslint-plugin-wpvip",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "ESLint plugin for internal WordPress VIP projects",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -32,37 +32,37 @@
|
|
|
32
32
|
},
|
|
33
33
|
"homepage": "https://github.com/Automattic/eslint-config-wpvip#readme",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@babel/eslint-parser": "7.
|
|
36
|
-
"@rushstack/eslint-patch": "1.
|
|
37
|
-
"@typescript-eslint/eslint-plugin": "
|
|
38
|
-
"@typescript-eslint/parser": "
|
|
35
|
+
"@babel/eslint-parser": "7.23.3",
|
|
36
|
+
"@rushstack/eslint-patch": "1.6.0",
|
|
37
|
+
"@typescript-eslint/eslint-plugin": "6.12.0",
|
|
38
|
+
"@typescript-eslint/parser": "6.12.0",
|
|
39
39
|
"eslint-config-prettier": "8.7.0",
|
|
40
|
-
"eslint-import-resolver-typescript": "3.
|
|
41
|
-
"eslint-plugin-import": "2.
|
|
42
|
-
"eslint-plugin-jest": "27.
|
|
43
|
-
"eslint-plugin-jsdoc": "
|
|
40
|
+
"eslint-import-resolver-typescript": "3.6.1",
|
|
41
|
+
"eslint-plugin-import": "2.29.0",
|
|
42
|
+
"eslint-plugin-jest": "27.6.0",
|
|
43
|
+
"eslint-plugin-jsdoc": "46.8.2",
|
|
44
44
|
"eslint-plugin-json": "3.1.0",
|
|
45
45
|
"eslint-plugin-jsx-a11y": "6.7.1",
|
|
46
46
|
"eslint-plugin-prettier": "4.2.1",
|
|
47
47
|
"eslint-plugin-promise": "6.1.1",
|
|
48
|
-
"eslint-plugin-react": "7.
|
|
48
|
+
"eslint-plugin-react": "7.33.2",
|
|
49
49
|
"eslint-plugin-react-hooks": "4.6.0",
|
|
50
50
|
"eslint-plugin-security": "1.7.1",
|
|
51
51
|
"eslint-plugin-unused-imports": "3.0.0",
|
|
52
52
|
"find-package-json": "1.2.0",
|
|
53
|
-
"globals": "13.
|
|
53
|
+
"globals": "13.23.0"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
56
|
"eslint": ">=8"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
|
-
"@tsconfig/node18": "
|
|
60
|
-
"@types/eslint": "8.44.
|
|
61
|
-
"@types/jest": "29.5.
|
|
62
|
-
"eslint": "8.
|
|
63
|
-
"jest": "29.
|
|
59
|
+
"@tsconfig/node18": "18.2.2",
|
|
60
|
+
"@types/eslint": "8.44.7",
|
|
61
|
+
"@types/jest": "29.5.10",
|
|
62
|
+
"eslint": "8.54.0",
|
|
63
|
+
"jest": "29.7.0",
|
|
64
64
|
"prettier": "npm:wp-prettier@2.8.5",
|
|
65
|
-
"ts-jest": "29.
|
|
66
|
-
"typescript": "
|
|
65
|
+
"ts-jest": "29.1.1",
|
|
66
|
+
"typescript": "5.3.2"
|
|
67
67
|
}
|
|
68
68
|
}
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
2
4
|
const findPackageJson = require( 'find-package-json' );
|
|
3
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Internal dependencies
|
|
8
|
+
*/
|
|
9
|
+
const debugLog = require( './debug-log' );
|
|
10
|
+
|
|
4
11
|
// Get a list of all package.json files in the current directory tree, ascending
|
|
5
12
|
// up the tree from the current directory. Note that this code behaves differently
|
|
6
13
|
// when it is installed as a package vs. when we are linting the code in this repo.
|