@atomicsmash/coding-standards 18.0.0-beta.4 → 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 CHANGED
@@ -1,5 +1,25 @@
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
+
13
+ ## 18.0.0-beta.5
14
+
15
+ ### Patch Changes
16
+
17
+ - [#542](https://github.com/AtomicSmash/packages/pull/542) [`7b60117`](https://github.com/AtomicSmash/packages/commit/7b60117254724918905e46bfc635bebc6ff7c9ad) Thanks [@mikeybinns](https://github.com/mikeybinns)! - Further fixes to the beta eslint config
18
+
19
+ - Updated dependencies []:
20
+ - @atomicsmash/eslint-config@18.0.0-beta.5
21
+ - @atomicsmash/browserslist-config@18.0.0-beta.5
22
+
3
23
  ## 18.0.0-beta.4
4
24
 
5
25
  ### Patch Changes
@@ -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
- export const config = defineConfig([
16
- {
17
- files: [
18
- "**/*.js",
19
- "**/*.cjs",
20
- "**/*.mjs",
21
- "**/*.ts",
22
- "**/*.cts",
23
- "**/*.mts",
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
- js.configs.recommended,
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-comments/no-unused-disable": [ERROR],
73
- "eslint-comments/require-description": [
74
- ERROR,
75
- { ignore: ["eslint-enable"] },
76
- ],
77
88
  "@typescript-eslint/naming-convention": [
78
89
  ERROR,
79
90
  {
@@ -106,50 +117,67 @@ export const config = defineConfig([
106
117
  },
107
118
  ],
108
119
  },
109
- },
110
- {
111
- files: ["*.cjs"],
112
- languageOptions: {
113
- sourceType: "commonjs",
120
+ settings: {
121
+ "import/resolver": {
122
+ typescript: true,
123
+ node: true,
124
+ },
114
125
  },
115
126
  },
116
- {
117
- files: ["*.mjs"],
118
- languageOptions: {
119
- sourceType: "module",
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
  },
140
+ rules: {
141
+ "react-hooks/exhaustive-deps": [
142
+ WARN,
143
+ {
144
+ additionalHooks: "(useSelect|useSuspenseSelect)",
145
+ },
146
+ ],
147
+ },
148
+ };
149
+
150
+ const reactConfig = defineConfig([
122
151
  {
123
- files: ["**/*.test.*"],
152
+ name: "@atomicsmash/coding-standards/react-config",
153
+ files: ["**/*.jsx"],
154
+ extends: [baseConfig, ...sharedReactRulesAndSettings.extends],
155
+ settings: {
156
+ ...sharedReactRulesAndSettings.settings,
157
+ },
124
158
  rules: {
125
- "@typescript-eslint/no-unused-vars": [OFF],
159
+ ...sharedReactRulesAndSettings.rules,
126
160
  },
127
161
  },
162
+ ]);
163
+
164
+ const reactTypescriptConfig = defineConfig([
128
165
  {
129
- files: ["**/*.jsx", "**/*.tsx"],
130
- extends: [
131
- reactPlugin.configs.flat.recommended,
132
- reactPlugin.configs.flat["jsx-runtime"],
133
- reactHooksPlugin.configs.flat.recommended,
134
- ],
166
+ name: "@atomicsmash/coding-standards/react-typescript-config",
167
+ files: ["**/*.tsx"],
168
+ extends: [typescriptConfig, ...sharedReactRulesAndSettings.extends],
135
169
  settings: {
136
- react: {
137
- version: "detect",
138
- },
170
+ ...sharedReactRulesAndSettings.settings,
139
171
  },
140
172
  rules: {
141
- "react-hooks/exhaustive-deps": [
142
- WARN,
143
- {
144
- additionalHooks: "(useSelect|useSuspenseSelect)",
145
- },
146
- ],
173
+ ...sharedReactRulesAndSettings.rules,
147
174
  },
148
175
  },
149
176
  ]);
150
177
 
151
178
  export const playwrightConfig = defineConfig([
152
179
  {
180
+ name: "@atomicsmash/coding-standards/playwright-config",
153
181
  extends: [playwrightPlugin.configs["flat/recommended"]],
154
182
  rules: {
155
183
  "playwright/expect-expect": [
@@ -163,3 +191,10 @@ export const playwrightConfig = defineConfig([
163
191
  },
164
192
  },
165
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",
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,13 +9,14 @@
9
9
  "@cspell/cspell-types": "^9.7.0"
10
10
  },
11
11
  "peerDependencies": {
12
- "@atomicsmash/browserslist-config": "^18.0.0-beta.4",
13
- "@atomicsmash/eslint-config": "^18.0.0-beta.4",
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",
17
17
  "eslint": "^8.57.1",
18
18
  "eslint-config-prettier": "^8.10.2",
19
+ "eslint-import-resolver-typescript": "^3.10.1",
19
20
  "eslint-plugin-import": "^2.32.0",
20
21
  "eslint-plugin-playwright": "^2.10.2",
21
22
  "eslint-plugin-react": "^7.37.5",