@thermarthae/eslint-config 4.0.1 → 4.1.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/index.cjs +25 -27
- package/package.json +10 -12
- package/shared.cjs +2 -3
package/index.cjs
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
const stylistic = require('@stylistic/eslint-plugin');
|
|
2
|
+
|
|
3
|
+
const customized = stylistic.configs.customize({
|
|
4
|
+
indent: 'tab',
|
|
5
|
+
semi: true,
|
|
6
|
+
jsx: true,
|
|
7
|
+
braceStyle: '1tbs',
|
|
8
|
+
quoteProps: 'as-needed',
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
const jsxStylisticRules = Object.fromEntries(Object.entries(customized.rules ?? {})
|
|
12
|
+
.filter(r => r[0].startsWith('@stylistic/jsx')));
|
|
13
|
+
|
|
1
14
|
module.exports = {
|
|
2
15
|
extends: [
|
|
3
16
|
'./shared.cjs',
|
|
@@ -5,6 +18,7 @@ module.exports = {
|
|
|
5
18
|
'plugin:react/jsx-runtime',
|
|
6
19
|
'plugin:react-hooks/recommended',
|
|
7
20
|
'plugin:jsx-a11y/recommended',
|
|
21
|
+
'plugin:@stylistic/disable-legacy',
|
|
8
22
|
],
|
|
9
23
|
plugins: ['jsx-a11y'],
|
|
10
24
|
settings: {
|
|
@@ -13,43 +27,27 @@ module.exports = {
|
|
|
13
27
|
},
|
|
14
28
|
},
|
|
15
29
|
rules: {
|
|
16
|
-
|
|
17
|
-
'
|
|
30
|
+
...jsxStylisticRules,
|
|
31
|
+
'@stylistic/jsx-closing-bracket-location': ['error', 'line-aligned'],
|
|
32
|
+
'@stylistic/jsx-curly-brace-presence': ['error', {
|
|
33
|
+
props: 'never',
|
|
34
|
+
children: 'never',
|
|
35
|
+
propElementValues: 'always',
|
|
36
|
+
}],
|
|
37
|
+
'@stylistic/jsx-curly-spacing': ['error', 'never', { allowMultiline: true }],
|
|
38
|
+
'@stylistic/jsx-self-closing-comp': 'error',
|
|
39
|
+
'@stylistic/jsx-props-no-multi-spaces': 'error',
|
|
40
|
+
//
|
|
18
41
|
'react/no-unknown-property': 0,
|
|
19
42
|
'react/no-children-prop': 0,
|
|
20
43
|
'react/prop-types': 0,
|
|
21
44
|
'react/jsx-boolean-value': ['error', 'never', { always: [] }],
|
|
22
|
-
'react/jsx-closing-bracket-location': ['error', 'line-aligned'],
|
|
23
|
-
'react/jsx-closing-tag-location': 'error',
|
|
24
|
-
'react/jsx-curly-spacing': ['error', 'never', { allowMultiline: true }],
|
|
25
|
-
'react/jsx-max-props-per-line': ['error', { maximum: 1, when: 'multiline' }],
|
|
26
|
-
'react/self-closing-comp': 'error',
|
|
27
|
-
'react/jsx-wrap-multilines': ['error', {
|
|
28
|
-
declaration: 'parens-new-line',
|
|
29
|
-
assignment: 'parens-new-line',
|
|
30
|
-
return: 'parens-new-line',
|
|
31
|
-
arrow: 'parens-new-line',
|
|
32
|
-
condition: 'parens-new-line',
|
|
33
|
-
logical: 'parens-new-line',
|
|
34
|
-
prop: 'parens-new-line',
|
|
35
|
-
}],
|
|
36
|
-
'react/jsx-first-prop-new-line': 'error',
|
|
37
|
-
'react/jsx-tag-spacing': ['error', {
|
|
38
|
-
closingSlash: 'never',
|
|
39
|
-
beforeSelfClosing: 'always',
|
|
40
|
-
afterOpening: 'never',
|
|
41
|
-
beforeClosing: 'never',
|
|
42
|
-
}],
|
|
43
45
|
'react/void-dom-elements-no-children': 'error',
|
|
44
|
-
'react/jsx-curly-brace-presence': ['error', { props: 'never', children: 'never', propElementValues: 'always' }],
|
|
45
|
-
'react/jsx-one-expression-per-line': ['error', { allow: 'single-child' }],
|
|
46
46
|
'react/button-has-type': ['error', {
|
|
47
47
|
button: true,
|
|
48
48
|
submit: true,
|
|
49
49
|
reset: false,
|
|
50
50
|
}],
|
|
51
|
-
'react/jsx-props-no-multi-spaces': 'error',
|
|
52
|
-
'react/jsx-curly-newline': 'error',
|
|
53
51
|
'react/jsx-no-useless-fragment': 'error',
|
|
54
52
|
'react/jsx-no-constructed-context-values': 'error',
|
|
55
53
|
'react/no-unstable-nested-components': 'error',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thermarthae/eslint-config",
|
|
3
|
-
"version": "4.0
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"main": "index.cjs",
|
|
5
5
|
"description": "Just a personal eslint config",
|
|
6
6
|
"license": "MIT",
|
|
@@ -14,29 +14,27 @@
|
|
|
14
14
|
"index.cjs",
|
|
15
15
|
"shared.cjs"
|
|
16
16
|
],
|
|
17
|
-
"packageManager": "yarn@4.1
|
|
17
|
+
"packageManager": "yarn@4.3.1",
|
|
18
18
|
"scripts": {
|
|
19
19
|
"pnpify": "yarn dlx @yarnpkg/sdks vscode"
|
|
20
20
|
},
|
|
21
21
|
"resolutions": {
|
|
22
|
-
"@stylistic/eslint-plugin-plus/@typescript-eslint/utils": "^7.
|
|
23
|
-
"@stylistic/eslint-plugin-ts/@typescript-eslint/utils": "^7.
|
|
22
|
+
"@stylistic/eslint-plugin-plus/@typescript-eslint/utils": "^7.15.0",
|
|
23
|
+
"@stylistic/eslint-plugin-ts/@typescript-eslint/utils": "^7.15.0"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@stylistic/eslint-plugin": "^
|
|
27
|
-
"@typescript-eslint/eslint-plugin": "^7.
|
|
28
|
-
"@typescript-eslint/parser": "^7.
|
|
26
|
+
"@stylistic/eslint-plugin": "^2.3.0",
|
|
27
|
+
"@typescript-eslint/eslint-plugin": "^7.15.0",
|
|
28
|
+
"@typescript-eslint/parser": "^7.15.0",
|
|
29
29
|
"eslint": "^8.57.0",
|
|
30
|
-
"eslint-import-resolver-typescript": "^3.6.1",
|
|
31
30
|
"eslint-plugin-import": "npm:eslint-plugin-i@^2.29.1",
|
|
32
|
-
"eslint-plugin-simple-import-sort": "^12.
|
|
33
|
-
"typescript": "^5.
|
|
31
|
+
"eslint-plugin-simple-import-sort": "^12.1.0",
|
|
32
|
+
"typescript": "^5.5.3"
|
|
34
33
|
},
|
|
35
34
|
"peerDependencies": {
|
|
36
|
-
"@stylistic/eslint-plugin": "^1.6.2",
|
|
35
|
+
"@stylistic/eslint-plugin": "^1.6.2 || ^2.0.0",
|
|
37
36
|
"@typescript-eslint/parser": "^6.20.0 || ^7.1.0",
|
|
38
37
|
"eslint": "^8.56.0",
|
|
39
|
-
"eslint-import-resolver-typescript": "^3.6.1",
|
|
40
38
|
"eslint-plugin-import": "^2.29.1",
|
|
41
39
|
"eslint-plugin-jsx-a11y": "^6.8.0",
|
|
42
40
|
"eslint-plugin-react": "^7.33.2",
|
package/shared.cjs
CHANGED
|
@@ -30,9 +30,6 @@ module.exports = {
|
|
|
30
30
|
},
|
|
31
31
|
settings: {
|
|
32
32
|
'import/external-module-folders': ['.yarn', 'node_modules', 'node_modules/@types'],
|
|
33
|
-
'import/resolver': {
|
|
34
|
-
typescript: true,
|
|
35
|
-
},
|
|
36
33
|
},
|
|
37
34
|
overrides: [
|
|
38
35
|
{
|
|
@@ -84,6 +81,7 @@ module.exports = {
|
|
|
84
81
|
'@typescript-eslint/no-shadow': 'error',
|
|
85
82
|
'@typescript-eslint/promise-function-async': 'error',
|
|
86
83
|
//
|
|
84
|
+
'import/no-unresolved': 0,
|
|
87
85
|
// TODO: https://github.com/import-js/eslint-plugin-import/pull/2813
|
|
88
86
|
// 'import/extensions': ['error', 'always', { ignorePackages: true }],
|
|
89
87
|
//
|
|
@@ -114,6 +112,7 @@ module.exports = {
|
|
|
114
112
|
],
|
|
115
113
|
}],
|
|
116
114
|
//
|
|
115
|
+
'object-shorthand': ['error', 'always', { avoidQuotes: true }],
|
|
117
116
|
'no-param-reassign': ['error', {
|
|
118
117
|
ignorePropertyModificationsFor: [
|
|
119
118
|
'request',
|