@robinblomberg/eslint-config-robinblomberg 0.19.1 → 0.21.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/README.md +9 -9
- package/index.js +14 -11
- package/package.json +13 -13
package/README.md
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
# ESLint
|
|
1
|
+
# ESLint config
|
|
2
2
|
|
|
3
3
|
## Installation
|
|
4
4
|
|
|
5
|
-
```
|
|
6
|
-
npm install
|
|
5
|
+
```sh
|
|
6
|
+
npm install -D @robinblomberg/eslint-config-robinblomberg
|
|
7
7
|
```
|
|
8
8
|
|
|
9
9
|
## Configuration
|
|
10
10
|
|
|
11
11
|
Create a file called **.eslintrc.js** at the project root:
|
|
12
12
|
|
|
13
|
-
```
|
|
13
|
+
```js
|
|
14
14
|
module.exports = {
|
|
15
|
-
extends: '@robinblomberg/robinblomberg'
|
|
16
|
-
}
|
|
15
|
+
extends: '@robinblomberg/robinblomberg',
|
|
16
|
+
};
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
## NPM scripts
|
|
@@ -24,7 +24,7 @@ Add the following scripts to your package.json:
|
|
|
24
24
|
{
|
|
25
25
|
"scripts": {
|
|
26
26
|
"lint-scripts": "eslint \"**/*.{js,jsx,ts,tsx}\"",
|
|
27
|
-
"lint-scripts-fix": "eslint \"**/*.{js,jsx,ts,tsx}\" --fix"
|
|
27
|
+
"lint-scripts-fix": "eslint \"**/*.{js,jsx,ts,tsx}\" --fix"
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
```
|
|
@@ -33,11 +33,11 @@ Adjust the paths according to your project/file structure as necessary (e.g. `"e
|
|
|
33
33
|
|
|
34
34
|
To run a script, enter the following in your command line:
|
|
35
35
|
|
|
36
|
-
```
|
|
36
|
+
```sh
|
|
37
37
|
npm run lint-scripts
|
|
38
38
|
```
|
|
39
39
|
|
|
40
|
-
## Formatting on
|
|
40
|
+
## Formatting on save
|
|
41
41
|
|
|
42
42
|
With this knowledge of ESLint messages in mind, we can modify VS Code to tell ESLint to fix any issues (mainly formatting) every time we save. To open the settings menu, click on the gear icon in the lower left, and then choose **Settings**.
|
|
43
43
|
|
package/index.js
CHANGED
|
@@ -649,7 +649,7 @@ module.exports = defineConfig({
|
|
|
649
649
|
'react/no-direct-mutation-state': warn,
|
|
650
650
|
'react/no-find-dom-node': warn,
|
|
651
651
|
'react/no-is-mounted': warn,
|
|
652
|
-
'react/no-multi-comp':
|
|
652
|
+
'react/no-multi-comp': off,
|
|
653
653
|
'react/no-redundant-should-component-update': warn,
|
|
654
654
|
'react/no-render-return-value': warn,
|
|
655
655
|
'react/no-set-state': off,
|
|
@@ -1005,6 +1005,7 @@ module.exports = defineConfig({
|
|
|
1005
1005
|
// Disabled due to slow performance:
|
|
1006
1006
|
'import/no-self-import': off,
|
|
1007
1007
|
'import/no-unassigned-import': warn,
|
|
1008
|
+
// Disabled due to false positives:
|
|
1008
1009
|
'import/no-unresolved': warn,
|
|
1009
1010
|
'import/no-unused-modules': warn,
|
|
1010
1011
|
// Disabled due to slow performance:
|
|
@@ -1042,7 +1043,7 @@ module.exports = defineConfig({
|
|
|
1042
1043
|
'always',
|
|
1043
1044
|
{ exceptAfterSingleLine: true },
|
|
1044
1045
|
],
|
|
1045
|
-
'max-classes-per-file': [
|
|
1046
|
+
'max-classes-per-file': [off, 1],
|
|
1046
1047
|
'max-depth': off,
|
|
1047
1048
|
'max-len': [
|
|
1048
1049
|
warn,
|
|
@@ -1368,8 +1369,8 @@ module.exports = defineConfig({
|
|
|
1368
1369
|
'sonarjs/no-all-duplicated-branches': warn,
|
|
1369
1370
|
'sonarjs/no-collapsible-if': warn,
|
|
1370
1371
|
'sonarjs/no-collection-size-mischeck': warn,
|
|
1371
|
-
'sonarjs/no-duplicate-string':
|
|
1372
|
-
'sonarjs/no-duplicated-branches':
|
|
1372
|
+
'sonarjs/no-duplicate-string': off,
|
|
1373
|
+
'sonarjs/no-duplicated-branches': off,
|
|
1373
1374
|
'sonarjs/no-element-overwrite': warn,
|
|
1374
1375
|
'sonarjs/no-empty-collection': warn,
|
|
1375
1376
|
'sonarjs/no-extra-arguments': warn,
|
|
@@ -1456,7 +1457,7 @@ module.exports = defineConfig({
|
|
|
1456
1457
|
},
|
|
1457
1458
|
},
|
|
1458
1459
|
],
|
|
1459
|
-
'unicorn/import-style':
|
|
1460
|
+
'unicorn/import-style': off,
|
|
1460
1461
|
'unicorn/new-for-builtins': warn,
|
|
1461
1462
|
'unicorn/no-abusive-eslint-disable': warn,
|
|
1462
1463
|
'unicorn/no-array-callback-reference': warn,
|
|
@@ -1480,7 +1481,7 @@ module.exports = defineConfig({
|
|
|
1480
1481
|
'unicorn/no-new-buffer': warn,
|
|
1481
1482
|
'unicorn/no-null': off,
|
|
1482
1483
|
'unicorn/no-object-as-default-parameter': off,
|
|
1483
|
-
'unicorn/no-process-exit':
|
|
1484
|
+
'unicorn/no-process-exit': off,
|
|
1484
1485
|
'unicorn/no-static-only-class': warn,
|
|
1485
1486
|
// Disabled due to slow performance:
|
|
1486
1487
|
'unicorn/no-thenable': off,
|
|
@@ -1527,7 +1528,8 @@ module.exports = defineConfig({
|
|
|
1527
1528
|
'unicorn/prefer-module': off,
|
|
1528
1529
|
'unicorn/prefer-native-coercion-functions': warn,
|
|
1529
1530
|
'unicorn/prefer-negative-index': warn,
|
|
1530
|
-
|
|
1531
|
+
// Not available in earlier Node.js versions:
|
|
1532
|
+
'unicorn/prefer-node-protocol': off,
|
|
1531
1533
|
'unicorn/prefer-number-properties': off,
|
|
1532
1534
|
'unicorn/prefer-object-from-entries': warn,
|
|
1533
1535
|
'unicorn/prefer-optional-catch-binding': warn,
|
|
@@ -1545,15 +1547,16 @@ module.exports = defineConfig({
|
|
|
1545
1547
|
'unicorn/prefer-string-trim-start-end': warn,
|
|
1546
1548
|
'unicorn/prefer-switch': warn,
|
|
1547
1549
|
'unicorn/prefer-ternary': off,
|
|
1548
|
-
|
|
1550
|
+
// Not available in all Node.js versions or without specific settings:
|
|
1551
|
+
'unicorn/prefer-top-level-await': off,
|
|
1549
1552
|
'unicorn/prefer-type-error': warn,
|
|
1550
1553
|
'unicorn/prevent-abbreviations': off,
|
|
1551
|
-
'unicorn/relative-url-style':
|
|
1554
|
+
'unicorn/relative-url-style': off,
|
|
1552
1555
|
'unicorn/require-array-join-separator': warn,
|
|
1553
1556
|
'unicorn/require-number-to-fixed-digits-argument': warn,
|
|
1554
|
-
'unicorn/require-post-message-target-origin':
|
|
1557
|
+
'unicorn/require-post-message-target-origin': warn,
|
|
1555
1558
|
'unicorn/string-content': off,
|
|
1556
|
-
'unicorn/switch-case-braces':
|
|
1559
|
+
'unicorn/switch-case-braces': off,
|
|
1557
1560
|
'unicorn/template-indent': warn,
|
|
1558
1561
|
'unicorn/text-encoding-identifier-case': warn,
|
|
1559
1562
|
'unicorn/throw-new-error': warn,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@robinblomberg/eslint-config-robinblomberg",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.0",
|
|
4
4
|
"author": "Robin Blomberg",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"repository": {
|
|
@@ -12,23 +12,23 @@
|
|
|
12
12
|
},
|
|
13
13
|
"homepage": "https://github.com/RobinBlomberg/eslint-config#readme",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@babel/core": "^7.
|
|
16
|
-
"@babel/eslint-parser": "^7.
|
|
17
|
-
"@typescript-eslint/eslint-plugin": "^6.
|
|
18
|
-
"@typescript-eslint/parser": "^6.
|
|
19
|
-
"eslint-define-config": "^
|
|
20
|
-
"eslint-plugin-import": "^2.
|
|
21
|
-
"eslint-plugin-jsdoc": "^46.
|
|
22
|
-
"eslint-plugin-jsx-a11y": "^6.
|
|
15
|
+
"@babel/core": "^7.23.6",
|
|
16
|
+
"@babel/eslint-parser": "^7.23.3",
|
|
17
|
+
"@typescript-eslint/eslint-plugin": "^6.14.0",
|
|
18
|
+
"@typescript-eslint/parser": "^6.14.0",
|
|
19
|
+
"eslint-define-config": "^2.0.0",
|
|
20
|
+
"eslint-plugin-import": "^2.29.0",
|
|
21
|
+
"eslint-plugin-jsdoc": "^46.9.1",
|
|
22
|
+
"eslint-plugin-jsx-a11y": "^6.8.0",
|
|
23
23
|
"eslint-plugin-react": "^7.33.2",
|
|
24
|
-
"eslint-plugin-sonarjs": "^0.
|
|
24
|
+
"eslint-plugin-sonarjs": "^0.23.0",
|
|
25
25
|
"eslint-plugin-sort-exports": "^0.8.0",
|
|
26
26
|
"eslint-plugin-sort-keys": "^2.3.5",
|
|
27
|
-
"eslint-plugin-storybook": "^0.6.
|
|
28
|
-
"eslint-plugin-unicorn": "^
|
|
27
|
+
"eslint-plugin-storybook": "^0.6.15",
|
|
28
|
+
"eslint-plugin-unicorn": "^49.0.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@robinblomberg/eslint-config-robinblomberg": "0.
|
|
31
|
+
"@robinblomberg/eslint-config-robinblomberg": "0.20.0",
|
|
32
32
|
"@types/node": "*"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|