@automattic/eslint-plugin-wpvip 0.6.0 → 0.7.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.
@@ -168,6 +168,8 @@ module.exports = {
168
168
 
169
169
  'no-lonely-if': 'error',
170
170
 
171
+ 'no-implicit-coercion': 'error',
172
+
171
173
  'no-mixed-operators': 'error',
172
174
 
173
175
  'no-nested-ternary': 'error',
@@ -178,7 +180,14 @@ module.exports = {
178
180
 
179
181
  'no-unused-expressions': 'error',
180
182
 
181
- 'no-unused-vars': [ 'error', { ignoreRestSiblings: true } ],
183
+ 'no-unused-vars': [
184
+ 'error',
185
+ {
186
+ argsIgnorePattern: '^_',
187
+ destructuredArrayIgnorePattern: '^_',
188
+ ignoreRestSiblings: true,
189
+ },
190
+ ],
182
191
 
183
192
  'no-useless-computed-key': 'error',
184
193
 
@@ -27,6 +27,16 @@ module.exports = {
27
27
  // config, and is elevated to an error here.
28
28
  '@typescript-eslint/no-explicit-any': 'error',
29
29
 
30
+ // Provide escape hatches around destructuring and arguments.
31
+ '@typescript-eslint/no-unused-vars': [
32
+ 'error',
33
+ {
34
+ argsIgnorePattern: '^_',
35
+ destructuredArrayIgnorePattern: '^_',
36
+ ignoreRestSiblings: true,
37
+ },
38
+ ],
39
+
30
40
  // Disable some rules that TypeScript handles and are also a Performance
31
41
  // issue. See:
32
42
  // https://github.com/typescript-eslint/typescript-eslint/blob/main/docs/linting/troubleshooting/Performance.md#eslint-plugin-import
@@ -43,9 +53,6 @@ module.exports = {
43
53
  '@typescript-eslint/no-shadow': 'error',
44
54
  'import/no-duplicates': 'error',
45
55
 
46
- // Handled by TS itself.
47
- 'no-unused-vars': 'off',
48
-
49
56
  // Empty classes are allowed if they are accompanied by a decorator.
50
57
  // This is common in frameworks such as Angular / nest.js.
51
58
  '@typescript-eslint/no-extraneous-class': [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automattic/eslint-plugin-wpvip",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "ESLint plugin for internal WordPress VIP projects",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -22,8 +22,8 @@ const parent =
22
22
  debugLog( `Found package.json: ${ parent.__path || 'none' }` );
23
23
 
24
24
  module.exports = function isPackageInstalled( packageName ) {
25
- const isDevDependency = !! parent.devDependencies?.[ `${ packageName }` ];
26
- const isProdDependency = !! parent.dependencies?.[ `${ packageName }` ];
25
+ const isDevDependency = Boolean( parent.devDependencies?.[ `${ packageName }` ] );
26
+ const isProdDependency = Boolean( parent.dependencies?.[ `${ packageName }` ] );
27
27
 
28
28
  return isDevDependency || isProdDependency;
29
29
  };