@fullstacksjs/eslint-config 10.6.2 → 10.7.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 +15 -8
- package/index.js +0 -1
- package/init.d.ts +0 -1
- package/init.js +1 -2
- package/package.json +18 -20
- package/registerOpts.js +0 -1
- package/typecheck.js +2 -1
- package/cspell.js +0 -3
package/README.md
CHANGED
|
@@ -55,7 +55,6 @@ When auto module detection is turned on, the configuration reads the metadata fr
|
|
|
55
55
|
interface Modules {
|
|
56
56
|
auto?: boolean; // Auto module detection
|
|
57
57
|
react?: boolean; // controls react, react-hooks, jsx/a11y plugins
|
|
58
|
-
cspell?: boolean; // controls cspell plugin
|
|
59
58
|
typescript?: { // controls typescript plugin
|
|
60
59
|
parserProject?: string[] | string; // controls parserOptions.project
|
|
61
60
|
resolverProject?: string[] | string // controls settings['import/resolver'].typescript.project
|
|
@@ -94,22 +93,30 @@ module.exports = init({
|
|
|
94
93
|
|
|
95
94
|
It's crucial to balance the benefits of linting rules against their performance impact. Below is a table highlighting the most resource-intensive linting rules encountered in a real-world React project:
|
|
96
95
|
|
|
97
|
-
| Rule
|
|
98
|
-
|
|
|
99
|
-
|
|
|
100
|
-
|
|
|
101
|
-
|
|
|
102
|
-
| import/
|
|
103
|
-
| import/namespace | 1148.731 | 6.7% |
|
|
96
|
+
| Rule | Time (ms) | Relative |
|
|
97
|
+
| -------------------------------------- | --------- | -------- |
|
|
98
|
+
| prettier/prettier | 3299.631 | 19.2% |
|
|
99
|
+
| @typescript-eslint/no-misused-promises | 2473.767 | 14.4% |
|
|
100
|
+
| import/no-cycle | 1177.111 | 6.8% |
|
|
101
|
+
| import/namespace | 1148.731 | 6.7% |
|
|
104
102
|
|
|
105
103
|
As illustrated, certain rules significantly increase linting time, potentially hindering the developer experience by slowing down the feedback loop. To mitigate this, you may consider disabling these resource-intensive rules in the development environment. However, they can remain active in environments where performance is less critical, such as Continuous Integration (CI) systems or during pre-commit checks (git hooks).
|
|
106
104
|
|
|
107
105
|
To conditionally disable expensive linting rules, you can modify your configuration as follows:
|
|
108
106
|
|
|
107
|
+
list of expensiveRules to be effected:
|
|
108
|
+
|
|
109
|
+
```js
|
|
110
|
+
'@typescript-eslint/no-misused-promises'
|
|
111
|
+
'import/no-cycle'
|
|
112
|
+
'import/namespace'
|
|
113
|
+
```
|
|
114
|
+
|
|
109
115
|
```js
|
|
110
116
|
module.exports = init({
|
|
111
117
|
modules: {
|
|
112
118
|
disableExpensiveRules: !process.env.CI || !process.env.HUSKY // Or anywhere you want
|
|
119
|
+
prettier: false // So you should run the formatter explicitly.
|
|
113
120
|
},
|
|
114
121
|
});
|
|
115
122
|
```
|
package/index.js
CHANGED
|
@@ -10,7 +10,6 @@ module.exports = {
|
|
|
10
10
|
require.resolve('./promise'),
|
|
11
11
|
require.resolve('./storybook'),
|
|
12
12
|
require.resolve('./jest'),
|
|
13
|
-
global.fullstacksjs?.cspell && require.resolve('./cspell'),
|
|
14
13
|
global.fullstacksjs?.tailwind && require.resolve('./tailwind'),
|
|
15
14
|
global.fullstacksjs?.react && require.resolve('./react'),
|
|
16
15
|
global.fullstacksjs?.next && require.resolve('./next'),
|
package/init.d.ts
CHANGED
package/init.js
CHANGED
|
@@ -31,8 +31,7 @@ function init(opts = {}) {
|
|
|
31
31
|
opts.test && require.resolve('./jest'),
|
|
32
32
|
opts.esm && require.resolve('./esm'),
|
|
33
33
|
opts.strict && require.resolve('./strict'),
|
|
34
|
-
|
|
35
|
-
!opts.disableExpensiveRules && opts.cspell && require.resolve('./cspell'),
|
|
34
|
+
opts.prettier && require.resolve('./prettier'),
|
|
36
35
|
]
|
|
37
36
|
.concat(extraExtends)
|
|
38
37
|
.filter(Boolean),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fullstacksjs/eslint-config",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.7.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "fullstacks <fullstacksjs@gmail.com>",
|
|
6
6
|
"description": "fullstacks eslint config",
|
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
},
|
|
14
14
|
"files": [
|
|
15
15
|
"base.js",
|
|
16
|
-
"cspell.js",
|
|
17
16
|
"cypress.js",
|
|
18
17
|
"esm.js",
|
|
19
18
|
"fp.js",
|
|
@@ -50,45 +49,44 @@
|
|
|
50
49
|
},
|
|
51
50
|
"main": "index.js",
|
|
52
51
|
"dependencies": {
|
|
53
|
-
"@cspell/eslint-plugin": "7.3.8",
|
|
54
52
|
"@graphql-eslint/eslint-plugin": "3.20.1",
|
|
55
|
-
"@typescript-eslint/eslint-plugin": "6.
|
|
56
|
-
"@typescript-eslint/parser": "6.
|
|
53
|
+
"@typescript-eslint/eslint-plugin": "6.13.2",
|
|
54
|
+
"@typescript-eslint/parser": "6.13.2",
|
|
57
55
|
"deepmerge": "4.3.1",
|
|
58
|
-
"eslint-config-next": "14.0.
|
|
59
|
-
"eslint-config-prettier": "9.
|
|
56
|
+
"eslint-config-next": "14.0.3",
|
|
57
|
+
"eslint-config-prettier": "9.1.0",
|
|
60
58
|
"eslint-import-resolver-typescript": "3.6.1",
|
|
61
59
|
"eslint-plugin-cypress": "2.15.1",
|
|
62
60
|
"eslint-plugin-fp": "2.3.0",
|
|
63
61
|
"eslint-plugin-import": "2.29.0",
|
|
64
|
-
"eslint-plugin-jest-formatting": "3.1.0",
|
|
65
62
|
"eslint-plugin-jest": "27.6.0",
|
|
66
|
-
"eslint-plugin-
|
|
63
|
+
"eslint-plugin-jest-formatting": "3.1.0",
|
|
64
|
+
"eslint-plugin-jsx-a11y": "6.8.0",
|
|
67
65
|
"eslint-plugin-node": "11.1.0",
|
|
68
66
|
"eslint-plugin-prettier": "5.0.1",
|
|
69
67
|
"eslint-plugin-promise": "6.1.1",
|
|
70
|
-
"eslint-plugin-react-hooks": "4.6.0",
|
|
71
68
|
"eslint-plugin-react": "7.33.2",
|
|
69
|
+
"eslint-plugin-react-hooks": "4.6.0",
|
|
72
70
|
"eslint-plugin-simple-import-sort": "10.0.0",
|
|
73
71
|
"eslint-plugin-storybook": "0.6.15",
|
|
74
72
|
"eslint-plugin-tailwindcss": "3.13.0",
|
|
75
73
|
"read-pkg-up": "7.0.1"
|
|
76
74
|
},
|
|
77
75
|
"devDependencies": {
|
|
78
|
-
"@semantic-release/github": "9.2.
|
|
79
|
-
"@semantic-release/npm": "11.0.
|
|
80
|
-
"@semantic-release/release-notes-generator": "12.
|
|
81
|
-
"cspell": "
|
|
82
|
-
"eslint": "8.
|
|
76
|
+
"@semantic-release/github": "9.2.4",
|
|
77
|
+
"@semantic-release/npm": "11.0.1",
|
|
78
|
+
"@semantic-release/release-notes-generator": "12.1.0",
|
|
79
|
+
"cspell": "8.1.2",
|
|
80
|
+
"eslint": "8.55.0",
|
|
83
81
|
"eslint-find-rules": "4.1.0",
|
|
84
82
|
"husky": "8.0.3",
|
|
85
|
-
"lint-staged": "15.0
|
|
86
|
-
"np": "
|
|
83
|
+
"lint-staged": "15.2.0",
|
|
84
|
+
"np": "9.1.0",
|
|
87
85
|
"npm-run-all": "4.1.5",
|
|
88
86
|
"pinst": "3.0.0",
|
|
89
|
-
"prettier": "3.0
|
|
90
|
-
"semantic-release": "22.0.
|
|
91
|
-
"typescript": "5.
|
|
87
|
+
"prettier": "3.1.0",
|
|
88
|
+
"semantic-release": "22.0.9",
|
|
89
|
+
"typescript": "5.3.2"
|
|
92
90
|
},
|
|
93
91
|
"peerDependencies": {
|
|
94
92
|
"cypress": ">=8",
|
package/registerOpts.js
CHANGED
package/typecheck.js
CHANGED
|
@@ -18,7 +18,6 @@ module.exports = {
|
|
|
18
18
|
],
|
|
19
19
|
'@typescript-eslint/no-confusing-void-expression': ['off', { ignoreArrowShorthand: true, ignoreVoidOperator: true }], // Annoying and conflict with @typescript-eslint/no-meaningless-void-operator
|
|
20
20
|
'@typescript-eslint/no-duplicate-type-constituents': 'warn',
|
|
21
|
-
'@typescript-eslint/no-unsafe-enum-comparison': 'warn',
|
|
22
21
|
'@typescript-eslint/no-floating-promises': expensiveRules(['error', { ignoreVoid: true }]),
|
|
23
22
|
'@typescript-eslint/no-for-in-array': 'error',
|
|
24
23
|
'@typescript-eslint/no-implied-eval': 'error',
|
|
@@ -28,6 +27,7 @@ module.exports = {
|
|
|
28
27
|
'@typescript-eslint/no-redundant-type-constituents': 'warn',
|
|
29
28
|
'@typescript-eslint/no-throw-literal': ['warn', { allowThrowingUnknown: false }],
|
|
30
29
|
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error',
|
|
30
|
+
'@typescript-eslint/no-unsafe-enum-comparison': 'warn',
|
|
31
31
|
'@typescript-eslint/no-unnecessary-condition': [
|
|
32
32
|
'warn',
|
|
33
33
|
{
|
|
@@ -38,6 +38,7 @@ module.exports = {
|
|
|
38
38
|
'@typescript-eslint/no-unnecessary-qualifier': 'error',
|
|
39
39
|
'@typescript-eslint/no-unnecessary-type-arguments': 'error',
|
|
40
40
|
'@typescript-eslint/no-unnecessary-type-assertion': 'error',
|
|
41
|
+
'@typescript-eslint/no-unsafe-unary-minus': 'error',
|
|
41
42
|
'@typescript-eslint/non-nullable-type-assertion-style': 'warn',
|
|
42
43
|
'@typescript-eslint/prefer-includes': 'warn',
|
|
43
44
|
'@typescript-eslint/prefer-optional-chain': 'warn',
|
package/cspell.js
DELETED