@will-stone/eslint-config 3.0.5 → 3.1.2

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/node.js CHANGED
@@ -1,6 +1,5 @@
1
1
  const nodeRules = require('./rules/node')
2
2
 
3
-
4
3
  module.exports = {
5
4
  env: {
6
5
  node: true,
@@ -8,5 +7,5 @@ module.exports = {
8
7
 
9
8
  plugins: ['node'],
10
9
 
11
- rules: nodeRules
10
+ rules: nodeRules,
12
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@will-stone/eslint-config",
3
- "version": "3.0.5",
3
+ "version": "3.1.2",
4
4
  "private": false,
5
5
  "description": "My ESLint config",
6
6
  "repository": {
@@ -25,11 +25,11 @@
25
25
  "eslint-plugin-react-hooks": "^4.2.0",
26
26
  "eslint-plugin-simple-import-sort": "^7.0.0",
27
27
  "eslint-plugin-switch-case": "^1.1.2",
28
- "eslint-plugin-unicorn": "^35.0.0"
28
+ "eslint-plugin-unicorn": "^36.0.0"
29
29
  },
30
30
  "peerDependencies": {
31
31
  "eslint": "^7.32.0",
32
- "typescript": "4.x"
32
+ "typescript": "4.x || ^4.5.0-beta"
33
33
  },
34
34
  "peerDependenciesMeta": {
35
35
  "typescript": {
package/rules/unicorn.js CHANGED
@@ -82,6 +82,10 @@ module.exports = {
82
82
  // Require Array.isArray() instead of instanceof Array
83
83
  'unicorn/no-instanceof-array': 'warn',
84
84
 
85
+ // The removeEventListener function must be called with a reference to the same
86
+ // function that was passed to addEventListener.
87
+ 'unicorn/no-invalid-remove-event-listener': 'error',
88
+
85
89
  // Disallow identifiers (var names) starting with new.
86
90
  // Do not check properties and allow "class" so that "className" is allowed.
87
91
  'unicorn/no-keyword-prefix': [
@@ -116,6 +120,10 @@ module.exports = {
116
120
  // Disallow assigning this to a variable
117
121
  'unicorn/no-this-assignment': 'error',
118
122
 
123
+ // TS doesn't allow falsy values to be spread so fallbacks are required
124
+ // https://github.com/microsoft/TypeScript/issues/37491
125
+ 'unicorn/no-useless-fallback-in-spread': 'off',
126
+
119
127
  // Disallow useless array length check
120
128
  'unicorn/no-useless-length-check': 'warn',
121
129
 
@@ -254,7 +262,7 @@ module.exports = {
254
262
  'unicorn/prefer-switch': 'off',
255
263
 
256
264
  // Prefer ternary expressions over simple if-else statements
257
- 'unicorn/prefer-ternary': 'warn',
265
+ 'unicorn/prefer-ternary': ['warn', 'only-single-line'],
258
266
 
259
267
  // Prefer top-level await over top-level promises and async function calls
260
268
  'unicorn/prefer-top-level-await': 'error',