@leancodepl/eslint-config 7.8.2 → 8.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/CHANGELOG.md +18 -0
- package/package.json +11 -10
- package/src/index.js +11 -0
- package/src/lib/a11y.js +3 -0
- package/src/lib/base-react.js +42 -0
- package/src/lib/base.js +49 -0
- package/src/lib/imports.js +77 -0
- package/src/index.json +0 -3
- package/src/lib/a11y.json +0 -3
- package/src/lib/imports.json +0 -71
- package/src/lib/index.json +0 -102
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,24 @@
|
|
|
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
|
+
# [8.1.0](https://github.com/leancodepl/js_corelibrary/compare/v8.0.0...v8.1.0) (2024-10-17)
|
|
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
|
+
|
|
15
|
+
# [8.0.0](https://github.com/leancodepl/js_corelibrary/compare/v7.8.2...v8.0.0) (2024-10-10)
|
|
16
|
+
|
|
17
|
+
**Note:** Version bump only for package @leancodepl/eslint-config
|
|
18
|
+
|
|
19
|
+
# Change Log
|
|
20
|
+
|
|
21
|
+
All notable changes to this project will be documented in this file. See
|
|
22
|
+
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
23
|
+
|
|
6
24
|
## [7.8.2](https://github.com/leancodepl/js_corelibrary/compare/v7.8.1...v7.8.2) (2024-09-19)
|
|
7
25
|
|
|
8
26
|
**Note:** Version bump only for package @leancodepl/eslint-config
|
package/package.json
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leancodepl/eslint-config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.1.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
|
-
"main": "src/index.
|
|
5
|
+
"main": "src/index.js",
|
|
6
|
+
"dependencies": {
|
|
7
|
+
"eslint-plugin-import": ">=2.31.0",
|
|
8
|
+
"eslint-plugin-jsx-a11y": ">=6.10.0",
|
|
9
|
+
"eslint-plugin-perfectionist": ">=3.0.0",
|
|
10
|
+
"eslint-plugin-react-hooks": "5.1.0-rc-3edc000d-20240926",
|
|
11
|
+
"eslint-plugin-unused-imports": ">=4.1.0",
|
|
12
|
+
"globals": ">=15.0.0"
|
|
13
|
+
},
|
|
6
14
|
"peerDependencies": {
|
|
7
|
-
"@typescript-eslint/eslint-plugin": ">=7.7.0",
|
|
8
|
-
"@typescript-eslint/parser": ">=7.7.0",
|
|
9
15
|
"eslint": ">=8.9.0",
|
|
10
16
|
"eslint-config-prettier": ">=9.1.0",
|
|
11
|
-
"eslint-plugin-import": ">=2.29.1",
|
|
12
|
-
"eslint-plugin-jsx-a11y": ">=6.8.0",
|
|
13
|
-
"eslint-plugin-perfectionist": "^2.9.0",
|
|
14
17
|
"eslint-plugin-react": ">=7.34.1",
|
|
15
|
-
"eslint-plugin-react-hooks": ">=4.6.0",
|
|
16
|
-
"eslint-plugin-unused-imports": "^3.0.0",
|
|
17
18
|
"prettier": ">=3.0.0",
|
|
18
|
-
"typescript": ">=
|
|
19
|
+
"typescript-eslint": ">=7.0.0"
|
|
19
20
|
}
|
|
20
21
|
}
|
package/src/index.js
ADDED
package/src/lib/a11y.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
const react = require("eslint-plugin-react")
|
|
2
|
+
const reactHooks = require("eslint-plugin-react-hooks")
|
|
3
|
+
const globals = require("globals")
|
|
4
|
+
|
|
5
|
+
module.exports = [
|
|
6
|
+
{
|
|
7
|
+
plugins: {
|
|
8
|
+
react,
|
|
9
|
+
"react-hooks": reactHooks,
|
|
10
|
+
},
|
|
11
|
+
languageOptions: {
|
|
12
|
+
parserOptions: {
|
|
13
|
+
ecmaFeatures: {
|
|
14
|
+
jsx: true,
|
|
15
|
+
},
|
|
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-sort-props": [
|
|
26
|
+
"warn",
|
|
27
|
+
{
|
|
28
|
+
callbacksLast: true,
|
|
29
|
+
shorthandFirst: true,
|
|
30
|
+
shorthandLast: false,
|
|
31
|
+
ignoreCase: true,
|
|
32
|
+
noSortAlphabetically: false,
|
|
33
|
+
reservedFirst: true,
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
"react/self-closing-comp": "error",
|
|
37
|
+
|
|
38
|
+
"react-hooks/exhaustive-deps": "error",
|
|
39
|
+
"react-hooks/rules-of-hooks": "error",
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
]
|
package/src/lib/base.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
const perfectionist = require("eslint-plugin-perfectionist")
|
|
2
|
+
|
|
3
|
+
module.exports = [
|
|
4
|
+
{
|
|
5
|
+
plugins: {
|
|
6
|
+
perfectionist,
|
|
7
|
+
},
|
|
8
|
+
rules: {
|
|
9
|
+
"max-params": ["error", { max: 4 }],
|
|
10
|
+
"no-console": ["warn", { allow: ["warn", "error", "assert"] }],
|
|
11
|
+
"no-eval": "error",
|
|
12
|
+
"no-useless-rename": "error",
|
|
13
|
+
|
|
14
|
+
"@typescript-eslint/no-empty-function": "off",
|
|
15
|
+
"@typescript-eslint/no-empty-object-type": "off",
|
|
16
|
+
"@typescript-eslint/no-explicit-any": "off",
|
|
17
|
+
|
|
18
|
+
"perfectionist/sort-array-includes": [
|
|
19
|
+
"error",
|
|
20
|
+
{
|
|
21
|
+
type: "natural",
|
|
22
|
+
order: "asc",
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
"perfectionist/sort-intersection-types": [
|
|
26
|
+
"error",
|
|
27
|
+
{
|
|
28
|
+
type: "natural",
|
|
29
|
+
order: "asc",
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
"perfectionist/sort-named-exports": [
|
|
33
|
+
"error",
|
|
34
|
+
{
|
|
35
|
+
type: "natural",
|
|
36
|
+
order: "asc",
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
"perfectionist/sort-union-types": [
|
|
40
|
+
"error",
|
|
41
|
+
{
|
|
42
|
+
type: "natural",
|
|
43
|
+
order: "asc",
|
|
44
|
+
groups: ["unknown", "nullish"],
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
]
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
const imports = require("eslint-plugin-import")
|
|
2
|
+
const perfectionist = require("eslint-plugin-perfectionist")
|
|
3
|
+
const unusedImports = require("eslint-plugin-unused-imports")
|
|
4
|
+
|
|
5
|
+
module.exports = [
|
|
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",
|
|
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
|
+
],
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
]
|
package/src/index.json
DELETED
package/src/lib/a11y.json
DELETED
package/src/lib/imports.json
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": ["plugin:import/typescript", "prettier"],
|
|
3
|
-
"plugins": ["import", "unused-imports"],
|
|
4
|
-
"rules": {
|
|
5
|
-
"@typescript-eslint/no-unused-vars": "off",
|
|
6
|
-
"import/first": "error",
|
|
7
|
-
"import/newline-after-import": "error",
|
|
8
|
-
"import/no-anonymous-default-export": "error",
|
|
9
|
-
"import/no-duplicates": "error",
|
|
10
|
-
"import/no-extraneous-dependencies": "error",
|
|
11
|
-
"import/no-named-default": "error",
|
|
12
|
-
"import/no-self-import": "error",
|
|
13
|
-
"import/no-useless-path-segments": [
|
|
14
|
-
"error",
|
|
15
|
-
{
|
|
16
|
-
"noUselessIndex": true
|
|
17
|
-
}
|
|
18
|
-
],
|
|
19
|
-
"perfectionist/sort-imports": [
|
|
20
|
-
"error",
|
|
21
|
-
{
|
|
22
|
-
"type": "natural",
|
|
23
|
-
"order": "asc",
|
|
24
|
-
"groups": [
|
|
25
|
-
"client-server-only",
|
|
26
|
-
"react",
|
|
27
|
-
["builtin", "external"],
|
|
28
|
-
["internal-type", "internal"],
|
|
29
|
-
["parent", "sibling", "index"],
|
|
30
|
-
["type", "parent-type", "sibling-type", "index-type"],
|
|
31
|
-
"side-effect",
|
|
32
|
-
"style",
|
|
33
|
-
"unknown"
|
|
34
|
-
],
|
|
35
|
-
"custom-groups": {
|
|
36
|
-
"value": {
|
|
37
|
-
"react": ["react", "react-*"],
|
|
38
|
-
"client-server-only": ["client-only", "server-only"]
|
|
39
|
-
},
|
|
40
|
-
"type": {
|
|
41
|
-
"react": "react"
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
"newlines-between": "never",
|
|
45
|
-
"internal-pattern": ["@leancodepl/**"]
|
|
46
|
-
}
|
|
47
|
-
],
|
|
48
|
-
"perfectionist/sort-named-imports": [
|
|
49
|
-
"error",
|
|
50
|
-
{
|
|
51
|
-
"type": "natural",
|
|
52
|
-
"order": "asc"
|
|
53
|
-
}
|
|
54
|
-
],
|
|
55
|
-
"react/jsx-uses-react": "off",
|
|
56
|
-
"react/jsx-uses-vars": "error",
|
|
57
|
-
"unused-imports/no-unused-imports": "warn",
|
|
58
|
-
"unused-imports/no-unused-vars": [
|
|
59
|
-
"warn",
|
|
60
|
-
{
|
|
61
|
-
"vars": "all",
|
|
62
|
-
"varsIgnorePattern": "^_",
|
|
63
|
-
"args": "after-used",
|
|
64
|
-
"argsIgnorePattern": "^_"
|
|
65
|
-
}
|
|
66
|
-
]
|
|
67
|
-
},
|
|
68
|
-
"settings": {
|
|
69
|
-
"import/internal-regex": "^react$"
|
|
70
|
-
}
|
|
71
|
-
}
|
package/src/lib/index.json
DELETED
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"parser": "@typescript-eslint/parser",
|
|
3
|
-
"plugins": ["@typescript-eslint", "react", "react-hooks", "perfectionist"],
|
|
4
|
-
"extends": [
|
|
5
|
-
"eslint:recommended",
|
|
6
|
-
"plugin:@typescript-eslint/eslint-recommended",
|
|
7
|
-
"plugin:@typescript-eslint/recommended",
|
|
8
|
-
"plugin:react/recommended",
|
|
9
|
-
"prettier"
|
|
10
|
-
],
|
|
11
|
-
"rules": {
|
|
12
|
-
"arrow-body-style": "error",
|
|
13
|
-
"max-params": [
|
|
14
|
-
"error",
|
|
15
|
-
{
|
|
16
|
-
"max": 4
|
|
17
|
-
}
|
|
18
|
-
],
|
|
19
|
-
"no-console": [
|
|
20
|
-
"warn",
|
|
21
|
-
{
|
|
22
|
-
"allow": ["warn", "error", "assert"]
|
|
23
|
-
}
|
|
24
|
-
],
|
|
25
|
-
"no-useless-rename": "error",
|
|
26
|
-
"no-var": "off",
|
|
27
|
-
|
|
28
|
-
"@typescript-eslint/ban-types": "off",
|
|
29
|
-
"@typescript-eslint/explicit-function-return-type": "off",
|
|
30
|
-
"@typescript-eslint/explicit-member-accessibility": "off",
|
|
31
|
-
"@typescript-eslint/explicit-module-boundary-types": "off",
|
|
32
|
-
"@typescript-eslint/no-empty-function": "off",
|
|
33
|
-
"@typescript-eslint/no-empty-interface": "off",
|
|
34
|
-
"@typescript-eslint/no-explicit-any": "off",
|
|
35
|
-
"@typescript-eslint/no-inferrable-types": "off",
|
|
36
|
-
"@typescript-eslint/no-parameter-properties": "off",
|
|
37
|
-
"@typescript-eslint/no-use-before-define": "off",
|
|
38
|
-
"@typescript-eslint/no-var-requires": "off",
|
|
39
|
-
"@typescript-eslint/prefer-interface": "off",
|
|
40
|
-
|
|
41
|
-
"react/display-name": "off",
|
|
42
|
-
"react/jsx-boolean-value": "error",
|
|
43
|
-
"react/jsx-curly-brace-presence": "warn",
|
|
44
|
-
"react/jsx-fragments": "warn",
|
|
45
|
-
"react/jsx-sort-props": [
|
|
46
|
-
"warn",
|
|
47
|
-
{
|
|
48
|
-
"callbacksLast": true,
|
|
49
|
-
"shorthandFirst": true,
|
|
50
|
-
"shorthandLast": false,
|
|
51
|
-
"ignoreCase": true,
|
|
52
|
-
"noSortAlphabetically": false,
|
|
53
|
-
"reservedFirst": true
|
|
54
|
-
}
|
|
55
|
-
],
|
|
56
|
-
"react/prop-types": "off",
|
|
57
|
-
"react/react-in-jsx-scope": "off",
|
|
58
|
-
"react/self-closing-comp": "error",
|
|
59
|
-
"react-hooks/exhaustive-deps": "error",
|
|
60
|
-
"react-hooks/rules-of-hooks": "error",
|
|
61
|
-
|
|
62
|
-
"perfectionist/sort-array-includes": [
|
|
63
|
-
"error",
|
|
64
|
-
{
|
|
65
|
-
"type": "natural",
|
|
66
|
-
"order": "asc",
|
|
67
|
-
"spread-last": true
|
|
68
|
-
}
|
|
69
|
-
],
|
|
70
|
-
"perfectionist/sort-intersection-types": [
|
|
71
|
-
"error",
|
|
72
|
-
{
|
|
73
|
-
"type": "natural",
|
|
74
|
-
"order": "asc"
|
|
75
|
-
}
|
|
76
|
-
],
|
|
77
|
-
"perfectionist/sort-named-exports": [
|
|
78
|
-
"error",
|
|
79
|
-
{
|
|
80
|
-
"type": "natural",
|
|
81
|
-
"order": "asc"
|
|
82
|
-
}
|
|
83
|
-
],
|
|
84
|
-
"perfectionist/sort-union-types": [
|
|
85
|
-
"error",
|
|
86
|
-
{
|
|
87
|
-
"type": "natural",
|
|
88
|
-
"order": "asc",
|
|
89
|
-
"nullable-last": true
|
|
90
|
-
}
|
|
91
|
-
]
|
|
92
|
-
},
|
|
93
|
-
"settings": {
|
|
94
|
-
"import/internal-regex": "^react$",
|
|
95
|
-
"react": {
|
|
96
|
-
"version": "detect"
|
|
97
|
-
}
|
|
98
|
-
},
|
|
99
|
-
"env": {
|
|
100
|
-
"browser": true
|
|
101
|
-
}
|
|
102
|
-
}
|