@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 +1 -2
- package/package.json +3 -3
- package/rules/unicorn.js +9 -1
package/node.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@will-stone/eslint-config",
|
|
3
|
-
"version": "3.
|
|
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": "^
|
|
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',
|