@standard-config/eslint 1.2.0 → 1.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/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  # @standard-config/eslint
6
6
 
7
- TypeScript-first ESLint config designed to complement Oxlint and Prettier.
7
+ TypeScript-first ESLint config designed to complement Oxlint and Prettier. Enforces rules not yet [implemented in Oxlint](https://github.com/oxc-project/oxc/issues/481).
8
8
 
9
9
  ## Install
10
10
 
package/dist/index.d.mts CHANGED
@@ -1,10 +1,31 @@
1
1
  import { Config, defineConfig as defineConfig$1 } from "eslint/config";
2
+ import { Linter } from "eslint";
2
3
 
4
+ //#region src/types/index.d.ts
5
+ type LinterConfigEntry = Omit<Linter.Config, 'files'>;
6
+ //#endregion
7
+ //#region src/config-base/index.d.ts
8
+ /**
9
+ * This config is intentionally limited to rules not supported by Oxlint
10
+ * and formatting options not supported by Prettier.
11
+ */
12
+ declare const config: LinterConfigEntry;
13
+ //#endregion
14
+ //#region src/config-config-files/index.d.ts
15
+ declare const config$1: LinterConfigEntry;
16
+ //#endregion
17
+ //#region src/config-react/index.d.ts
18
+ /**
19
+ * This config is intentionally limited to rules not supported by Oxlint
20
+ * and formatting options not supported by Prettier.
21
+ */
22
+ declare const config$2: LinterConfigEntry;
23
+ //#endregion
3
24
  //#region src/define-config/index.d.ts
4
25
  /**
5
26
  * Combine Standard Config with optional additional config.
6
27
  */
7
28
  declare function defineConfig(...configs: Parameters<typeof defineConfig$1>): Config[];
8
29
  //#endregion
9
- export { defineConfig };
30
+ export { config as configBase, config$1 as configConfigFiles, config$2 as configReact, defineConfig };
10
31
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/define-config/index.ts"],"mappings":";;;;AACmE;;iBAc3C,YAAA,CAAA,GACpB,OAAA,EAAS,UAAA,QAAkB,cAAA,IAC5B,MAAA"}
1
+ {"version":3,"file":"index.d.mts","names":["Linter","LinterConfigEntry","Config","Omit"],"sources":["../src/types/index.d.ts","../src/config-base/index.ts","../src/config-config-files/index.ts","../src/config-react/index.ts","../src/define-config/index.ts"],"mappings":";;;;KAEYC,iBAAAA,GAAoBE,IAAAA,CAAKH,MAAAA,CAAOE,MAAAA;;;;;;AAA5C;cCMM,MAAA,EAAQ,iBAAA;;;cCLR,QAAA,EAAQ,iBAAA;;;;;;AFDd;cGQM,QAAA,EAAQ,iBAAA;;;;;AHRd;iBIUwB,YAAA,CAAA,GACpB,OAAA,EAAS,UAAA,QAAkB,cAAA,IAC5B,MAAA"}
package/dist/index.mjs CHANGED
@@ -1,122 +1,50 @@
1
- import { defineConfig as defineConfig$1 } from "eslint/config";
2
1
  import pluginPerfectionist from "eslint-plugin-perfectionist";
2
+ import tseslint from "typescript-eslint";
3
+ import pluginReact from "eslint-plugin-react";
4
+ import pluginReactHooks from "eslint-plugin-react-hooks";
5
+ import pluginOxlint from "eslint-plugin-oxlint";
6
+ import { defineConfig as defineConfig$1 } from "eslint/config";
3
7
  import { includeIgnoreFile } from "@eslint/compat";
4
8
  import fs from "node:fs";
5
9
  import path from "node:path";
6
- import pluginOxlint from "eslint-plugin-oxlint";
7
10
  import pluginPrettier from "eslint-plugin-prettier/recommended";
8
- import pluginReact from "eslint-plugin-react";
9
- import pluginReactHooks from "eslint-plugin-react-hooks";
10
- import tseslint from "typescript-eslint";
11
11
 
12
- //#region src/config-formatting-config-files/index.ts
13
- const config$8 = {
14
- name: "Formatting (Config Files)",
15
- plugins: { perfectionist: pluginPerfectionist },
16
- rules: { "perfectionist/sort-objects": ["error", {
17
- customGroups: [
18
- {
19
- groupName: "extends",
20
- elementNamePattern: "^extends$"
21
- },
22
- {
23
- groupName: "files",
24
- elementNamePattern: "^files$"
25
- },
26
- {
27
- groupName: "ignores",
28
- elementNamePattern: "^(ignores|ignorePatterns)$"
29
- },
30
- {
31
- groupName: "name",
32
- elementNamePattern: "^(name|groupName)$"
33
- },
34
- {
35
- groupName: "overrides",
36
- elementNamePattern: "^overrides$"
37
- },
38
- {
39
- groupName: "plugins",
40
- elementNamePattern: "^plugins$"
41
- },
42
- {
43
- groupName: "rules",
44
- elementNamePattern: "^rules$"
45
- }
46
- ],
47
- groups: [
48
- "name",
49
- "files",
50
- "extends",
51
- "ignores",
52
- "plugins",
53
- "unknown",
54
- "rules",
55
- "overrides"
56
- ],
57
- newlinesBetween: 0,
58
- type: "natural"
59
- }] }
60
- };
61
- var config_formatting_config_files_default = config$8;
62
-
63
- //#endregion
64
- //#region src/config-formatting-react/index.ts
65
- const config$7 = {
66
- name: "Formatting (React)",
67
- plugins: { perfectionist: pluginPerfectionist },
68
- rules: { "perfectionist/sort-jsx-props": ["error", {
69
- customGroups: [
70
- {
71
- groupName: "as",
72
- elementNamePattern: "^as$"
73
- },
74
- {
75
- groupName: "callback",
76
- elementNamePattern: "^on.+"
77
- },
78
- {
79
- groupName: "children",
80
- elementNamePattern: "^children$"
81
- },
82
- {
83
- groupName: "key",
84
- elementNamePattern: "^key$"
85
- },
86
- {
87
- groupName: "ref",
88
- elementNamePattern: "^ref$"
89
- },
90
- {
91
- groupName: "unsafe",
92
- elementNamePattern: "^dangerously.+"
93
- }
94
- ],
95
- groups: [
96
- "key",
97
- "ref",
98
- "as",
99
- "unknown",
100
- "shorthand-prop",
101
- "callback",
102
- "children",
103
- "unsafe"
104
- ],
105
- type: "unsorted"
106
- }] }
107
- };
108
- var config_formatting_react_default = config$7;
109
-
110
- //#endregion
111
- //#region src/config-formatting/index.ts
12
+ //#region src/config-base/index.ts
112
13
  /**
113
- * This config is intentionally limited to formatting options
114
- * not supported by Prettier.
14
+ * This config is intentionally limited to rules not supported by Oxlint
15
+ * and formatting options not supported by Prettier.
115
16
  */
116
- const config$6 = {
117
- name: "Formatting",
118
- plugins: { perfectionist: pluginPerfectionist },
17
+ const config$4 = {
18
+ name: "Base Config",
19
+ plugins: {
20
+ "@typescript-eslint": tseslint.plugin,
21
+ "perfectionist": pluginPerfectionist
22
+ },
23
+ languageOptions: {
24
+ parser: tseslint.parser,
25
+ parserOptions: { projectService: true }
26
+ },
27
+ linterOptions: {
28
+ reportUnusedDisableDirectives: "error",
29
+ reportUnusedInlineConfigs: "error"
30
+ },
119
31
  rules: {
32
+ "camelcase": ["error", { properties: "always" }],
33
+ "dot-notation": "error",
34
+ "func-name-matching": [
35
+ "error",
36
+ "never",
37
+ { considerPropertyDescriptor: true }
38
+ ],
39
+ "@typescript-eslint/consistent-type-assertions": ["error", {
40
+ assertionStyle: "as",
41
+ objectLiteralTypeAssertions: "allow-as-parameter"
42
+ }],
43
+ "@typescript-eslint/consistent-type-exports": ["error", { fixMixedExportsWithInlineTypeSpecifier: true }],
44
+ "@typescript-eslint/no-unnecessary-qualifier": "error",
45
+ "@typescript-eslint/no-useless-default-assignment": "error",
46
+ "@typescript-eslint/parameter-properties": ["error", { prefer: "parameter-property" }],
47
+ "@typescript-eslint/prefer-readonly": "error",
120
48
  "perfectionist/sort-array-includes": ["error", { type: "natural" }],
121
49
  "perfectionist/sort-classes": ["error", {
122
50
  groups: ["property", "constructor"],
@@ -217,41 +145,113 @@ const config$6 = {
217
145
  }]
218
146
  }
219
147
  };
220
- var config_formatting_default = config$6;
221
-
222
- //#endregion
223
- //#region src/config-ignores/index.ts
224
- const configPath$2 = path.resolve(".gitignore");
225
- const config$5 = [fs.existsSync(configPath$2) ? includeIgnoreFile(configPath$2, ".gitignore") : {}, {
226
- name: "Ignored Paths",
227
- ignores: ["**/fixtures/**"]
228
- }];
229
- var config_ignores_default = config$5;
148
+ var config_base_default = config$4;
230
149
 
231
150
  //#endregion
232
- //#region src/config-oxlint/index.ts
233
- const configPath$1 = path.resolve(".oxlintrc.json");
234
- const config$4 = fs.existsSync(configPath$1) ? pluginOxlint.buildFromOxlintConfigFile(configPath$1, { typeAware: true }) : [];
235
- var config_oxlint_default = config$4;
236
-
237
- //#endregion
238
- //#region src/config-prettier/index.ts
239
- const configPath = path.resolve("prettier.config.ts");
240
- const config$3 = fs.existsSync(configPath) ? pluginPrettier : {};
241
- var config_prettier_default = config$3;
151
+ //#region src/config-config-files/index.ts
152
+ const config$3 = {
153
+ name: "Config Files",
154
+ plugins: { perfectionist: pluginPerfectionist },
155
+ rules: { "perfectionist/sort-objects": ["error", {
156
+ customGroups: [
157
+ {
158
+ groupName: "extends",
159
+ elementNamePattern: "^extends$"
160
+ },
161
+ {
162
+ groupName: "files",
163
+ elementNamePattern: "^files$"
164
+ },
165
+ {
166
+ groupName: "ignores",
167
+ elementNamePattern: "^(ignores|ignorePatterns)$"
168
+ },
169
+ {
170
+ groupName: "name",
171
+ elementNamePattern: "^(name|groupName)$"
172
+ },
173
+ {
174
+ groupName: "overrides",
175
+ elementNamePattern: "^overrides$"
176
+ },
177
+ {
178
+ groupName: "plugins",
179
+ elementNamePattern: "^plugins$"
180
+ },
181
+ {
182
+ groupName: "rules",
183
+ elementNamePattern: "^rules$"
184
+ }
185
+ ],
186
+ groups: [
187
+ "name",
188
+ "files",
189
+ "extends",
190
+ "ignores",
191
+ "plugins",
192
+ "unknown",
193
+ "rules",
194
+ "overrides"
195
+ ],
196
+ newlinesBetween: 0,
197
+ type: "natural"
198
+ }] }
199
+ };
200
+ var config_config_files_default = config$3;
242
201
 
243
202
  //#endregion
244
203
  //#region src/config-react/index.ts
245
204
  /**
246
- * This config is intentionally limited to rules not supported by Oxlint.
205
+ * This config is intentionally limited to rules not supported by Oxlint
206
+ * and formatting options not supported by Prettier.
247
207
  */
248
208
  const config$2 = {
249
209
  name: "React",
250
210
  plugins: {
211
+ "perfectionist": pluginPerfectionist,
251
212
  "react": pluginReact,
252
213
  "react-hooks": pluginReactHooks
253
214
  },
254
215
  rules: {
216
+ "perfectionist/sort-jsx-props": ["error", {
217
+ customGroups: [
218
+ {
219
+ groupName: "as",
220
+ elementNamePattern: "^as$"
221
+ },
222
+ {
223
+ groupName: "callback",
224
+ elementNamePattern: "^on.+"
225
+ },
226
+ {
227
+ groupName: "children",
228
+ elementNamePattern: "^children$"
229
+ },
230
+ {
231
+ groupName: "key",
232
+ elementNamePattern: "^key$"
233
+ },
234
+ {
235
+ groupName: "ref",
236
+ elementNamePattern: "^ref$"
237
+ },
238
+ {
239
+ groupName: "unsafe",
240
+ elementNamePattern: "^dangerously.+"
241
+ }
242
+ ],
243
+ groups: [
244
+ "key",
245
+ "ref",
246
+ "as",
247
+ "unknown",
248
+ "shorthand-prop",
249
+ "callback",
250
+ "children",
251
+ "unsafe"
252
+ ],
253
+ type: "unsorted"
254
+ }],
255
255
  "react/destructuring-assignment": ["error", "always"],
256
256
  "react/function-component-definition": ["error", {
257
257
  namedComponents: ["arrow-function", "function-declaration"],
@@ -267,48 +267,16 @@ const config$2 = {
267
267
  var config_react_default = config$2;
268
268
 
269
269
  //#endregion
270
- //#region src/config-typescript-settings/index.ts
271
- const config$1 = {
272
- name: "TypeScript (Linter Settings)",
273
- languageOptions: {
274
- parser: tseslint.parser,
275
- parserOptions: { projectService: true }
276
- },
277
- linterOptions: {
278
- reportUnusedDisableDirectives: "error",
279
- reportUnusedInlineConfigs: "error"
280
- }
281
- };
282
- var config_typescript_settings_default = config$1;
270
+ //#region src/config-ignores/index.ts
271
+ const configPath$1 = path.resolve(".gitignore");
272
+ const config$1 = fs.existsSync(configPath$1) ? includeIgnoreFile(configPath$1, ".gitignore") : {};
273
+ var config_ignores_default = config$1;
283
274
 
284
275
  //#endregion
285
- //#region src/config-typescript/index.ts
286
- /**
287
- * This config is intentionally limited to rules not supported by Oxlint.
288
- */
289
- const config = {
290
- name: "TypeScript",
291
- plugins: { "@typescript-eslint": tseslint.plugin },
292
- rules: {
293
- "camelcase": ["error", { properties: "always" }],
294
- "dot-notation": "error",
295
- "func-name-matching": [
296
- "error",
297
- "never",
298
- { considerPropertyDescriptor: true }
299
- ],
300
- "@typescript-eslint/consistent-type-assertions": ["error", {
301
- assertionStyle: "as",
302
- objectLiteralTypeAssertions: "allow-as-parameter"
303
- }],
304
- "@typescript-eslint/consistent-type-exports": ["error", { fixMixedExportsWithInlineTypeSpecifier: true }],
305
- "@typescript-eslint/no-unnecessary-qualifier": "error",
306
- "@typescript-eslint/no-useless-default-assignment": "error",
307
- "@typescript-eslint/parameter-properties": ["error", { prefer: "parameter-property" }],
308
- "@typescript-eslint/prefer-readonly": "error"
309
- }
310
- };
311
- var config_typescript_default = config;
276
+ //#region src/config-prettier/index.ts
277
+ const configPath = path.resolve("prettier.config.ts");
278
+ const config = fs.existsSync(configPath) ? pluginPrettier : {};
279
+ var config_prettier_default = config;
312
280
 
313
281
  //#endregion
314
282
  //#region src/define-config/index.ts
@@ -322,15 +290,13 @@ function defineConfig(...configs) {
322
290
  files: ["**/*.{ts,tsx,cts,mts}"],
323
291
  extends: [
324
292
  config_ignores_default,
325
- config_typescript_settings_default,
326
- config_typescript_default,
327
- config_formatting_default,
293
+ config_base_default,
328
294
  {
329
- files: ["**/*.config.*"],
330
- ...config_formatting_config_files_default
295
+ files: ["**/*.config.{ts,cts,mts}"],
296
+ ...config_config_files_default
331
297
  },
332
298
  includeReactConfig(configExtension),
333
- config_oxlint_default,
299
+ pluginOxlint.configs["flat/all"],
334
300
  config_prettier_default
335
301
  ]
336
302
  });
@@ -342,19 +308,12 @@ function includeReactConfig(configs) {
342
308
  break;
343
309
  }
344
310
  if (!react) return configs;
345
- return [
346
- {
347
- settings: { react },
348
- ...config_react_default
349
- },
350
- {
351
- files: ["**/*.tsx"],
352
- ...config_formatting_react_default
353
- },
354
- ...configs
355
- ];
311
+ return [{
312
+ settings: { react },
313
+ ...config_react_default
314
+ }, ...configs];
356
315
  }
357
316
 
358
317
  //#endregion
359
- export { defineConfig };
318
+ export { config_base_default as configBase, config_config_files_default as configConfigFiles, config_react_default as configReact, defineConfig };
360
319
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["config","config","config","configPath","config","_includeIgnoreFile","configPath","config","config","config","config","eslintDefineConfig","configIgnores","configTypeScriptSettings","configTypeScript","configFormatting","configFormattingConfigFiles","configOxlint","configPrettier","configReact","configFormattingReact"],"sources":["../src/config-formatting-config-files/index.ts","../src/config-formatting-react/index.ts","../src/config-formatting/index.ts","../src/config-ignores/index.ts","../src/config-oxlint/index.ts","../src/config-prettier/index.ts","../src/config-react/index.ts","../src/config-typescript-settings/index.ts","../src/config-typescript/index.ts","../src/define-config/index.ts"],"sourcesContent":["import type { Linter } from 'eslint';\nimport pluginPerfectionist from 'eslint-plugin-perfectionist';\n\nconst config: Linter.Config = {\n\tname: 'Formatting (Config Files)',\n\tplugins: {\n\t\tperfectionist: pluginPerfectionist,\n\t},\n\trules: {\n\t\t'perfectionist/sort-objects': [\n\t\t\t'error',\n\t\t\t{\n\t\t\t\tcustomGroups: [\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'extends',\n\t\t\t\t\t\telementNamePattern: '^extends$',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'files',\n\t\t\t\t\t\telementNamePattern: '^files$',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'ignores',\n\t\t\t\t\t\telementNamePattern: '^(ignores|ignorePatterns)$',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'name',\n\t\t\t\t\t\telementNamePattern: '^(name|groupName)$',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'overrides',\n\t\t\t\t\t\telementNamePattern: '^overrides$',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'plugins',\n\t\t\t\t\t\telementNamePattern: '^plugins$',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'rules',\n\t\t\t\t\t\telementNamePattern: '^rules$',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tgroups: [\n\t\t\t\t\t'name',\n\t\t\t\t\t'files',\n\t\t\t\t\t'extends',\n\t\t\t\t\t'ignores',\n\t\t\t\t\t'plugins',\n\t\t\t\t\t'unknown',\n\t\t\t\t\t'rules',\n\t\t\t\t\t'overrides',\n\t\t\t\t],\n\t\t\t\tnewlinesBetween: 0,\n\t\t\t\ttype: 'natural',\n\t\t\t},\n\t\t],\n\t},\n};\n\nexport default config;\n","import type { Linter } from 'eslint';\nimport pluginPerfectionist from 'eslint-plugin-perfectionist';\n\nconst config: Linter.Config = {\n\tname: 'Formatting (React)',\n\tplugins: {\n\t\tperfectionist: pluginPerfectionist,\n\t},\n\trules: {\n\t\t'perfectionist/sort-jsx-props': [\n\t\t\t'error',\n\t\t\t{\n\t\t\t\tcustomGroups: [\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'as',\n\t\t\t\t\t\telementNamePattern: '^as$',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'callback',\n\t\t\t\t\t\telementNamePattern: '^on.+',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'children',\n\t\t\t\t\t\telementNamePattern: '^children$',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'key',\n\t\t\t\t\t\telementNamePattern: '^key$',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'ref',\n\t\t\t\t\t\telementNamePattern: '^ref$',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'unsafe',\n\t\t\t\t\t\telementNamePattern: '^dangerously.+',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tgroups: [\n\t\t\t\t\t'key',\n\t\t\t\t\t'ref',\n\t\t\t\t\t'as',\n\t\t\t\t\t'unknown',\n\t\t\t\t\t'shorthand-prop',\n\t\t\t\t\t'callback',\n\t\t\t\t\t'children',\n\t\t\t\t\t'unsafe',\n\t\t\t\t],\n\t\t\t\ttype: 'unsorted',\n\t\t\t},\n\t\t],\n\t},\n};\n\nexport default config;\n","import type { Linter } from 'eslint';\nimport pluginPerfectionist from 'eslint-plugin-perfectionist';\n\n/**\n * This config is intentionally limited to formatting options\n * not supported by Prettier.\n */\nconst config: Linter.Config = {\n\tname: 'Formatting',\n\tplugins: {\n\t\tperfectionist: pluginPerfectionist,\n\t},\n\trules: {\n\t\t'perfectionist/sort-array-includes': ['error', { type: 'natural' }],\n\t\t'perfectionist/sort-classes': [\n\t\t\t'error',\n\t\t\t{\n\t\t\t\tgroups: ['property', 'constructor'],\n\t\t\t\ttype: 'natural',\n\t\t\t},\n\t\t],\n\t\t'perfectionist/sort-exports': ['error', { type: 'natural' }],\n\t\t'perfectionist/sort-imports': [\n\t\t\t'error',\n\t\t\t{\n\t\t\t\tcustomGroups: [\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'mock-side-effect',\n\t\t\t\t\t\telementNamePattern: '^.*/_*(mocks)_*/.*$',\n\t\t\t\t\t\tselector: 'side-effect',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'mock',\n\t\t\t\t\t\telementNamePattern: '^.*/_*(mocks)_*/.*$',\n\t\t\t\t\t\tselector: 'import',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tgroups: [\n\t\t\t\t\t'mock-side-effect',\n\t\t\t\t\t'mock',\n\t\t\t\t\t['type-builtin', 'type-external'],\n\t\t\t\t\t'type-internal',\n\t\t\t\t\t['type-parent', 'type-sibling', 'type-index'],\n\t\t\t\t\t['value-builtin', 'value-external'],\n\t\t\t\t\t'value-internal',\n\t\t\t\t\t['value-parent', 'value-sibling', 'value-index'],\n\t\t\t\t\t'unknown',\n\t\t\t\t\t'style',\n\t\t\t\t\t'side-effect',\n\t\t\t\t\t'side-effect-style',\n\t\t\t\t],\n\t\t\t\tinternalPattern: ['^(#|@/).*'],\n\t\t\t\tnewlinesBetween: 0,\n\t\t\t\tsortSideEffects: true,\n\t\t\t\ttype: 'natural',\n\t\t\t},\n\t\t],\n\t\t'perfectionist/sort-interfaces': [\n\t\t\t'error',\n\t\t\t{\n\t\t\t\tgroups: ['index-signature', 'unknown', 'method'],\n\t\t\t\ttype: 'natural',\n\t\t\t},\n\t\t],\n\t\t'perfectionist/sort-intersection-types': ['error', { type: 'natural' }],\n\t\t'perfectionist/sort-named-exports': ['error', { type: 'natural' }],\n\t\t'perfectionist/sort-named-imports': ['error', { type: 'natural' }],\n\t\t'perfectionist/sort-object-types': [\n\t\t\t'error',\n\t\t\t{\n\t\t\t\tgroups: ['index-signature', 'unknown', 'method'],\n\t\t\t\ttype: 'natural',\n\t\t\t},\n\t\t],\n\t\t'perfectionist/sort-objects': [\n\t\t\t'error',\n\t\t\t{\n\t\t\t\ttype: 'natural',\n\t\t\t\tuseConfigurationIf: {\n\t\t\t\t\tobjectType: 'destructured',\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'unsorted',\n\t\t\t\tuseConfigurationIf: {\n\t\t\t\t\tobjectType: 'non-destructured',\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t\t'perfectionist/sort-union-types': [\n\t\t\t'error',\n\t\t\t{\n\t\t\t\tcustomGroups: [\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'false',\n\t\t\t\t\t\telementNamePattern: '^false$',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'never',\n\t\t\t\t\t\telementNamePattern: '^never$',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'react',\n\t\t\t\t\t\telementNamePattern: '^react.+',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tgroups: [\n\t\t\t\t\t'react',\n\t\t\t\t\t'unknown',\n\t\t\t\t\t'tuple',\n\t\t\t\t\t'false',\n\t\t\t\t\t'nullish',\n\t\t\t\t\t'never',\n\t\t\t\t],\n\t\t\t\ttype: 'natural',\n\t\t\t},\n\t\t],\n\t},\n};\n\nexport default config;\n","import type { Linter } from 'eslint';\nimport { includeIgnoreFile as _includeIgnoreFile } from '@eslint/compat';\nimport fs from 'node:fs';\nimport path from 'node:path';\n\nconst configPath = path.resolve('.gitignore');\nconst configExists = fs.existsSync(configPath);\n\nconst config: Linter.Config[] = [\n\tconfigExists ? _includeIgnoreFile(configPath, '.gitignore') : {},\n\t{\n\t\tname: 'Ignored Paths',\n\t\tignores: ['**/fixtures/**'],\n\t},\n];\n\nexport default config;\n","import type { Linter } from 'eslint';\nimport pluginOxlint from 'eslint-plugin-oxlint';\nimport fs from 'node:fs';\nimport path from 'node:path';\n\nconst configPath = path.resolve('.oxlintrc.json');\nconst configExists = fs.existsSync(configPath);\n\nconst config: Linter.Config[] = configExists\n\t? pluginOxlint.buildFromOxlintConfigFile(configPath, {\n\t\t\ttypeAware: true,\n\t\t})\n\t: [];\n\nexport default config;\n","import type { Linter } from 'eslint';\nimport pluginPrettier from 'eslint-plugin-prettier/recommended';\nimport fs from 'node:fs';\nimport path from 'node:path';\n\nconst configPath = path.resolve('prettier.config.ts');\nconst configExists = fs.existsSync(configPath);\n\nconst config: Linter.Config = configExists ? pluginPrettier : {};\n\nexport default config;\n","import type { ESLint, Linter } from 'eslint';\nimport pluginReact from 'eslint-plugin-react';\nimport pluginReactHooks from 'eslint-plugin-react-hooks';\n\n/**\n * This config is intentionally limited to rules not supported by Oxlint.\n */\nconst config: Linter.Config = {\n\tname: 'React',\n\tplugins: {\n\t\t'react': pluginReact,\n\t\t'react-hooks': pluginReactHooks as ESLint.Plugin,\n\t},\n\trules: {\n\t\t'react/destructuring-assignment': ['error', 'always'],\n\t\t'react/function-component-definition': [\n\t\t\t'error',\n\t\t\t{\n\t\t\t\tnamedComponents: ['arrow-function', 'function-declaration'],\n\t\t\t\tunnamedComponents: 'arrow-function',\n\t\t\t},\n\t\t],\n\t\t'react/hook-use-state': 'error',\n\t\t'react/jsx-no-constructed-context-values': 'error',\n\t\t'react/no-adjacent-inline-elements': 'error',\n\t\t'react/no-unstable-nested-components': 'error',\n\n\t\t// Enforce all `react-hooks` rules as errors\n\t\t...Object.fromEntries(\n\t\t\tObject.keys(\n\t\t\t\tpluginReactHooks.configs.flat['recommended-latest'].rules\n\t\t\t).map((rule) => [rule, 'error'])\n\t\t),\n\t},\n};\n\nexport default config;\n","import type { Linter } from 'eslint';\nimport tseslint from 'typescript-eslint';\n\nconst config: Linter.Config = {\n\tname: 'TypeScript (Linter Settings)',\n\tlanguageOptions: {\n\t\tparser: tseslint.parser,\n\t\tparserOptions: {\n\t\t\tprojectService: true,\n\t\t},\n\t},\n\tlinterOptions: {\n\t\treportUnusedDisableDirectives: 'error',\n\t\treportUnusedInlineConfigs: 'error',\n\t},\n};\n\nexport default config;\n","import type { Linter } from 'eslint';\nimport tseslint from 'typescript-eslint';\n\n/**\n * This config is intentionally limited to rules not supported by Oxlint.\n */\nconst config: Linter.Config = {\n\tname: 'TypeScript',\n\tplugins: {\n\t\t'@typescript-eslint': tseslint.plugin,\n\t},\n\trules: {\n\t\t/* oxlint-disable-next-line unicorn/no-useless-spread */\n\t\t...{\n\t\t\t'camelcase': ['error', { properties: 'always' }],\n\t\t\t'dot-notation': 'error',\n\t\t\t'func-name-matching': [\n\t\t\t\t'error',\n\t\t\t\t'never',\n\t\t\t\t{ considerPropertyDescriptor: true },\n\t\t\t],\n\t\t},\n\t\t'@typescript-eslint/consistent-type-assertions': [\n\t\t\t'error',\n\t\t\t{\n\t\t\t\tassertionStyle: 'as',\n\t\t\t\tobjectLiteralTypeAssertions: 'allow-as-parameter',\n\t\t\t},\n\t\t],\n\t\t'@typescript-eslint/consistent-type-exports': [\n\t\t\t'error',\n\t\t\t{ fixMixedExportsWithInlineTypeSpecifier: true },\n\t\t],\n\t\t'@typescript-eslint/no-unnecessary-qualifier': 'error',\n\t\t'@typescript-eslint/no-useless-default-assignment': 'error',\n\t\t'@typescript-eslint/parameter-properties': [\n\t\t\t'error',\n\t\t\t{ prefer: 'parameter-property' },\n\t\t],\n\t\t'@typescript-eslint/prefer-readonly': 'error',\n\t},\n};\n\nexport default config;\n","import type { Config } from 'eslint/config';\nimport { defineConfig as eslintDefineConfig } from 'eslint/config';\nimport configFormattingConfigFiles from '../config-formatting-config-files/index.ts';\nimport configFormattingReact from '../config-formatting-react/index.ts';\nimport configFormatting from '../config-formatting/index.ts';\nimport configIgnores from '../config-ignores/index.ts';\nimport configOxlint from '../config-oxlint/index.ts';\nimport configPrettier from '../config-prettier/index.ts';\nimport configReact from '../config-react/index.ts';\nimport configTypeScriptSettings from '../config-typescript-settings/index.ts';\nimport configTypeScript from '../config-typescript/index.ts';\n\n/**\n * Combine Standard Config with optional additional config.\n */\nexport default function defineConfig(\n\t...configs: Parameters<typeof eslintDefineConfig>\n): Config[] {\n\tconst configExtension =\n\t\tconfigs.length > 0 ? eslintDefineConfig(...configs) : [];\n\n\treturn eslintDefineConfig({\n\t\tname: 'Standard Config',\n\t\tfiles: ['**/*.{ts,tsx,cts,mts}'],\n\t\textends: [\n\t\t\tconfigIgnores,\n\t\t\tconfigTypeScriptSettings,\n\t\t\tconfigTypeScript,\n\t\t\tconfigFormatting,\n\t\t\t{\n\t\t\t\tfiles: ['**/*.config.*'],\n\t\t\t\t...configFormattingConfigFiles,\n\t\t\t},\n\t\t\tincludeReactConfig(configExtension),\n\t\t\tconfigOxlint,\n\t\t\tconfigPrettier,\n\t\t],\n\t});\n}\n\nfunction includeReactConfig(configs: Config[]): Config[] {\n\tlet react: unknown;\n\n\tfor (const { settings } of configs.toReversed()) {\n\t\tif (settings?.react && typeof settings?.react === 'object') {\n\t\t\treact = settings.react;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tif (!react) {\n\t\treturn configs;\n\t}\n\n\treturn [\n\t\t{\n\t\t\tsettings: { react },\n\t\t\t...configReact,\n\t\t},\n\t\t{\n\t\t\tfiles: ['**/*.tsx'],\n\t\t\t...configFormattingReact,\n\t\t},\n\t\t...configs,\n\t];\n}\n"],"mappings":";;;;;;;;;;;;AAGA,MAAMA,WAAwB;CAC7B,MAAM;CACN,SAAS,EACR,eAAe,qBACf;CACD,OAAO,EACN,8BAA8B,CAC7B,SACA;EACC,cAAc;GACb;IACC,WAAW;IACX,oBAAoB;IACpB;GACD;IACC,WAAW;IACX,oBAAoB;IACpB;GACD;IACC,WAAW;IACX,oBAAoB;IACpB;GACD;IACC,WAAW;IACX,oBAAoB;IACpB;GACD;IACC,WAAW;IACX,oBAAoB;IACpB;GACD;IACC,WAAW;IACX,oBAAoB;IACpB;GACD;IACC,WAAW;IACX,oBAAoB;IACpB;GACD;EACD,QAAQ;GACP;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACD,iBAAiB;EACjB,MAAM;EACN,CACD,EACD;CACD;AAED,6CAAeA;;;;ACxDf,MAAMC,WAAwB;CAC7B,MAAM;CACN,SAAS,EACR,eAAe,qBACf;CACD,OAAO,EACN,gCAAgC,CAC/B,SACA;EACC,cAAc;GACb;IACC,WAAW;IACX,oBAAoB;IACpB;GACD;IACC,WAAW;IACX,oBAAoB;IACpB;GACD;IACC,WAAW;IACX,oBAAoB;IACpB;GACD;IACC,WAAW;IACX,oBAAoB;IACpB;GACD;IACC,WAAW;IACX,oBAAoB;IACpB;GACD;IACC,WAAW;IACX,oBAAoB;IACpB;GACD;EACD,QAAQ;GACP;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACD,MAAM;EACN,CACD,EACD;CACD;AAED,sCAAeA;;;;;;;;AC/Cf,MAAMC,WAAwB;CAC7B,MAAM;CACN,SAAS,EACR,eAAe,qBACf;CACD,OAAO;EACN,qCAAqC,CAAC,SAAS,EAAE,MAAM,WAAW,CAAC;EACnE,8BAA8B,CAC7B,SACA;GACC,QAAQ,CAAC,YAAY,cAAc;GACnC,MAAM;GACN,CACD;EACD,8BAA8B,CAAC,SAAS,EAAE,MAAM,WAAW,CAAC;EAC5D,8BAA8B,CAC7B,SACA;GACC,cAAc,CACb;IACC,WAAW;IACX,oBAAoB;IACpB,UAAU;IACV,EACD;IACC,WAAW;IACX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AAe;;;;;;;AC5Bf,SAAwB,aACvB,GAAG,SACQ;CACX,MAAM,kBACL,QAAQ,SAAS,IAAIC,eAAmB,GAAG,QAAQ,GAAG,EAAE;AAEzD,QAAOA,eAAmB;EACzB,MAAM;EACN,OAAO,CAAC,wBAAwB;EAChC,SAAS;GACRC;GACAC;GACAC;GACAC;GACA;IACC,OAAO,CAAC,gBAAgB;IACxB,GAAGC;IACH;GACD,mBAAmB,gBAAgB;GACnCC;GACAC;GACA;EACD,CAAC;;AAGH,SAAS,mBAAmB,SAA6B;CACxD,IAAI;AAEJ,MAAK,MAAM,EAAE,cAAc,QAAQ,YAAY,CAC9C,KAAI,UAAU,SAAS,OAAO,UAAU,UAAU,UAAU;AAC3D,UAAQ,SAAS;AACjB;;AAIF,KAAI,CAAC,MACJ,QAAO;AAGR,QAAO;EACN;GACC,UAAU,EAAE,OAAO;GACnB,GAAGC;GACH;EACD;GACC,OAAO,CAAC,WAAW;GACnB,GAAGC;GACH;EACD,GAAG;EACH"}
1
+ {"version":3,"file":"index.mjs","names":["config","config","config","configPath","config","_includeIgnoreFile","eslintDefineConfig","configIgnores","configBase","configConfigFiles","configPrettier","configReact"],"sources":["../src/config-base/index.ts","../src/config-config-files/index.ts","../src/config-react/index.ts","../src/config-ignores/index.ts","../src/config-prettier/index.ts","../src/define-config/index.ts"],"sourcesContent":["import type { LinterConfigEntry } from '../types/index.d.ts';\nimport pluginPerfectionist from 'eslint-plugin-perfectionist';\nimport tseslint from 'typescript-eslint';\n\n/**\n * This config is intentionally limited to rules not supported by Oxlint\n * and formatting options not supported by Prettier.\n */\nconst config: LinterConfigEntry = {\n\tname: 'Base Config',\n\tplugins: {\n\t\t'@typescript-eslint': tseslint.plugin,\n\t\t'perfectionist': pluginPerfectionist,\n\t},\n\tlanguageOptions: {\n\t\tparser: tseslint.parser,\n\t\tparserOptions: {\n\t\t\tprojectService: true,\n\t\t},\n\t},\n\tlinterOptions: {\n\t\treportUnusedDisableDirectives: 'error',\n\t\treportUnusedInlineConfigs: 'error',\n\t},\n\trules: {\n\t\t/* oxlint-disable-next-line unicorn/no-useless-spread */\n\t\t...{\n\t\t\t'camelcase': ['error', { properties: 'always' }],\n\t\t\t'dot-notation': 'error',\n\t\t\t'func-name-matching': [\n\t\t\t\t'error',\n\t\t\t\t'never',\n\t\t\t\t{ considerPropertyDescriptor: true },\n\t\t\t],\n\t\t},\n\t\t'@typescript-eslint/consistent-type-assertions': [\n\t\t\t'error',\n\t\t\t{\n\t\t\t\tassertionStyle: 'as',\n\t\t\t\tobjectLiteralTypeAssertions: 'allow-as-parameter',\n\t\t\t},\n\t\t],\n\t\t'@typescript-eslint/consistent-type-exports': [\n\t\t\t'error',\n\t\t\t{ fixMixedExportsWithInlineTypeSpecifier: true },\n\t\t],\n\t\t'@typescript-eslint/no-unnecessary-qualifier': 'error',\n\t\t'@typescript-eslint/no-useless-default-assignment': 'error',\n\t\t'@typescript-eslint/parameter-properties': [\n\t\t\t'error',\n\t\t\t{ prefer: 'parameter-property' },\n\t\t],\n\t\t'@typescript-eslint/prefer-readonly': 'error',\n\t\t'perfectionist/sort-array-includes': ['error', { type: 'natural' }],\n\t\t'perfectionist/sort-classes': [\n\t\t\t'error',\n\t\t\t{\n\t\t\t\tgroups: ['property', 'constructor'],\n\t\t\t\ttype: 'natural',\n\t\t\t},\n\t\t],\n\t\t'perfectionist/sort-exports': ['error', { type: 'natural' }],\n\t\t'perfectionist/sort-imports': [\n\t\t\t'error',\n\t\t\t{\n\t\t\t\tcustomGroups: [\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'mock-side-effect',\n\t\t\t\t\t\telementNamePattern: '^.*/_*(mocks)_*/.*$',\n\t\t\t\t\t\tselector: 'side-effect',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'mock',\n\t\t\t\t\t\telementNamePattern: '^.*/_*(mocks)_*/.*$',\n\t\t\t\t\t\tselector: 'import',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tgroups: [\n\t\t\t\t\t'mock-side-effect',\n\t\t\t\t\t'mock',\n\t\t\t\t\t['type-builtin', 'type-external'],\n\t\t\t\t\t'type-internal',\n\t\t\t\t\t['type-parent', 'type-sibling', 'type-index'],\n\t\t\t\t\t['value-builtin', 'value-external'],\n\t\t\t\t\t'value-internal',\n\t\t\t\t\t['value-parent', 'value-sibling', 'value-index'],\n\t\t\t\t\t'unknown',\n\t\t\t\t\t'style',\n\t\t\t\t\t'side-effect',\n\t\t\t\t\t'side-effect-style',\n\t\t\t\t],\n\t\t\t\tinternalPattern: ['^(#|@/).*'],\n\t\t\t\tnewlinesBetween: 0,\n\t\t\t\tsortSideEffects: true,\n\t\t\t\ttype: 'natural',\n\t\t\t},\n\t\t],\n\t\t'perfectionist/sort-interfaces': [\n\t\t\t'error',\n\t\t\t{\n\t\t\t\tgroups: ['index-signature', 'unknown', 'method'],\n\t\t\t\ttype: 'natural',\n\t\t\t},\n\t\t],\n\t\t'perfectionist/sort-intersection-types': ['error', { type: 'natural' }],\n\t\t'perfectionist/sort-named-exports': ['error', { type: 'natural' }],\n\t\t'perfectionist/sort-named-imports': ['error', { type: 'natural' }],\n\t\t'perfectionist/sort-object-types': [\n\t\t\t'error',\n\t\t\t{\n\t\t\t\tgroups: ['index-signature', 'unknown', 'method'],\n\t\t\t\ttype: 'natural',\n\t\t\t},\n\t\t],\n\t\t'perfectionist/sort-objects': [\n\t\t\t'error',\n\t\t\t{\n\t\t\t\ttype: 'natural',\n\t\t\t\tuseConfigurationIf: {\n\t\t\t\t\tobjectType: 'destructured',\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'unsorted',\n\t\t\t\tuseConfigurationIf: {\n\t\t\t\t\tobjectType: 'non-destructured',\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t\t'perfectionist/sort-union-types': [\n\t\t\t'error',\n\t\t\t{\n\t\t\t\tcustomGroups: [\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'false',\n\t\t\t\t\t\telementNamePattern: '^false$',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'never',\n\t\t\t\t\t\telementNamePattern: '^never$',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'react',\n\t\t\t\t\t\telementNamePattern: '^react.+',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tgroups: [\n\t\t\t\t\t'react',\n\t\t\t\t\t'unknown',\n\t\t\t\t\t'tuple',\n\t\t\t\t\t'false',\n\t\t\t\t\t'nullish',\n\t\t\t\t\t'never',\n\t\t\t\t],\n\t\t\t\ttype: 'natural',\n\t\t\t},\n\t\t],\n\t},\n};\n\nexport default config;\n","import type { LinterConfigEntry } from '../types/index.d.ts';\nimport pluginPerfectionist from 'eslint-plugin-perfectionist';\n\nconst config: LinterConfigEntry = {\n\tname: 'Config Files',\n\tplugins: {\n\t\tperfectionist: pluginPerfectionist,\n\t},\n\trules: {\n\t\t'perfectionist/sort-objects': [\n\t\t\t'error',\n\t\t\t{\n\t\t\t\tcustomGroups: [\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'extends',\n\t\t\t\t\t\telementNamePattern: '^extends$',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'files',\n\t\t\t\t\t\telementNamePattern: '^files$',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'ignores',\n\t\t\t\t\t\telementNamePattern: '^(ignores|ignorePatterns)$',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'name',\n\t\t\t\t\t\telementNamePattern: '^(name|groupName)$',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'overrides',\n\t\t\t\t\t\telementNamePattern: '^overrides$',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'plugins',\n\t\t\t\t\t\telementNamePattern: '^plugins$',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'rules',\n\t\t\t\t\t\telementNamePattern: '^rules$',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tgroups: [\n\t\t\t\t\t'name',\n\t\t\t\t\t'files',\n\t\t\t\t\t'extends',\n\t\t\t\t\t'ignores',\n\t\t\t\t\t'plugins',\n\t\t\t\t\t'unknown',\n\t\t\t\t\t'rules',\n\t\t\t\t\t'overrides',\n\t\t\t\t],\n\t\t\t\tnewlinesBetween: 0,\n\t\t\t\ttype: 'natural',\n\t\t\t},\n\t\t],\n\t},\n};\n\nexport default config;\n","import type { ESLint } from 'eslint';\nimport type { LinterConfigEntry } from '../types/index.d.ts';\nimport pluginPerfectionist from 'eslint-plugin-perfectionist';\nimport pluginReact from 'eslint-plugin-react';\nimport pluginReactHooks from 'eslint-plugin-react-hooks';\n\n/**\n * This config is intentionally limited to rules not supported by Oxlint\n * and formatting options not supported by Prettier.\n */\nconst config: LinterConfigEntry = {\n\tname: 'React',\n\tplugins: {\n\t\t'perfectionist': pluginPerfectionist,\n\t\t'react': pluginReact,\n\t\t'react-hooks': pluginReactHooks as ESLint.Plugin,\n\t},\n\trules: {\n\t\t'perfectionist/sort-jsx-props': [\n\t\t\t'error',\n\t\t\t{\n\t\t\t\tcustomGroups: [\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'as',\n\t\t\t\t\t\telementNamePattern: '^as$',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'callback',\n\t\t\t\t\t\telementNamePattern: '^on.+',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'children',\n\t\t\t\t\t\telementNamePattern: '^children$',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'key',\n\t\t\t\t\t\telementNamePattern: '^key$',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'ref',\n\t\t\t\t\t\telementNamePattern: '^ref$',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tgroupName: 'unsafe',\n\t\t\t\t\t\telementNamePattern: '^dangerously.+',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tgroups: [\n\t\t\t\t\t'key',\n\t\t\t\t\t'ref',\n\t\t\t\t\t'as',\n\t\t\t\t\t'unknown',\n\t\t\t\t\t'shorthand-prop',\n\t\t\t\t\t'callback',\n\t\t\t\t\t'children',\n\t\t\t\t\t'unsafe',\n\t\t\t\t],\n\t\t\t\ttype: 'unsorted',\n\t\t\t},\n\t\t],\n\t\t'react/destructuring-assignment': ['error', 'always'],\n\t\t'react/function-component-definition': [\n\t\t\t'error',\n\t\t\t{\n\t\t\t\tnamedComponents: ['arrow-function', 'function-declaration'],\n\t\t\t\tunnamedComponents: 'arrow-function',\n\t\t\t},\n\t\t],\n\t\t'react/hook-use-state': 'error',\n\t\t'react/jsx-no-constructed-context-values': 'error',\n\t\t'react/no-adjacent-inline-elements': 'error',\n\t\t'react/no-unstable-nested-components': 'error',\n\n\t\t// Enforce all `react-hooks` rules as errors\n\t\t...Object.fromEntries(\n\t\t\tObject.keys(\n\t\t\t\tpluginReactHooks.configs.flat['recommended-latest'].rules\n\t\t\t).map((rule) => [rule, 'error'])\n\t\t),\n\t},\n};\n\nexport default config;\n","import type { LinterConfigEntry } from '../types/index.d.ts';\nimport { includeIgnoreFile as _includeIgnoreFile } from '@eslint/compat';\nimport fs from 'node:fs';\nimport path from 'node:path';\n\nconst configPath = path.resolve('.gitignore');\nconst configExists = fs.existsSync(configPath);\n\nconst config: LinterConfigEntry = configExists\n\t? _includeIgnoreFile(configPath, '.gitignore')\n\t: {};\n\nexport default config;\n","import type { LinterConfigEntry } from '../types/index.d.ts';\nimport pluginPrettier from 'eslint-plugin-prettier/recommended';\nimport fs from 'node:fs';\nimport path from 'node:path';\n\nconst configPath = path.resolve('prettier.config.ts');\nconst configExists = fs.existsSync(configPath);\n\nconst config: LinterConfigEntry = configExists ? pluginPrettier : {};\n\nexport default config;\n","import type { Config } from 'eslint/config';\nimport pluginOxlint from 'eslint-plugin-oxlint';\nimport { defineConfig as eslintDefineConfig } from 'eslint/config';\nimport configBase from '../config-base/index.ts';\nimport configConfigFiles from '../config-config-files/index.ts';\nimport configIgnores from '../config-ignores/index.ts';\nimport configPrettier from '../config-prettier/index.ts';\nimport configReact from '../config-react/index.ts';\n\n/**\n * Combine Standard Config with optional additional config.\n */\nexport default function defineConfig(\n\t...configs: Parameters<typeof eslintDefineConfig>\n): Config[] {\n\tconst configExtension =\n\t\tconfigs.length > 0 ? eslintDefineConfig(...configs) : [];\n\n\treturn eslintDefineConfig({\n\t\tname: 'Standard Config',\n\t\tfiles: ['**/*.{ts,tsx,cts,mts}'],\n\t\textends: [\n\t\t\tconfigIgnores,\n\t\t\tconfigBase,\n\t\t\t{\n\t\t\t\tfiles: ['**/*.config.{ts,cts,mts}'],\n\t\t\t\t...configConfigFiles,\n\t\t\t},\n\t\t\tincludeReactConfig(configExtension),\n\t\t\tpluginOxlint.configs['flat/all'],\n\t\t\tconfigPrettier,\n\t\t],\n\t});\n}\n\nfunction includeReactConfig(configs: Config[]): Config[] {\n\tlet react: unknown;\n\n\tfor (const { settings } of configs.toReversed()) {\n\t\tif (settings?.react && typeof settings?.react === 'object') {\n\t\t\treact = settings.react;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tif (!react) {\n\t\treturn configs;\n\t}\n\n\treturn [\n\t\t{\n\t\t\tsettings: { react },\n\t\t\t...configReact,\n\t\t},\n\t\t...configs,\n\t];\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAQA,MAAMA,WAA4B;CACjC,MAAM;CACN,SAAS;EACR,sBAAsB,SAAS;EAC/B,iBAAiB;EACjB;CACD,iBAAiB;EAChB,QAAQ,SAAS;EACjB,eAAe,EACd,gBAAgB,MAChB;EACD;CACD,eAAe;EACd,+BAA+B;EAC/B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AM;GACN,CACD;EACD,8BAA8B;GAC7B;GACA;IACC,MAAM;IACN,oBAAoB,EACnB,YAAY,gBACZ;IACD;GACD;IACC,MAAM;IACN,oBAAoB,EACnB,YAAY,oBACZ;IACD;GACD;EACD,kCAAkC,CACjC,SACA;GACC,cAAc;IACb;KACC,WAAW;KACX,oBAAoB;KACpB;IACD;KACC,WAAW;KACX,oBAAoB;KACpB;IACD;KACC,WAAW;KACX,oBAAoB;KACpB;IACD;GACD,QAAQ;IACP;IACA;IACA;IACA;IACA;IACA;IACA;GACD,MAAM;GACN,CACD;EACD;CACD;AAED,0BAAeA;;;;AC7Jf,MAAMC,WAA4B;CACjC,MAAM;CACN,SAAS,EACR,eAAe,qBACf;CACD,OAAO,EACN,8BAA8B,CAC7B,SACA;EACC,cAAc;GACb;IACC,WAAW;IACX,oBAAoB;IACpB;GACD;IACC,WAAW;IACX,oBAAoB;IACpB;GACD;IACC,WAAW;IACX,oBAAoB;IACpB;GACD;IACC,WAAW;IACX,oBAAoB;IACpB;GACD;IACC,WAAW;IACX,oBAAoB;IACpB;GACD;IACC,WAAW;IACX,oBAAoB;IACpB;GACD;IACC,WAAW;IACX,oBAAoB;IACpB;GACD;EACD,QAAQ;GACP;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACD,iBAAiB;EACjB,MAAM;EACN,CACD,EACD;CACD;AAED,kCAAeA;;;;;;;;ACjDf,MAAMC,WAA4B;CACjC,MAAM;CACN,SAAS;EACR,iBAAiB;EACjB,SAAS;EACT,eAAe;EACf;CACD,OAAO;EACN,gCAAgC,CAC/B,SACA;GACC,cAAc;IACb;KACC,WAAW;KACX,oBAAoB;KACpB;IACD;KACC,WAAW;KACX,oBAAoB;KACpB;IACD;KACC,WAAW;KACX,oBAAoB;KACpB;IACD;KACC,WAAW;KACX,oBAAoB;KACpB;IACD;KACC,WAAW;KACX,oBAAoB;KACpB;IACD;KACC,WAAW;KACX,oBAAoB;KACpB;IACD;GACD,QAAQ;IACP;IACA;IAC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
1
1
  {
2
- "name": "@standard-config/eslint",
3
- "version": "1.2.0",
4
- "description": "TypeScript-first ESLint config designed to complement Oxlint and Prettier",
5
- "license": "MIT",
6
- "author": {
7
- "name": "Dom Porada",
8
- "email": "dom@dom.engineering",
9
- "url": "https://dom.engineering"
10
- },
11
- "repository": {
12
- "type": "git",
13
- "url": "git+https://github.com/standard-config/eslint.git"
14
- },
15
- "keywords": [
16
- "eslint",
17
- "eslint-config",
18
- "flat-config",
19
- "oxc",
20
- "oxlint",
21
- "prettier",
22
- "react",
23
- "typescript"
24
- ],
25
- "files": [
26
- "dist/**"
27
- ],
28
- "type": "module",
29
- "sideEffects": false,
30
- "exports": "./dist/index.mjs",
31
- "types": "./dist/index.d.mts",
32
- "engines": {
33
- "node": ">=22"
34
- },
35
- "packageManager": "pnpm@10.28.1",
36
- "dependencies": {
37
- "@eslint/compat": "^2.0.1",
38
- "eslint-config-prettier": "^10.1.8",
39
- "eslint-plugin-oxlint": "^1.41.0",
40
- "eslint-plugin-perfectionist": "^5.4.0",
41
- "eslint-plugin-prettier": "^5.5.5",
42
- "eslint-plugin-react": "^7.37.5",
43
- "eslint-plugin-react-hooks": "^7.0.1",
44
- "typescript-eslint": "^8.53.1"
45
- },
46
- "peerDependencies": {
47
- "eslint": ">=9",
48
- "typescript": ">=5"
49
- },
50
- "devDependencies": {
51
- "@standard-config/prettier": "1.6.0",
52
- "@standard-config/tsconfig": "2.0.0",
53
- "@types/node": "^22.19.7",
54
- "@vitest/coverage-v8": "4.0.18",
55
- "eslint": "9.39.2",
56
- "husky": "9.1.7",
57
- "jiti": "2.6.1",
58
- "oxlint": "1.41.0",
59
- "oxlint-tsgolint": "0.11.1",
60
- "prettier": "3.8.1",
61
- "publint": "0.3.17",
62
- "tsdown": "0.20.1",
63
- "typescript": "5.9.3",
64
- "vitest": "4.0.18"
65
- },
66
- "scripts": {
67
- "build": "tsdown",
68
- "fix": "pnpm format && pnpm lint",
69
- "format": "prettier --write --ignore-unknown .",
70
- "format:check": "prettier --check --ignore-unknown .",
71
- "lint": "oxlint --fix --type-aware --type-check --deny-warnings --report-unused-disable-directives && eslint . --fix",
72
- "lint:check": "oxlint --type-aware --type-check --deny-warnings --report-unused-disable-directives && eslint .",
73
- "prepack": "pnpm run '/^(format:check|lint:check|test|typecheck)$/' && pnpm build",
74
- "prepare": "husky",
75
- "test": "vitest run",
76
- "typecheck": "tsc --noEmit"
77
- }
78
- }
2
+ "name": "@standard-config/eslint",
3
+ "version": "1.3.0",
4
+ "description": "TypeScript-first ESLint config designed to complement Oxlint and Prettier",
5
+ "license": "MIT",
6
+ "author": {
7
+ "name": "Dom Porada",
8
+ "email": "dom@dom.engineering",
9
+ "url": "https://dom.engineering"
10
+ },
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "git+https://github.com/standard-config/eslint.git"
14
+ },
15
+ "keywords": [
16
+ "eslint",
17
+ "eslint-config",
18
+ "flat-config",
19
+ "oxc",
20
+ "oxlint",
21
+ "prettier",
22
+ "react",
23
+ "standard-config",
24
+ "type-aware",
25
+ "typescript"
26
+ ],
27
+ "files": [
28
+ "dist/**"
29
+ ],
30
+ "type": "module",
31
+ "sideEffects": false,
32
+ "exports": "./dist/index.mjs",
33
+ "types": "./dist/index.d.mts",
34
+ "engines": {
35
+ "node": ">=20"
36
+ },
37
+ "dependencies": {
38
+ "@eslint/compat": "^2.0.2",
39
+ "eslint-config-prettier": "^10.1.8",
40
+ "eslint-plugin-oxlint": "^1.43.0",
41
+ "eslint-plugin-perfectionist": "^5.4.0",
42
+ "eslint-plugin-prettier": "^5.5.5",
43
+ "eslint-plugin-react": "^7.37.5",
44
+ "eslint-plugin-react-hooks": "^7.0.1",
45
+ "typescript-eslint": "^8.54.0"
46
+ },
47
+ "peerDependencies": {
48
+ "eslint": ">=9",
49
+ "typescript": ">=5"
50
+ },
51
+ "devDependencies": {
52
+ "@standard-config/prettier": "1.8.0",
53
+ "@standard-config/tsconfig": "2.0.2",
54
+ "@types/node": "^22.19.8",
55
+ "@vitest/coverage-v8": "4.0.18",
56
+ "eslint": "9.39.2",
57
+ "husky": "9.1.7",
58
+ "jiti": "2.6.1",
59
+ "oxlint": "1.43.0",
60
+ "oxlint-tsgolint": "0.11.4",
61
+ "prettier": "3.8.1",
62
+ "publint": "0.3.17",
63
+ "tsdown": "0.20.1",
64
+ "typescript": "5.9.3",
65
+ "vitest": "4.0.18"
66
+ },
67
+ "scripts": {
68
+ "build": "tsdown",
69
+ "fix": "pnpm format && pnpm lint",
70
+ "format": "prettier --write --ignore-unknown .",
71
+ "format:check": "prettier --check --ignore-unknown .",
72
+ "lint": "oxlint --fix --type-aware --type-check --deny-warnings --report-unused-disable-directives && eslint . --fix",
73
+ "lint:check": "oxlint --type-aware --type-check --deny-warnings --report-unused-disable-directives && eslint .",
74
+ "test": "vitest run",
75
+ "typecheck": "tsc --noEmit"
76
+ }
77
+ }