@will-stone/eslint-config 6.10.0 → 6.11.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.
Files changed (2) hide show
  1. package/package.json +9 -9
  2. package/rules/unicorn.js +15 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@will-stone/eslint-config",
3
- "version": "6.10.0",
3
+ "version": "6.11.0",
4
4
  "private": false,
5
5
  "description": "My ESLint config",
6
6
  "repository": {
@@ -20,19 +20,19 @@
20
20
  "eslint-find-rules": "^4.1.0"
21
21
  },
22
22
  "peerDependencies": {
23
- "@typescript-eslint/eslint-plugin": "^5.13.0",
24
- "@typescript-eslint/parser": "^5.13.0",
25
- "eslint": "^8.10.0",
26
- "eslint-plugin-import": "^2.25.4",
27
- "eslint-plugin-jest": "^26.1.1",
23
+ "@typescript-eslint/eslint-plugin": "^5.18.0",
24
+ "@typescript-eslint/parser": "^5.18.0",
25
+ "eslint": "^8.12.0",
26
+ "eslint-plugin-import": "^2.26.0",
27
+ "eslint-plugin-jest": "^26.1.3",
28
28
  "eslint-plugin-jsx-a11y": "^6.5.1",
29
29
  "eslint-plugin-node": "^11.1.0",
30
30
  "eslint-plugin-prettier": "^4.0.0",
31
- "eslint-plugin-react": "^7.29.3",
32
- "eslint-plugin-react-hooks": "^4.3.0",
31
+ "eslint-plugin-react": "^7.29.4",
32
+ "eslint-plugin-react-hooks": "^4.4.0",
33
33
  "eslint-plugin-simple-import-sort": "^7.0.0",
34
34
  "eslint-plugin-switch-case": "^1.1.2",
35
- "eslint-plugin-unicorn": "^41.0.0",
35
+ "eslint-plugin-unicorn": "^42.0.0",
36
36
  "typescript": "4.x"
37
37
  },
38
38
  "peerDependenciesMeta": {
package/rules/unicorn.js CHANGED
@@ -131,6 +131,10 @@ module.exports = {
131
131
  // Disallow assigning this to a variable
132
132
  'unicorn/no-this-assignment': 'error',
133
133
 
134
+ // IIFE with parenthesized arrow function body is considered unreadable
135
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unreadable-iife.md
136
+ 'unicorn/no-unreadable-iife': 'error',
137
+
134
138
  // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-fallback-in-spread.md
135
139
  'unicorn/no-useless-fallback-in-spread': 'warn',
136
140
 
@@ -143,6 +147,9 @@ module.exports = {
143
147
  // Disallow useless spread
144
148
  'unicorn/no-useless-spread': 'warn',
145
149
 
150
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-switch-case.md
151
+ 'unicorn/no-useless-switch-case': 'error',
152
+
146
153
  // ❌ let foo = undefined;
147
154
  // ✅ let foo;
148
155
  'unicorn/no-useless-undefined': 'warn',
@@ -225,10 +232,18 @@ module.exports = {
225
232
  // e.g. foo.insertBefore(baz, bar) -> foo.before(bar, 'baz')
226
233
  'unicorn/prefer-modern-dom-apis': 'warn',
227
234
 
235
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-modern-math-apis.md
236
+ 'unicorn/prefer-modern-math-apis': 'warn',
237
+
228
238
  // Not ready yet for ESM modules
229
239
  // https://github.com/microsoft/TypeScript/issues/33079
230
240
  'unicorn/prefer-module': 'off',
231
241
 
242
+ // If a function is equivalent to String, Number, BigInt, Boolean, or Symbol,
243
+ // you should use the built-in one directly. Wrapping the built-in in a function is moot.
244
+ // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-native-coercion-functions.md
245
+ 'unicorn/prefer-native-coercion-functions': 'warn',
246
+
232
247
  // Prefer negative index over .length - index
233
248
  // for {String,Array,TypedArray}#slice() and Array#splice()
234
249
  'unicorn/prefer-negative-index': 'warn',