@thermarthae/eslint-config 6.0.0 → 7.0.1
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 +3 -9
- package/base.d.ts +1 -1
- package/base.js +34 -11
- package/index.d.ts +1 -1
- package/index.js +2 -3
- package/package.json +14 -30
package/README.md
CHANGED
|
@@ -1,21 +1,15 @@
|
|
|
1
1
|
# @thermarthae/eslint-config
|
|
2
2
|
|
|
3
|
-
Just an
|
|
3
|
+
Just an ESLint config.
|
|
4
4
|
|
|
5
5
|
## ✨ Setup
|
|
6
6
|
|
|
7
7
|
### 1) Install
|
|
8
8
|
|
|
9
|
-
This step assumes that you have already installed
|
|
9
|
+
This step assumes that you have already installed ESLint and Typescript.
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
|
-
yarn add -D @thermarthae/eslint-config
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
If you don't need React support:
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
yarn add -D @thermarthae/eslint-config @eslint/js typescript-eslint eslint-plugin-simple-import-sort @stylistic/eslint-plugin
|
|
12
|
+
yarn add -D @thermarthae/eslint-config
|
|
19
13
|
```
|
|
20
14
|
|
|
21
15
|
### 2) Configure ESLint
|
package/base.d.ts
CHANGED
package/base.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import eslint from '@eslint/js';
|
|
2
2
|
import stylistic from '@stylistic/eslint-plugin';
|
|
3
3
|
import simpleImportSort from 'eslint-plugin-simple-import-sort';
|
|
4
|
-
import
|
|
4
|
+
import tsESLint from 'typescript-eslint';
|
|
5
5
|
|
|
6
6
|
const stylisticCustomized = stylistic.configs.customize({
|
|
7
7
|
indent: 'tab',
|
|
@@ -11,7 +11,7 @@ const stylisticCustomized = stylistic.configs.customize({
|
|
|
11
11
|
quoteProps: 'as-needed',
|
|
12
12
|
});
|
|
13
13
|
|
|
14
|
-
/** @type {
|
|
14
|
+
/** @type {import('eslint').Linter.Config[]} */
|
|
15
15
|
const base = [
|
|
16
16
|
//
|
|
17
17
|
// eslint
|
|
@@ -37,12 +37,8 @@ const base = [
|
|
|
37
37
|
//
|
|
38
38
|
// typescript-eslint
|
|
39
39
|
//
|
|
40
|
-
...
|
|
41
|
-
...
|
|
42
|
-
{
|
|
43
|
-
...tsEslint.configs.disableTypeChecked,
|
|
44
|
-
files: ['*.cjs', '*.js'],
|
|
45
|
-
},
|
|
40
|
+
...tsESLint.configs.strictTypeChecked,
|
|
41
|
+
...tsESLint.configs.stylisticTypeChecked,
|
|
46
42
|
{
|
|
47
43
|
languageOptions: {
|
|
48
44
|
parserOptions: {
|
|
@@ -55,20 +51,47 @@ const base = [
|
|
|
55
51
|
default: 'array-simple',
|
|
56
52
|
}],
|
|
57
53
|
'@typescript-eslint/consistent-type-assertions': ['error', {
|
|
58
|
-
assertionStyle: 'as',
|
|
59
54
|
objectLiteralTypeAssertions: 'allow-as-parameter',
|
|
60
55
|
}],
|
|
61
56
|
'@typescript-eslint/consistent-type-definitions': 0,
|
|
62
|
-
'@typescript-eslint/
|
|
57
|
+
'@typescript-eslint/consistent-type-imports': 'error',
|
|
58
|
+
'@typescript-eslint/no-confusing-void-expression': 0,
|
|
63
59
|
'@typescript-eslint/no-empty-function': 0,
|
|
60
|
+
'@typescript-eslint/no-extraneous-class': ['error', {
|
|
61
|
+
allowConstructorOnly: false,
|
|
62
|
+
allowEmpty: false,
|
|
63
|
+
allowStaticOnly: true,
|
|
64
|
+
allowWithDecorator: false,
|
|
65
|
+
}],
|
|
66
|
+
'@typescript-eslint/no-import-type-side-effects': 'error',
|
|
64
67
|
'@typescript-eslint/no-misused-promises': ['error', {
|
|
65
68
|
checksVoidReturn: false,
|
|
66
69
|
}],
|
|
67
|
-
'@typescript-eslint/no-
|
|
70
|
+
'@typescript-eslint/no-non-null-assertion': 0,
|
|
68
71
|
'@typescript-eslint/no-shadow': 'error',
|
|
72
|
+
'@typescript-eslint/no-unused-vars': 0,
|
|
69
73
|
'@typescript-eslint/promise-function-async': 'error',
|
|
74
|
+
'@typescript-eslint/restrict-plus-operands': ['error', {
|
|
75
|
+
allowAny: false,
|
|
76
|
+
allowBoolean: true,
|
|
77
|
+
allowNullish: true,
|
|
78
|
+
allowNumberAndString: true,
|
|
79
|
+
allowRegExp: false,
|
|
80
|
+
}],
|
|
81
|
+
'@typescript-eslint/restrict-template-expressions': ['error', {
|
|
82
|
+
allowAny: false,
|
|
83
|
+
allowBoolean: true,
|
|
84
|
+
allowNever: false,
|
|
85
|
+
allowNullish: true,
|
|
86
|
+
allowNumber: true,
|
|
87
|
+
allowRegExp: false,
|
|
88
|
+
}],
|
|
70
89
|
},
|
|
71
90
|
},
|
|
91
|
+
{
|
|
92
|
+
...tsESLint.configs.disableTypeChecked,
|
|
93
|
+
files: ['*.cjs', '*.js'],
|
|
94
|
+
},
|
|
72
95
|
//
|
|
73
96
|
// stylistic
|
|
74
97
|
//
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -17,7 +17,7 @@ const stylisticCustomizedWithJSX = stylistic.configs.customize({
|
|
|
17
17
|
const jsxStylisticRules = Object.fromEntries(Object.entries(stylisticCustomizedWithJSX.rules ?? {})
|
|
18
18
|
.filter(r => r[0].startsWith('@stylistic/jsx')));
|
|
19
19
|
|
|
20
|
-
/** @type {
|
|
20
|
+
/** @type {import('eslint').Linter.Config[]} */
|
|
21
21
|
const main = [
|
|
22
22
|
...base,
|
|
23
23
|
//
|
|
@@ -51,7 +51,7 @@ const main = [
|
|
|
51
51
|
//
|
|
52
52
|
// react-hooks
|
|
53
53
|
//
|
|
54
|
-
reactHooks.configs['recommended-latest'],
|
|
54
|
+
reactHooks.configs.flat['recommended-latest'],
|
|
55
55
|
//
|
|
56
56
|
// jsx-a11y
|
|
57
57
|
//
|
|
@@ -76,7 +76,6 @@ const main = [
|
|
|
76
76
|
}],
|
|
77
77
|
'@stylistic/jsx-curly-spacing': ['error', 'never', { allowMultiline: true }],
|
|
78
78
|
'@stylistic/jsx-self-closing-comp': 'error',
|
|
79
|
-
'@stylistic/jsx-props-no-multi-spaces': 'error',
|
|
80
79
|
},
|
|
81
80
|
},
|
|
82
81
|
];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thermarthae/eslint-config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.1",
|
|
4
4
|
"exports": {
|
|
5
5
|
".": {
|
|
6
6
|
"types": "./index.d.ts",
|
|
@@ -27,43 +27,27 @@
|
|
|
27
27
|
"index.js",
|
|
28
28
|
"index.d.ts"
|
|
29
29
|
],
|
|
30
|
-
"packageManager": "yarn@4.
|
|
30
|
+
"packageManager": "yarn@4.12.0+sha512.f45ab632439a67f8bc759bf32ead036a1f413287b9042726b7cc4818b7b49e14e9423ba49b18f9e06ea4941c1ad062385b1d8760a8d5091a1a31e5f6219afca8",
|
|
31
31
|
"scripts": {
|
|
32
32
|
"pnpify": "yarn dlx @yarnpkg/sdks vscode"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@eslint
|
|
36
|
-
"@
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"eslint": "^9.29.0",
|
|
40
|
-
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
41
|
-
"eslint-plugin-react": "^7.37.5",
|
|
42
|
-
"eslint-plugin-react-hooks": "^5.2.0",
|
|
43
|
-
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
44
|
-
"typescript": "^5.8.3",
|
|
45
|
-
"typescript-eslint": "^8.34.1"
|
|
35
|
+
"@types/eslint-plugin-jsx-a11y": "^6.10.1",
|
|
36
|
+
"@types/node": "^25.0.10",
|
|
37
|
+
"eslint": "^9.39.2",
|
|
38
|
+
"typescript": "^5.9.3"
|
|
46
39
|
},
|
|
47
40
|
"peerDependencies": {
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
|
|
41
|
+
"eslint": "^9.37.0",
|
|
42
|
+
"typescript": "^5.9.3"
|
|
43
|
+
},
|
|
44
|
+
"dependencies": {
|
|
45
|
+
"@eslint/js": "^9.39.2",
|
|
46
|
+
"@stylistic/eslint-plugin": "^5.7.1",
|
|
51
47
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
52
48
|
"eslint-plugin-react": "^7.37.5",
|
|
53
|
-
"eslint-plugin-react-hooks": "^
|
|
49
|
+
"eslint-plugin-react-hooks": "^7.0.1",
|
|
54
50
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
55
|
-
"typescript": "^
|
|
56
|
-
"typescript-eslint": "^8.34.1"
|
|
57
|
-
},
|
|
58
|
-
"peerDependenciesMeta": {
|
|
59
|
-
"eslint-plugin-jsx-a11y": {
|
|
60
|
-
"optional": true
|
|
61
|
-
},
|
|
62
|
-
"eslint-plugin-react": {
|
|
63
|
-
"optional": true
|
|
64
|
-
},
|
|
65
|
-
"eslint-plugin-react-hooks": {
|
|
66
|
-
"optional": true
|
|
67
|
-
}
|
|
51
|
+
"typescript-eslint": "^8.53.1"
|
|
68
52
|
}
|
|
69
53
|
}
|