eslint-config-seekingalpha-base 8.0.0 → 8.2.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/CHANGELOG.md +14 -1
- package/README.md +1 -1
- package/package.json +3 -3
- package/rules/eslint/index.js +5 -1
- package/rules/eslint/suggestions.js +7 -2
- package/rules/eslint-plugin-import/index.js +6 -1
- package/rules/eslint-plugin-import/style-guide.js +10 -1
- package/rules/eslint-plugin-unicorn/index.js +15 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
## 8.
|
|
3
|
+
## 8.2.0 - 2024-05-12
|
|
4
|
+
|
|
5
|
+
- [breaking] enable `logical-assignment-operators` rule
|
|
6
|
+
|
|
7
|
+
## 8.1.0 - 2024-05-12
|
|
8
|
+
|
|
9
|
+
- [deps] update `eslint-plugin-unicorn` to version `53.0.0`
|
|
10
|
+
- [breaking] enable `unicorn/consistent-empty-array-spread` rule
|
|
11
|
+
- [breaking] enable `unicorn/no-invalid-fetch-options` rule
|
|
12
|
+
- [breaking] enable `unicorn/no-magic-array-flat-depth` rule
|
|
13
|
+
- [breaking] enable `unicorn/prefer-string-raw` rule
|
|
14
|
+
- [breaking] enable `unicorn/prefer-structured-clone` rule
|
|
15
|
+
|
|
16
|
+
## 8.0.0 - 2024-04-08
|
|
4
17
|
|
|
5
18
|
- [breaking] removed `@stylistic/eslint-plugin-js`
|
|
6
19
|
|
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ This package includes the shareable ESLint config used by [SeekingAlpha](https:/
|
|
|
6
6
|
|
|
7
7
|
Install ESLint and all [Peer Dependencies](https://nodejs.org/en/blog/npm/peer-dependencies/):
|
|
8
8
|
|
|
9
|
-
npm install eslint@8.57.0 eslint-plugin-array-func@4.0.0 eslint-plugin-import@2.29.1 eslint-plugin-no-use-extend-native@0.5.0 eslint-plugin-promise@6.1.1 eslint-plugin-unicorn@
|
|
9
|
+
npm install eslint@8.57.0 eslint-plugin-array-func@4.0.0 eslint-plugin-import@2.29.1 eslint-plugin-no-use-extend-native@0.5.0 eslint-plugin-promise@6.1.1 eslint-plugin-unicorn@53.0.0 --save-dev
|
|
10
10
|
|
|
11
11
|
Install SeekingAlpha shareable ESLint:
|
|
12
12
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-config-seekingalpha-base",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.2.0",
|
|
4
4
|
"description": "SeekingAlpha's sharable base ESLint config",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"eslint-plugin-import": "2.29.1",
|
|
54
54
|
"eslint-plugin-no-use-extend-native": "0.5.0",
|
|
55
55
|
"eslint-plugin-promise": "6.1.1",
|
|
56
|
-
"eslint-plugin-unicorn": "
|
|
56
|
+
"eslint-plugin-unicorn": "53.0.0"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"eslint": "8.57.0",
|
|
@@ -62,6 +62,6 @@
|
|
|
62
62
|
"eslint-plugin-import": "2.29.1",
|
|
63
63
|
"eslint-plugin-no-use-extend-native": "0.5.0",
|
|
64
64
|
"eslint-plugin-promise": "6.1.1",
|
|
65
|
-
"eslint-plugin-unicorn": "
|
|
65
|
+
"eslint-plugin-unicorn": "53.0.0"
|
|
66
66
|
}
|
|
67
67
|
}
|
package/rules/eslint/index.js
CHANGED
|
@@ -145,6 +145,9 @@ module.exports = {
|
|
|
145
145
|
// https://eslint.org/docs/rules/init-declarations
|
|
146
146
|
'init-declarations': ['off', 'always'],
|
|
147
147
|
|
|
148
|
+
// https://eslint.org/docs/latest/rules/logical-assignment-operators
|
|
149
|
+
'logical-assignment-operators': ['error', 'always'],
|
|
150
|
+
|
|
148
151
|
// https://eslint.org/docs/rules/max-classes-per-file
|
|
149
152
|
'max-classes-per-file': ['error', config.maxClassesPerFile],
|
|
150
153
|
|
|
@@ -437,7 +440,8 @@ module.exports = {
|
|
|
437
440
|
'no-restricted-syntax': [
|
|
438
441
|
'error',
|
|
439
442
|
{
|
|
440
|
-
selector:
|
|
443
|
+
selector:
|
|
444
|
+
'CallExpression[callee.name="setTimeout"][arguments.length!=2]',
|
|
441
445
|
message: 'setTimeout must always be invoked with two arguments.',
|
|
442
446
|
},
|
|
443
447
|
{
|
|
@@ -446,7 +450,8 @@ module.exports = {
|
|
|
446
450
|
},
|
|
447
451
|
{
|
|
448
452
|
selector: 'LabeledStatement',
|
|
449
|
-
message:
|
|
453
|
+
message:
|
|
454
|
+
'Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand.',
|
|
450
455
|
},
|
|
451
456
|
{
|
|
452
457
|
selector: 'WithStatement',
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
// eslint-plugin-import rules (https://github.com/benmosher/eslint-plugin-import)
|
|
2
2
|
|
|
3
3
|
module.exports = {
|
|
4
|
-
extends: [
|
|
4
|
+
extends: [
|
|
5
|
+
'./helpful-warnings.js',
|
|
6
|
+
'./module-systems.js',
|
|
7
|
+
'./static-analysis.js',
|
|
8
|
+
'./style-guide.js',
|
|
9
|
+
],
|
|
5
10
|
|
|
6
11
|
plugins: ['import'],
|
|
7
12
|
|
|
@@ -32,7 +32,16 @@ module.exports = {
|
|
|
32
32
|
'import/order': [
|
|
33
33
|
'error',
|
|
34
34
|
{
|
|
35
|
-
groups: [
|
|
35
|
+
groups: [
|
|
36
|
+
'builtin',
|
|
37
|
+
'external',
|
|
38
|
+
'internal',
|
|
39
|
+
'parent',
|
|
40
|
+
'sibling',
|
|
41
|
+
'unknown',
|
|
42
|
+
'index',
|
|
43
|
+
'type',
|
|
44
|
+
],
|
|
36
45
|
|
|
37
46
|
'newlines-between': 'always',
|
|
38
47
|
},
|
|
@@ -18,6 +18,9 @@ module.exports = {
|
|
|
18
18
|
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/master/docs/rules/consistent-destructuring.md
|
|
19
19
|
'unicorn/consistent-destructuring': 'error',
|
|
20
20
|
|
|
21
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/consistent-empty-array-spread.md
|
|
22
|
+
'unicorn/consistent-empty-array-spread': 'error',
|
|
23
|
+
|
|
21
24
|
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/master/docs/rules/consistent-function-scoping.md
|
|
22
25
|
'unicorn/consistent-function-scoping': 'error',
|
|
23
26
|
|
|
@@ -102,6 +105,9 @@ module.exports = {
|
|
|
102
105
|
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/master/docs/rules/no-instanceof-array.md
|
|
103
106
|
'unicorn/no-instanceof-array': 'error',
|
|
104
107
|
|
|
108
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-invalid-fetch-options.md
|
|
109
|
+
'unicorn/no-invalid-fetch-options': 'error',
|
|
110
|
+
|
|
105
111
|
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-invalid-remove-event-listener.md
|
|
106
112
|
'unicorn/no-invalid-remove-event-listener': 'error',
|
|
107
113
|
|
|
@@ -117,6 +123,9 @@ module.exports = {
|
|
|
117
123
|
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/master/docs/rules/no-lonely-if.md
|
|
118
124
|
'unicorn/no-lonely-if': 'error',
|
|
119
125
|
|
|
126
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-magic-array-flat-depth.md
|
|
127
|
+
'unicorn/no-magic-array-flat-depth': 'error',
|
|
128
|
+
|
|
120
129
|
/*
|
|
121
130
|
* Disabled in favour of native ESLint no-negated-condition rule
|
|
122
131
|
* https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-negated-condition.md
|
|
@@ -327,6 +336,9 @@ module.exports = {
|
|
|
327
336
|
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/master/docs/rules/prefer-spread.md
|
|
328
337
|
'unicorn/prefer-spread': 'off',
|
|
329
338
|
|
|
339
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-string-raw.md
|
|
340
|
+
'unicorn/prefer-string-raw': 'error',
|
|
341
|
+
|
|
330
342
|
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-string-replace-all.md
|
|
331
343
|
'unicorn/prefer-string-replace-all': 'error',
|
|
332
344
|
|
|
@@ -339,6 +351,9 @@ module.exports = {
|
|
|
339
351
|
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/master/docs/rules/prefer-string-trim-start-end.md
|
|
340
352
|
'unicorn/prefer-string-trim-start-end': 'error',
|
|
341
353
|
|
|
354
|
+
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-structured-clone.md
|
|
355
|
+
'unicorn/prefer-structured-clone': 'error',
|
|
356
|
+
|
|
342
357
|
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-switch.md
|
|
343
358
|
'unicorn/prefer-switch': 'error',
|
|
344
359
|
|