@atomicsmash/coding-standards 18.0.0-beta.5 → 18.0.0-beta.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 +10 -0
- package/beta/eslint/index.js +101 -72
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @atomicsmash/coding-standards
|
|
2
2
|
|
|
3
|
+
## 18.0.0-beta.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#544](https://github.com/AtomicSmash/packages/pull/544) [`8e4a0b7`](https://github.com/AtomicSmash/packages/commit/8e4a0b75e2d007c67dd6db0aa8d66d055b62f39e) Thanks [@mikeybinns](https://github.com/mikeybinns)! - More changes to eslint beta config
|
|
8
|
+
|
|
9
|
+
- Updated dependencies []:
|
|
10
|
+
- @atomicsmash/eslint-config@18.0.0-beta.6
|
|
11
|
+
- @atomicsmash/browserslist-config@18.0.0-beta.6
|
|
12
|
+
|
|
3
13
|
## 18.0.0-beta.5
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
package/beta/eslint/index.js
CHANGED
|
@@ -12,68 +12,79 @@ import reactHooksPlugin from "eslint-plugin-react-hooks";
|
|
|
12
12
|
import globals from "globals";
|
|
13
13
|
import tseslint from "typescript-eslint";
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
15
|
+
const baseConfig = defineConfig({
|
|
16
|
+
name: "@atomicsmash/coding-standards/base-config",
|
|
17
|
+
files: ["**/*.js", "**/*.cjs", "**/*.mjs"],
|
|
18
|
+
extends: [
|
|
19
|
+
js.configs.recommended,
|
|
20
|
+
esLintComments.recommended,
|
|
21
|
+
importPlugin.flatConfigs.recommended,
|
|
22
|
+
],
|
|
23
|
+
languageOptions: {
|
|
24
|
+
ecmaVersion: 2022,
|
|
25
|
+
sourceType: "module",
|
|
26
|
+
globals: {
|
|
27
|
+
...globals.browser,
|
|
28
|
+
...globals.node,
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
rules: {
|
|
32
|
+
"no-case-declarations": [OFF],
|
|
33
|
+
"import/order": [
|
|
34
|
+
ERROR,
|
|
35
|
+
{
|
|
36
|
+
alphabetize: {
|
|
37
|
+
order: "asc",
|
|
38
|
+
},
|
|
39
|
+
groups: [
|
|
40
|
+
"type",
|
|
41
|
+
"builtin",
|
|
42
|
+
"external",
|
|
43
|
+
"internal",
|
|
44
|
+
"parent",
|
|
45
|
+
["sibling", "index"],
|
|
46
|
+
],
|
|
47
|
+
"newlines-between": "ignore",
|
|
48
|
+
pathGroups: [],
|
|
49
|
+
pathGroupsExcludedImportTypes: [],
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
"prefer-const": [ERROR],
|
|
53
|
+
"no-var": [ERROR],
|
|
54
|
+
"import/no-duplicates": WARN,
|
|
55
|
+
"@eslint-community/eslint-comments/no-unused-disable": [ERROR],
|
|
56
|
+
"@eslint-community/eslint-comments/require-description": [
|
|
57
|
+
ERROR,
|
|
58
|
+
{ ignore: ["eslint-enable"] },
|
|
24
59
|
],
|
|
60
|
+
},
|
|
61
|
+
settings: {
|
|
62
|
+
"import/resolver": {
|
|
63
|
+
node: true,
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
const typescriptConfig = defineConfig([
|
|
69
|
+
{
|
|
70
|
+
name: "@atomicsmash/coding-standards/typescript-config",
|
|
71
|
+
files: ["**/*.ts", "**/*.cts", "**/*.mts"],
|
|
25
72
|
extends: [
|
|
26
|
-
|
|
27
|
-
esLintComments.recommended,
|
|
73
|
+
baseConfig,
|
|
28
74
|
tseslint.configs.strictTypeChecked,
|
|
29
75
|
tseslint.configs.stylisticTypeChecked,
|
|
30
|
-
importPlugin.flatConfigs.recommended,
|
|
31
76
|
importPlugin.flatConfigs.typescript,
|
|
32
77
|
],
|
|
33
78
|
plugins: {
|
|
34
79
|
"@typescript-eslint": tseslint.plugin,
|
|
35
80
|
},
|
|
36
81
|
languageOptions: {
|
|
37
|
-
ecmaVersion: 2022,
|
|
38
|
-
sourceType: "module",
|
|
39
|
-
globals: {
|
|
40
|
-
...globals.browser,
|
|
41
|
-
...globals.node,
|
|
42
|
-
},
|
|
43
82
|
parser: tseslint.parser,
|
|
44
83
|
parserOptions: {
|
|
45
84
|
projectService: true,
|
|
46
85
|
},
|
|
47
86
|
},
|
|
48
87
|
rules: {
|
|
49
|
-
"no-case-declarations": [OFF],
|
|
50
|
-
"import/order": [
|
|
51
|
-
ERROR,
|
|
52
|
-
{
|
|
53
|
-
alphabetize: {
|
|
54
|
-
order: "asc",
|
|
55
|
-
},
|
|
56
|
-
groups: [
|
|
57
|
-
"type",
|
|
58
|
-
"builtin",
|
|
59
|
-
"external",
|
|
60
|
-
"internal",
|
|
61
|
-
"parent",
|
|
62
|
-
["sibling", "index"],
|
|
63
|
-
],
|
|
64
|
-
"newlines-between": "ignore",
|
|
65
|
-
pathGroups: [],
|
|
66
|
-
pathGroupsExcludedImportTypes: [],
|
|
67
|
-
},
|
|
68
|
-
],
|
|
69
|
-
"prefer-const": [ERROR],
|
|
70
|
-
"no-var": [ERROR],
|
|
71
|
-
"import/no-duplicates": WARN,
|
|
72
|
-
"@eslint-community/eslint-comments/no-unused-disable": [ERROR],
|
|
73
|
-
"@eslint-community/eslint-comments/require-description": [
|
|
74
|
-
ERROR,
|
|
75
|
-
{ ignore: ["eslint-enable"] },
|
|
76
|
-
],
|
|
77
88
|
"@typescript-eslint/naming-convention": [
|
|
78
89
|
ERROR,
|
|
79
90
|
{
|
|
@@ -113,49 +124,60 @@ export const config = defineConfig([
|
|
|
113
124
|
},
|
|
114
125
|
},
|
|
115
126
|
},
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
127
|
+
]);
|
|
128
|
+
|
|
129
|
+
const sharedReactRulesAndSettings = {
|
|
130
|
+
extends: [
|
|
131
|
+
reactPlugin.configs.flat.recommended,
|
|
132
|
+
reactPlugin.configs.flat["jsx-runtime"],
|
|
133
|
+
reactHooksPlugin.configs.flat.recommended,
|
|
134
|
+
],
|
|
135
|
+
settings: {
|
|
136
|
+
react: {
|
|
137
|
+
version: "detect",
|
|
120
138
|
},
|
|
121
139
|
},
|
|
122
|
-
{
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
140
|
+
rules: {
|
|
141
|
+
"react-hooks/exhaustive-deps": [
|
|
142
|
+
WARN,
|
|
143
|
+
{
|
|
144
|
+
additionalHooks: "(useSelect|useSuspenseSelect)",
|
|
145
|
+
},
|
|
146
|
+
],
|
|
127
147
|
},
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
const reactConfig = defineConfig([
|
|
128
151
|
{
|
|
129
|
-
|
|
152
|
+
name: "@atomicsmash/coding-standards/react-config",
|
|
153
|
+
files: ["**/*.jsx"],
|
|
154
|
+
extends: [baseConfig, ...sharedReactRulesAndSettings.extends],
|
|
155
|
+
settings: {
|
|
156
|
+
...sharedReactRulesAndSettings.settings,
|
|
157
|
+
},
|
|
130
158
|
rules: {
|
|
131
|
-
|
|
159
|
+
...sharedReactRulesAndSettings.rules,
|
|
132
160
|
},
|
|
133
161
|
},
|
|
162
|
+
]);
|
|
163
|
+
|
|
164
|
+
const reactTypescriptConfig = defineConfig([
|
|
134
165
|
{
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
reactPlugin.configs.flat["jsx-runtime"],
|
|
139
|
-
reactHooksPlugin.configs.flat.recommended,
|
|
140
|
-
],
|
|
166
|
+
name: "@atomicsmash/coding-standards/react-typescript-config",
|
|
167
|
+
files: ["**/*.tsx"],
|
|
168
|
+
extends: [typescriptConfig, ...sharedReactRulesAndSettings.extends],
|
|
141
169
|
settings: {
|
|
142
|
-
|
|
143
|
-
version: "detect",
|
|
144
|
-
},
|
|
170
|
+
...sharedReactRulesAndSettings.settings,
|
|
145
171
|
},
|
|
146
172
|
rules: {
|
|
147
|
-
|
|
148
|
-
WARN,
|
|
149
|
-
{
|
|
150
|
-
additionalHooks: "(useSelect|useSuspenseSelect)",
|
|
151
|
-
},
|
|
152
|
-
],
|
|
173
|
+
...sharedReactRulesAndSettings.rules,
|
|
153
174
|
},
|
|
154
175
|
},
|
|
155
176
|
]);
|
|
156
177
|
|
|
157
178
|
export const playwrightConfig = defineConfig([
|
|
158
179
|
{
|
|
180
|
+
name: "@atomicsmash/coding-standards/playwright-config",
|
|
159
181
|
extends: [playwrightPlugin.configs["flat/recommended"]],
|
|
160
182
|
rules: {
|
|
161
183
|
"playwright/expect-expect": [
|
|
@@ -169,3 +191,10 @@ export const playwrightConfig = defineConfig([
|
|
|
169
191
|
},
|
|
170
192
|
},
|
|
171
193
|
]);
|
|
194
|
+
|
|
195
|
+
export const recommendedConfig = defineConfig([
|
|
196
|
+
baseConfig,
|
|
197
|
+
typescriptConfig,
|
|
198
|
+
reactConfig,
|
|
199
|
+
reactTypescriptConfig,
|
|
200
|
+
]);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atomicsmash/coding-standards",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "18.0.0-beta.
|
|
4
|
+
"version": "18.0.0-beta.6",
|
|
5
5
|
"description": "A collection of coding standards configurations.",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"types": "index.d.ts",
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
"@cspell/cspell-types": "^9.7.0"
|
|
10
10
|
},
|
|
11
11
|
"peerDependencies": {
|
|
12
|
-
"@atomicsmash/browserslist-config": "^18.0.0-beta.
|
|
13
|
-
"@atomicsmash/eslint-config": "^18.0.0-beta.
|
|
12
|
+
"@atomicsmash/browserslist-config": "^18.0.0-beta.6",
|
|
13
|
+
"@atomicsmash/eslint-config": "^18.0.0-beta.6",
|
|
14
14
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.5.0",
|
|
15
15
|
"@eslint/js": "^8.57.1",
|
|
16
16
|
"@wordpress/stylelint-config": "^23.33.0",
|