@labeg/code-style 5.2.0 → 5.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/.eslintrc.js +136 -140
- package/package.json +9 -9
package/.eslintrc.js
CHANGED
|
@@ -1,140 +1,136 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
//
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"no-
|
|
14
|
-
"no-
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
], // More nice
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
], // More nice
|
|
55
|
-
"@stylistic/
|
|
56
|
-
"@stylistic/
|
|
57
|
-
"@stylistic/
|
|
58
|
-
"@stylistic/
|
|
59
|
-
"@stylistic/
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
},
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
"
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
"
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
"
|
|
117
|
-
|
|
118
|
-
"@typescript-eslint/no-
|
|
119
|
-
"@typescript-eslint/
|
|
120
|
-
"@typescript-eslint/
|
|
121
|
-
"@typescript-eslint/
|
|
122
|
-
"@typescript-eslint/no-
|
|
123
|
-
"@typescript-eslint/
|
|
124
|
-
|
|
125
|
-
"
|
|
126
|
-
"
|
|
127
|
-
"
|
|
128
|
-
|
|
129
|
-
"react/
|
|
130
|
-
"react/
|
|
131
|
-
"react/jsx-
|
|
132
|
-
"react/
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
]
|
|
140
|
-
};
|
|
1
|
+
/**
|
|
2
|
+
* Good instruction:
|
|
3
|
+
* https://duncanleung.com/eslint-mixed-javascript-typescript-files-codebase/
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
const jsAndTsRules = {
|
|
7
|
+
// Eslint rules
|
|
8
|
+
"sort-imports": "off", // Need found sorter
|
|
9
|
+
"sort-keys": "off", // More nice
|
|
10
|
+
"one-var": ["error", "never"], // More nice
|
|
11
|
+
"no-ternary": "off", // More nice
|
|
12
|
+
"no-void": "off", // Strange rule
|
|
13
|
+
"no-bitwise": "off", // Used in many projects
|
|
14
|
+
"no-inline-comments": "off", // Maybe later?
|
|
15
|
+
"line-comment-position": "off", // Maybe later?
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
// Eslint moved to Stylistic, but now to buggy for js. Remove after fix bugs in new versions Stylistic
|
|
19
|
+
"max-len": [
|
|
20
|
+
"error", {
|
|
21
|
+
code: 140,
|
|
22
|
+
comments: 140
|
|
23
|
+
}
|
|
24
|
+
], // More nice, for modern screens
|
|
25
|
+
"padded-blocks": [
|
|
26
|
+
"error", {
|
|
27
|
+
classes: "always",
|
|
28
|
+
blocks: "never",
|
|
29
|
+
switches: "never"
|
|
30
|
+
}
|
|
31
|
+
], // More nice
|
|
32
|
+
"function-call-argument-newline": ["error", "consistent"], // More nice
|
|
33
|
+
"quote-props": ["error", "as-needed"], // More nice
|
|
34
|
+
"multiline-ternary": ["error", "always-multiline"], // More nice
|
|
35
|
+
"array-element-newline": ["error", "consistent"], // More nice
|
|
36
|
+
"operator-linebreak": ["error", "after"], // More nice
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
// Stylistic rules
|
|
40
|
+
"@stylistic/max-len": [
|
|
41
|
+
"error", {
|
|
42
|
+
code: 140,
|
|
43
|
+
comments: 140
|
|
44
|
+
}
|
|
45
|
+
], // More nice, for modern screens
|
|
46
|
+
"@stylistic/padded-blocks": [
|
|
47
|
+
"error", {
|
|
48
|
+
classes: "always",
|
|
49
|
+
blocks: "never",
|
|
50
|
+
switches: "never"
|
|
51
|
+
}
|
|
52
|
+
], // More nice
|
|
53
|
+
"@stylistic/function-call-argument-newline": ["error", "consistent"], // More nice
|
|
54
|
+
"@stylistic/quote-props": ["error", "as-needed"], // More nice
|
|
55
|
+
"@stylistic/multiline-ternary": ["error", "always-multiline"], // More nice
|
|
56
|
+
"@stylistic/array-element-newline": ["error", "consistent"], // More nice
|
|
57
|
+
"@stylistic/operator-linebreak": ["error", "after"], // More nice
|
|
58
|
+
"@stylistic/no-extra-parens": "off",
|
|
59
|
+
"@stylistic/dot-location": ["error", "property"] // Maybe later?
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
module.exports = {
|
|
63
|
+
extends: [
|
|
64
|
+
"eslint:all" // There is no React because they are used strictly with Typescript.
|
|
65
|
+
// "plugin:@stylistic/all-extends" // Bug, begin incorrect formatting, check in new versions
|
|
66
|
+
],
|
|
67
|
+
plugins: ["@stylistic/migrate"],
|
|
68
|
+
root: true,
|
|
69
|
+
env: {
|
|
70
|
+
browser: true,
|
|
71
|
+
es2022: true,
|
|
72
|
+
node: true
|
|
73
|
+
},
|
|
74
|
+
ignorePatterns: ["node_modules/*"],
|
|
75
|
+
rules: {
|
|
76
|
+
...jsAndTsRules
|
|
77
|
+
},
|
|
78
|
+
overrides: [
|
|
79
|
+
{
|
|
80
|
+
files: ["**/*.{ts,tsx}"],
|
|
81
|
+
settings: {
|
|
82
|
+
react: {
|
|
83
|
+
version: "detect"
|
|
84
|
+
},
|
|
85
|
+
"import/parsers": {
|
|
86
|
+
"@typescript-eslint/parser": [".ts", ".tsx"]
|
|
87
|
+
},
|
|
88
|
+
"import/resolver": {
|
|
89
|
+
typescript: {
|
|
90
|
+
project: "tsconfig.json"
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
parser: "@typescript-eslint/parser",
|
|
95
|
+
parserOptions: {
|
|
96
|
+
project: "tsconfig.json",
|
|
97
|
+
sourceType: "module",
|
|
98
|
+
ecmaVersion: "latest",
|
|
99
|
+
ecmaFeatures: {
|
|
100
|
+
jsx: true
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
extends: [
|
|
104
|
+
"eslint:all",
|
|
105
|
+
"plugin:@stylistic/all-extends",
|
|
106
|
+
"plugin:@typescript-eslint/all",
|
|
107
|
+
"plugin:react/all",
|
|
108
|
+
"plugin:jsx-a11y/strict"
|
|
109
|
+
],
|
|
110
|
+
rules: {
|
|
111
|
+
...jsAndTsRules,
|
|
112
|
+
"no-duplicate-imports": "off", // Bug, conflict between TS import and import type
|
|
113
|
+
|
|
114
|
+
"@typescript-eslint/no-inferrable-types": "off", // Need for reflection
|
|
115
|
+
"@typescript-eslint/no-magic-numbers": "off",
|
|
116
|
+
"@typescript-eslint/prefer-readonly-parameter-types": "off", // Wrong immutable undestand
|
|
117
|
+
"@typescript-eslint/no-floating-promises": "off", // Block async promises
|
|
118
|
+
"@typescript-eslint/no-extra-parens": "off", // Conflict with react best practise in jsx
|
|
119
|
+
"@typescript-eslint/promise-function-async": "off", // More nice
|
|
120
|
+
"@typescript-eslint/no-misused-promises": ["error", {checksVoidReturn: false}], // More nice
|
|
121
|
+
"@typescript-eslint/naming-convention": "off", // Bad with react func components
|
|
122
|
+
"@typescript-eslint/no-confusing-void-expression": "off", // More nice
|
|
123
|
+
"@typescript-eslint/member-ordering": "off", // Need correct priority
|
|
124
|
+
|
|
125
|
+
"react/jsx-filename-extension": ["error", {extensions: [".tsx"]}], // Added typescript file extension
|
|
126
|
+
"react/jsx-no-literals": "off", // Broken rule, not work with ??
|
|
127
|
+
"react/jsx-max-depth": ["error", {max: 10}], // To small by default
|
|
128
|
+
"react/function-component-definition": ["error", {namedComponents: "arrow-function"}], // Same as eslint func-styles
|
|
129
|
+
"react/forbid-component-props": "off", // Conflict with styled-components
|
|
130
|
+
"react/require-default-props": "off", // Don't used in modern react
|
|
131
|
+
"react/jsx-uses-react": "off", // https://ru.reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html
|
|
132
|
+
"react/react-in-jsx-scope": "off" // https://ru.reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
]
|
|
136
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@labeg/code-style",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.3.0",
|
|
4
4
|
"author": "Eugene Labutin",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/LabEG/code-style#readme",
|
|
@@ -29,22 +29,22 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@eslint/js": "^9.17.0",
|
|
32
|
-
"@stylistic/eslint-plugin": "^2.
|
|
33
|
-
"@stylistic/eslint-plugin-migrate": "^2.
|
|
34
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
35
|
-
"@typescript-eslint/parser": "^8.
|
|
36
|
-
"eslint": "^9.
|
|
32
|
+
"@stylistic/eslint-plugin": "^2.12.1",
|
|
33
|
+
"@stylistic/eslint-plugin-migrate": "^2.12.1",
|
|
34
|
+
"@typescript-eslint/eslint-plugin": "^8.18.2",
|
|
35
|
+
"@typescript-eslint/parser": "^8.18.2",
|
|
36
|
+
"eslint": "^9.17.0",
|
|
37
37
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
38
|
-
"eslint-plugin-react": "^7.37.
|
|
38
|
+
"eslint-plugin-react": "^7.37.3",
|
|
39
39
|
"typescript-eslint": "^8.18.2"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@commitlint/cli": "^19.6.
|
|
42
|
+
"@commitlint/cli": "^19.6.1",
|
|
43
43
|
"@commitlint/config-conventional": "^19.6.0",
|
|
44
44
|
"@favware/cliff-jumper": "^5.0.0",
|
|
45
45
|
"@types/react": "^19.0.2",
|
|
46
46
|
"husky": "^9.1.7",
|
|
47
|
-
"lint-staged": "^15.2.
|
|
47
|
+
"lint-staged": "^15.2.11",
|
|
48
48
|
"react": "^19.0.0",
|
|
49
49
|
"typescript": "^5.7.2"
|
|
50
50
|
},
|