@shlinkio/eslint-config-js-coding-standard 3.2.0 → 3.3.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 -3
- package/dist/index.js +11 -12
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -7,13 +7,20 @@
|
|
|
7
7
|
|
|
8
8
|
Coding standard used by Shlink JavaScript projects.
|
|
9
9
|
|
|
10
|
-
This library includes two ESLint configurations, the base one, and the react-specific one
|
|
10
|
+
This library includes two ESLint configurations, the base one (which includes eslint and typescript recommended rules), and the react-specific one (which includes JSX accessibility, react and react hooks recommended rules).
|
|
11
|
+
|
|
12
|
+
Default export includes both:
|
|
11
13
|
|
|
12
14
|
```js
|
|
13
15
|
// eslint.config.js
|
|
14
16
|
import shlink from '@shlinkio/eslint-config-js-coding-standard';
|
|
15
17
|
|
|
16
|
-
export default
|
|
18
|
+
export default [
|
|
19
|
+
...shlink,
|
|
20
|
+
{
|
|
21
|
+
// Other rules...
|
|
22
|
+
}
|
|
23
|
+
];
|
|
17
24
|
```
|
|
18
25
|
|
|
19
26
|
If the project does not use React, you can just use the base config:
|
|
@@ -22,5 +29,10 @@ If the project does not use React, you can just use the base config:
|
|
|
22
29
|
// eslint.config.js
|
|
23
30
|
import { baseConfig } from '@shlinkio/eslint-config-js-coding-standard';
|
|
24
31
|
|
|
25
|
-
export default
|
|
32
|
+
export default [
|
|
33
|
+
...baseConfig,
|
|
34
|
+
{
|
|
35
|
+
// Other rules...
|
|
36
|
+
}
|
|
37
|
+
];
|
|
26
38
|
```
|
package/dist/index.js
CHANGED
|
@@ -7,11 +7,9 @@ import simpleImportSort from 'eslint-plugin-simple-import-sort';
|
|
|
7
7
|
import tseslint from 'typescript-eslint';
|
|
8
8
|
|
|
9
9
|
export const baseConfig = tseslint.config(
|
|
10
|
+
eslint.configs.recommended,
|
|
11
|
+
...tseslint.configs.recommended,
|
|
10
12
|
{
|
|
11
|
-
extends: [
|
|
12
|
-
eslint.configs.recommended,
|
|
13
|
-
...tseslint.configs.recommended,
|
|
14
|
-
],
|
|
15
13
|
plugins: {
|
|
16
14
|
'@stylistic': stylistic,
|
|
17
15
|
'simple-import-sort': simpleImportSort,
|
|
@@ -73,11 +71,12 @@ export const baseConfig = tseslint.config(
|
|
|
73
71
|
},
|
|
74
72
|
);
|
|
75
73
|
|
|
76
|
-
export const reactConfig =
|
|
74
|
+
export const reactConfig = [
|
|
75
|
+
react.configs.flat.recommended,
|
|
76
|
+
react.configs.flat['jsx-runtime'],
|
|
77
|
+
pluginJsxA11y.flatConfigs.recommended,
|
|
77
78
|
{
|
|
78
79
|
plugins: {
|
|
79
|
-
'jsx-a11y': pluginJsxA11y,
|
|
80
|
-
react,
|
|
81
80
|
'react-hooks': eslintPluginReactHooks,
|
|
82
81
|
},
|
|
83
82
|
languageOptions: {
|
|
@@ -93,8 +92,8 @@ export const reactConfig = tseslint.config(
|
|
|
93
92
|
}
|
|
94
93
|
},
|
|
95
94
|
rules: {
|
|
96
|
-
|
|
97
|
-
|
|
95
|
+
'react-hooks/rules-of-hooks': 'error',
|
|
96
|
+
'react-hooks/exhaustive-deps': 'error',
|
|
98
97
|
|
|
99
98
|
// Disabled rules from presets
|
|
100
99
|
'react/display-name': ['off', { 'ignoreTranspilerName': false }],
|
|
@@ -107,9 +106,9 @@ export const reactConfig = tseslint.config(
|
|
|
107
106
|
'react/no-children-prop': 'off',
|
|
108
107
|
},
|
|
109
108
|
},
|
|
110
|
-
|
|
109
|
+
];
|
|
111
110
|
|
|
112
|
-
export default
|
|
111
|
+
export default [
|
|
113
112
|
...baseConfig,
|
|
114
113
|
...reactConfig,
|
|
115
|
-
|
|
114
|
+
];
|
package/package.json
CHANGED
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"build": "mkdir -p dist && rm -rf dist/* && cp index.js dist"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
|
-
"@stylistic/eslint-plugin": "^
|
|
26
|
+
"@stylistic/eslint-plugin": "^3.0.1",
|
|
27
27
|
"eslint": "^9.10.0 || ^8.57.0",
|
|
28
28
|
"eslint-plugin-jsx-a11y": "^6.8.0",
|
|
29
29
|
"eslint-plugin-react": "^7.34.2",
|
|
@@ -32,10 +32,10 @@
|
|
|
32
32
|
"typescript-eslint": "^8.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"typescript": "^5.
|
|
35
|
+
"typescript": "^5.7.3"
|
|
36
36
|
},
|
|
37
37
|
"files": [
|
|
38
38
|
"dist"
|
|
39
39
|
],
|
|
40
|
-
"version": "3.
|
|
40
|
+
"version": "3.3.0"
|
|
41
41
|
}
|