@leancodepl/eslint-config 9.6.5 → 9.6.6
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/CHANGELOG.md +9 -0
- package/package.json +1 -1
- package/src/lib/base-react.js +33 -33
- package/src/lib/base.js +51 -51
- package/src/lib/imports.js +68 -68
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,15 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See
|
|
4
4
|
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [9.6.6](https://github.com/leancodepl/js_corelibrary/compare/v9.6.5...v9.6.6) (2025-11-18)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @leancodepl/eslint-config
|
|
9
|
+
|
|
10
|
+
# Change Log
|
|
11
|
+
|
|
12
|
+
All notable changes to this project will be documented in this file. See
|
|
13
|
+
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
14
|
+
|
|
6
15
|
## [9.6.5](https://github.com/leancodepl/js_corelibrary/compare/v9.6.4...v9.6.5) (2025-10-16)
|
|
7
16
|
|
|
8
17
|
**Note:** Version bump only for package @leancodepl/eslint-config
|
package/package.json
CHANGED
package/src/lib/base-react.js
CHANGED
|
@@ -3,41 +3,41 @@ const reactHooks = require("eslint-plugin-react-hooks")
|
|
|
3
3
|
const globals = require("globals")
|
|
4
4
|
|
|
5
5
|
module.exports = [
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
{
|
|
7
|
+
plugins: {
|
|
8
|
+
react,
|
|
9
|
+
"react-hooks": reactHooks,
|
|
10
|
+
},
|
|
11
|
+
languageOptions: {
|
|
12
|
+
parserOptions: {
|
|
13
|
+
ecmaFeatures: {
|
|
14
|
+
jsx: true,
|
|
10
15
|
},
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
},
|
|
17
|
+
globals: {
|
|
18
|
+
...globals.browser,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
rules: {
|
|
22
|
+
"react/jsx-boolean-value": "error",
|
|
23
|
+
"react/jsx-curly-brace-presence": "warn",
|
|
24
|
+
"react/jsx-fragments": "warn",
|
|
25
|
+
"react/jsx-no-useless-fragment": ["error", { allowExpressions: true }],
|
|
26
|
+
"react/jsx-sort-props": [
|
|
27
|
+
"warn",
|
|
28
|
+
{
|
|
29
|
+
callbacksLast: true,
|
|
30
|
+
shorthandFirst: true,
|
|
31
|
+
shorthandLast: false,
|
|
32
|
+
ignoreCase: true,
|
|
33
|
+
noSortAlphabetically: false,
|
|
34
|
+
reservedFirst: true,
|
|
20
35
|
},
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
"react/jsx-curly-brace-presence": "warn",
|
|
24
|
-
"react/jsx-fragments": "warn",
|
|
25
|
-
"react/jsx-no-useless-fragment": ["error", { allowExpressions: true }],
|
|
26
|
-
"react/jsx-sort-props": [
|
|
27
|
-
"warn",
|
|
28
|
-
{
|
|
29
|
-
callbacksLast: true,
|
|
30
|
-
shorthandFirst: true,
|
|
31
|
-
shorthandLast: false,
|
|
32
|
-
ignoreCase: true,
|
|
33
|
-
noSortAlphabetically: false,
|
|
34
|
-
reservedFirst: true,
|
|
35
|
-
},
|
|
36
|
-
],
|
|
37
|
-
"react/self-closing-comp": "error",
|
|
36
|
+
],
|
|
37
|
+
"react/self-closing-comp": "error",
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
},
|
|
39
|
+
"react-hooks/exhaustive-deps": "error",
|
|
40
|
+
"react-hooks/rules-of-hooks": "error",
|
|
42
41
|
},
|
|
42
|
+
},
|
|
43
43
|
]
|
package/src/lib/base.js
CHANGED
|
@@ -1,58 +1,58 @@
|
|
|
1
1
|
const perfectionist = require("eslint-plugin-perfectionist")
|
|
2
2
|
|
|
3
3
|
module.exports = [
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
4
|
+
{
|
|
5
|
+
plugins: {
|
|
6
|
+
perfectionist,
|
|
7
|
+
},
|
|
8
|
+
rules: {
|
|
9
|
+
curly: ["error", "multi-line", "consistent"],
|
|
10
|
+
"max-params": ["error", { max: 4 }],
|
|
11
|
+
"no-console": ["warn", { allow: ["warn", "error", "assert"] }],
|
|
12
|
+
"no-eval": "error",
|
|
13
|
+
"no-useless-rename": "error",
|
|
14
|
+
"arrow-body-style": ["error", "as-needed"],
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
},
|
|
55
|
-
],
|
|
16
|
+
"@typescript-eslint/no-empty-function": "off",
|
|
17
|
+
"@typescript-eslint/no-empty-object-type": "off",
|
|
18
|
+
"@typescript-eslint/no-explicit-any": "off",
|
|
19
|
+
"@typescript-eslint/naming-convention": [
|
|
20
|
+
"error",
|
|
21
|
+
{
|
|
22
|
+
selector: "variable",
|
|
23
|
+
format: ["camelCase", "PascalCase"],
|
|
24
|
+
leadingUnderscore: "allow",
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
"perfectionist/sort-array-includes": [
|
|
28
|
+
"error",
|
|
29
|
+
{
|
|
30
|
+
type: "natural",
|
|
31
|
+
order: "asc",
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
"perfectionist/sort-intersection-types": [
|
|
35
|
+
"error",
|
|
36
|
+
{
|
|
37
|
+
type: "natural",
|
|
38
|
+
order: "asc",
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
"perfectionist/sort-named-exports": [
|
|
42
|
+
"error",
|
|
43
|
+
{
|
|
44
|
+
type: "natural",
|
|
45
|
+
order: "asc",
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
"perfectionist/sort-union-types": [
|
|
49
|
+
"error",
|
|
50
|
+
{
|
|
51
|
+
type: "natural",
|
|
52
|
+
order: "asc",
|
|
53
|
+
groups: ["unknown", "nullish"],
|
|
56
54
|
},
|
|
55
|
+
],
|
|
57
56
|
},
|
|
57
|
+
},
|
|
58
58
|
]
|
package/src/lib/imports.js
CHANGED
|
@@ -3,75 +3,75 @@ const perfectionist = require("eslint-plugin-perfectionist")
|
|
|
3
3
|
const unusedImports = require("eslint-plugin-unused-imports")
|
|
4
4
|
|
|
5
5
|
module.exports = [
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
{
|
|
7
|
+
plugins: {
|
|
8
|
+
"unused-imports": unusedImports,
|
|
9
|
+
import: imports,
|
|
10
|
+
perfectionist,
|
|
11
|
+
},
|
|
12
|
+
rules: {
|
|
13
|
+
"@typescript-eslint/no-unused-vars": "off",
|
|
14
|
+
"import/first": "error",
|
|
15
|
+
"import/newline-after-import": "error",
|
|
16
|
+
"import/no-anonymous-default-export": "error",
|
|
17
|
+
"import/no-duplicates": "error",
|
|
18
|
+
"import/no-extraneous-dependencies": "error",
|
|
19
|
+
"import/no-named-default": "error",
|
|
20
|
+
"import/no-self-import": "error",
|
|
21
|
+
"import/no-useless-path-segments": [
|
|
22
|
+
"error",
|
|
23
|
+
{
|
|
24
|
+
noUselessIndex: true,
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
"perfectionist/sort-imports": [
|
|
28
|
+
"error",
|
|
29
|
+
{
|
|
30
|
+
type: "natural",
|
|
31
|
+
order: "asc",
|
|
32
|
+
groups: [
|
|
33
|
+
"client-server-only",
|
|
34
|
+
"react",
|
|
35
|
+
["builtin", "external"],
|
|
36
|
+
["internal-type", "internal"],
|
|
37
|
+
["parent", "sibling", "index"],
|
|
38
|
+
["type", "parent-type", "sibling-type", "index-type"],
|
|
39
|
+
"side-effect",
|
|
40
|
+
"style",
|
|
41
|
+
"unknown",
|
|
42
|
+
],
|
|
43
|
+
customGroups: {
|
|
44
|
+
value: {
|
|
45
|
+
react: ["^react$", "^react-.+"],
|
|
46
|
+
"client-server-only": ["^client-only$", "^server-only$"],
|
|
47
|
+
},
|
|
48
|
+
type: {
|
|
49
|
+
react: "^react$",
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
newlinesBetween: "never",
|
|
53
|
+
internalPattern: ["^@leancodepl/.+"],
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
"perfectionist/sort-named-imports": [
|
|
57
|
+
"error",
|
|
58
|
+
{
|
|
59
|
+
type: "natural",
|
|
60
|
+
order: "asc",
|
|
11
61
|
},
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
{
|
|
24
|
-
noUselessIndex: true,
|
|
25
|
-
},
|
|
26
|
-
],
|
|
27
|
-
"perfectionist/sort-imports": [
|
|
28
|
-
"error",
|
|
29
|
-
{
|
|
30
|
-
type: "natural",
|
|
31
|
-
order: "asc",
|
|
32
|
-
groups: [
|
|
33
|
-
"client-server-only",
|
|
34
|
-
"react",
|
|
35
|
-
["builtin", "external"],
|
|
36
|
-
["internal-type", "internal"],
|
|
37
|
-
["parent", "sibling", "index"],
|
|
38
|
-
["type", "parent-type", "sibling-type", "index-type"],
|
|
39
|
-
"side-effect",
|
|
40
|
-
"style",
|
|
41
|
-
"unknown",
|
|
42
|
-
],
|
|
43
|
-
customGroups: {
|
|
44
|
-
value: {
|
|
45
|
-
react: ["^react$", "^react-.+"],
|
|
46
|
-
"client-server-only": ["^client-only$", "^server-only$"],
|
|
47
|
-
},
|
|
48
|
-
type: {
|
|
49
|
-
react: "^react$",
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
newlinesBetween: "never",
|
|
53
|
-
internalPattern: ["^@leancodepl/.+"],
|
|
54
|
-
},
|
|
55
|
-
],
|
|
56
|
-
"perfectionist/sort-named-imports": [
|
|
57
|
-
"error",
|
|
58
|
-
{
|
|
59
|
-
type: "natural",
|
|
60
|
-
order: "asc",
|
|
61
|
-
},
|
|
62
|
-
],
|
|
63
|
-
"react/jsx-uses-react": "off",
|
|
64
|
-
"react/jsx-uses-vars": "error",
|
|
65
|
-
"unused-imports/no-unused-imports": "warn",
|
|
66
|
-
"unused-imports/no-unused-vars": [
|
|
67
|
-
"warn",
|
|
68
|
-
{
|
|
69
|
-
vars: "all",
|
|
70
|
-
varsIgnorePattern: "^_",
|
|
71
|
-
args: "after-used",
|
|
72
|
-
argsIgnorePattern: "^_",
|
|
73
|
-
},
|
|
74
|
-
],
|
|
62
|
+
],
|
|
63
|
+
"react/jsx-uses-react": "off",
|
|
64
|
+
"react/jsx-uses-vars": "error",
|
|
65
|
+
"unused-imports/no-unused-imports": "warn",
|
|
66
|
+
"unused-imports/no-unused-vars": [
|
|
67
|
+
"warn",
|
|
68
|
+
{
|
|
69
|
+
vars: "all",
|
|
70
|
+
varsIgnorePattern: "^_",
|
|
71
|
+
args: "after-used",
|
|
72
|
+
argsIgnorePattern: "^_",
|
|
75
73
|
},
|
|
74
|
+
],
|
|
76
75
|
},
|
|
76
|
+
},
|
|
77
77
|
]
|