@nihalgonsalves/esconfig 0.10.2 → 0.10.4
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 +4 -4
- package/eslint.config.react-shared.js +3 -9
- package/eslint.config.shared.js +11 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -30,11 +30,11 @@ Shared ECMAScript Config (TS, Lint, Prettier)
|
|
|
30
30
|
|
|
31
31
|
import sharedConfig from "@nihalgonsalves/esconfig/eslint.config.shared";
|
|
32
32
|
|
|
33
|
-
export default tseslint.config(
|
|
33
|
+
export default tseslint.config(
|
|
34
34
|
{ ignores: [] },
|
|
35
35
|
...sharedConfig,
|
|
36
36
|
// ... others
|
|
37
|
-
|
|
37
|
+
);
|
|
38
38
|
```
|
|
39
39
|
|
|
40
40
|
If you're using React:
|
|
@@ -44,11 +44,11 @@ Shared ECMAScript Config (TS, Lint, Prettier)
|
|
|
44
44
|
|
|
45
45
|
import sharedConfig from "@nihalgonsalves/esconfig/eslint.config.react-shared";
|
|
46
46
|
|
|
47
|
-
export default tseslint.config(
|
|
47
|
+
export default tseslint.config(
|
|
48
48
|
{ ignores: [] },
|
|
49
49
|
...sharedConfig,
|
|
50
50
|
// ... others
|
|
51
|
-
|
|
51
|
+
);
|
|
52
52
|
```
|
|
53
53
|
|
|
54
54
|
4. `package.json`
|
|
@@ -12,7 +12,7 @@ import sharedConfig from "./eslint.config.shared.js";
|
|
|
12
12
|
|
|
13
13
|
/** @type {Record<string, any>} */
|
|
14
14
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
|
|
15
|
-
const reactRules = react.
|
|
15
|
+
const reactRules = react.configs.recommended.rules;
|
|
16
16
|
|
|
17
17
|
export default tseslint.config(
|
|
18
18
|
...sharedConfig,
|
|
@@ -92,14 +92,8 @@ export default tseslint.config(
|
|
|
92
92
|
"error",
|
|
93
93
|
{ ignorePureComponents: true },
|
|
94
94
|
],
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
{
|
|
98
|
-
ignore: [],
|
|
99
|
-
customValidators: [],
|
|
100
|
-
skipUndeclared: false,
|
|
101
|
-
},
|
|
102
|
-
],
|
|
95
|
+
// TypeScript
|
|
96
|
+
"react/prop-types": ["off"],
|
|
103
97
|
"react/require-render-return": "error",
|
|
104
98
|
"react/self-closing-comp": "error",
|
|
105
99
|
"react/sort-comp": [
|
package/eslint.config.shared.js
CHANGED
|
@@ -104,11 +104,12 @@ export default tseslint.config(
|
|
|
104
104
|
"**/*{.,_}{test,spec}.{js,jsx}",
|
|
105
105
|
"**/*{.,_}{test,spec}.{ts,tsx}",
|
|
106
106
|
"**/*.config.{js,ts,cjs,mjs,cts,mts}",
|
|
107
|
+
"**/*.stories.@(ts|tsx|js|jsx|mjs|cjs)",
|
|
107
108
|
],
|
|
108
109
|
optionalDependencies: false,
|
|
109
110
|
},
|
|
110
111
|
],
|
|
111
|
-
"import/no-default-export": "error",
|
|
112
|
+
"import/no-default-export": ["error"],
|
|
112
113
|
"import/order": [
|
|
113
114
|
"error",
|
|
114
115
|
{
|
|
@@ -157,15 +158,24 @@ export default tseslint.config(
|
|
|
157
158
|
assertionStyle: "never",
|
|
158
159
|
},
|
|
159
160
|
],
|
|
161
|
+
"@typescript-eslint/prefer-nullish-coalescing": [
|
|
162
|
+
"error",
|
|
163
|
+
{ ignorePrimitives: { boolean: true, string: true } },
|
|
164
|
+
],
|
|
160
165
|
"@typescript-eslint/strict-boolean-expressions": [
|
|
161
166
|
"error",
|
|
162
167
|
{ allowNullableBoolean: true, allowNullableString: true },
|
|
163
168
|
],
|
|
169
|
+
"@typescript-eslint/restrict-template-expressions": [
|
|
170
|
+
"error",
|
|
171
|
+
{ allowNumber: true },
|
|
172
|
+
],
|
|
164
173
|
"@typescript-eslint/promise-function-async": "error",
|
|
165
174
|
"@typescript-eslint/method-signature-style": "error",
|
|
166
175
|
"@typescript-eslint/no-import-type-side-effects": "error",
|
|
167
176
|
"@typescript-eslint/require-array-sort-compare": "error",
|
|
168
177
|
"@typescript-eslint/switch-exhaustiveness-check": "error",
|
|
178
|
+
"@typescript-eslint/require-await": "off",
|
|
169
179
|
},
|
|
170
180
|
settings: {
|
|
171
181
|
"import/extensions": [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nihalgonsalves/esconfig",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.4",
|
|
4
4
|
"description": "Shared ECMAScript Config (TS, Lint, Prettier)",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"repository": "git@github.com:nihalgonsalves/esconfig.git",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"format:check": "prettier . --check"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@eslint/js": "^9.
|
|
25
|
+
"@eslint/js": "^9.9.0",
|
|
26
26
|
"eslint-config-prettier": "^9.1.0",
|
|
27
27
|
"eslint-plugin-import": "^2.29.1",
|
|
28
28
|
"eslint-plugin-jsx-a11y": "^6.9.0",
|
|
@@ -34,15 +34,15 @@
|
|
|
34
34
|
"@commitlint/cli": "^19.4.0",
|
|
35
35
|
"@commitlint/config-conventional": "^19.2.2",
|
|
36
36
|
"@types/eslint__js": "^8.42.3",
|
|
37
|
-
"@types/node": "^22.
|
|
38
|
-
"eslint": "^9.
|
|
37
|
+
"@types/node": "^22.2.0",
|
|
38
|
+
"eslint": "^9.9.0",
|
|
39
39
|
"knip": "^5.27.2",
|
|
40
40
|
"lefthook": "^1.7.12",
|
|
41
41
|
"prettier": "^3.3.3",
|
|
42
42
|
"typescript": "^5.5.4"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
|
-
"eslint": "^9.
|
|
45
|
+
"eslint": "^9.9.0",
|
|
46
46
|
"typescript": "^5.5.4",
|
|
47
47
|
"typescript-eslint": "^8.0.1"
|
|
48
48
|
}
|