@standard-config/eslint 1.1.0 → 1.2.1
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 +4 -3
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +55 -47
- package/dist/index.mjs.map +1 -1
- package/package.json +74 -75
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
|
|
|
@@ -40,9 +40,10 @@ export default defineConfig({
|
|
|
40
40
|
});
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
-
##
|
|
43
|
+
## Related
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
- [**@standard-config/prettier**](https://github.com/standard-config/prettier)
|
|
46
|
+
- [**@standard-config/tsconfig**](https://github.com/standard-config/tsconfig)
|
|
46
47
|
|
|
47
48
|
## License
|
|
48
49
|
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/define-config/index.ts"],"mappings":";;;;AACmE;;
|
|
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"}
|
package/dist/index.mjs
CHANGED
|
@@ -4,43 +4,44 @@ import { includeIgnoreFile } from "@eslint/compat";
|
|
|
4
4
|
import fs from "node:fs";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import pluginOxlint from "eslint-plugin-oxlint";
|
|
7
|
+
import pluginPrettier from "eslint-plugin-prettier/recommended";
|
|
7
8
|
import pluginReact from "eslint-plugin-react";
|
|
8
9
|
import pluginReactHooks from "eslint-plugin-react-hooks";
|
|
9
10
|
import tseslint from "typescript-eslint";
|
|
10
11
|
|
|
11
12
|
//#region src/config-formatting-config-files/index.ts
|
|
12
|
-
const config$
|
|
13
|
+
const config$8 = {
|
|
13
14
|
name: "Formatting (Config Files)",
|
|
14
15
|
plugins: { perfectionist: pluginPerfectionist },
|
|
15
16
|
rules: { "perfectionist/sort-objects": ["error", {
|
|
16
17
|
customGroups: [
|
|
17
18
|
{
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
groupName: "extends",
|
|
20
|
+
elementNamePattern: "^extends$"
|
|
20
21
|
},
|
|
21
22
|
{
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
groupName: "files",
|
|
24
|
+
elementNamePattern: "^files$"
|
|
24
25
|
},
|
|
25
26
|
{
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
groupName: "ignores",
|
|
28
|
+
elementNamePattern: "^(ignores|ignorePatterns)$"
|
|
28
29
|
},
|
|
29
30
|
{
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
groupName: "name",
|
|
32
|
+
elementNamePattern: "^(name|groupName)$"
|
|
32
33
|
},
|
|
33
34
|
{
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
groupName: "overrides",
|
|
36
|
+
elementNamePattern: "^overrides$"
|
|
36
37
|
},
|
|
37
38
|
{
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
groupName: "plugins",
|
|
40
|
+
elementNamePattern: "^plugins$"
|
|
40
41
|
},
|
|
41
42
|
{
|
|
42
|
-
|
|
43
|
-
|
|
43
|
+
groupName: "rules",
|
|
44
|
+
elementNamePattern: "^rules$"
|
|
44
45
|
}
|
|
45
46
|
],
|
|
46
47
|
groups: [
|
|
@@ -57,38 +58,38 @@ const config$7 = {
|
|
|
57
58
|
type: "natural"
|
|
58
59
|
}] }
|
|
59
60
|
};
|
|
60
|
-
var config_formatting_config_files_default = config$
|
|
61
|
+
var config_formatting_config_files_default = config$8;
|
|
61
62
|
|
|
62
63
|
//#endregion
|
|
63
64
|
//#region src/config-formatting-react/index.ts
|
|
64
|
-
const config$
|
|
65
|
+
const config$7 = {
|
|
65
66
|
name: "Formatting (React)",
|
|
66
67
|
plugins: { perfectionist: pluginPerfectionist },
|
|
67
68
|
rules: { "perfectionist/sort-jsx-props": ["error", {
|
|
68
69
|
customGroups: [
|
|
69
70
|
{
|
|
70
|
-
|
|
71
|
-
|
|
71
|
+
groupName: "as",
|
|
72
|
+
elementNamePattern: "^as$"
|
|
72
73
|
},
|
|
73
74
|
{
|
|
74
|
-
|
|
75
|
-
|
|
75
|
+
groupName: "callback",
|
|
76
|
+
elementNamePattern: "^on.+"
|
|
76
77
|
},
|
|
77
78
|
{
|
|
78
|
-
|
|
79
|
-
|
|
79
|
+
groupName: "children",
|
|
80
|
+
elementNamePattern: "^children$"
|
|
80
81
|
},
|
|
81
82
|
{
|
|
82
|
-
|
|
83
|
-
|
|
83
|
+
groupName: "key",
|
|
84
|
+
elementNamePattern: "^key$"
|
|
84
85
|
},
|
|
85
86
|
{
|
|
86
|
-
|
|
87
|
-
|
|
87
|
+
groupName: "ref",
|
|
88
|
+
elementNamePattern: "^ref$"
|
|
88
89
|
},
|
|
89
90
|
{
|
|
90
|
-
|
|
91
|
-
|
|
91
|
+
groupName: "unsafe",
|
|
92
|
+
elementNamePattern: "^dangerously.+"
|
|
92
93
|
}
|
|
93
94
|
],
|
|
94
95
|
groups: [
|
|
@@ -104,7 +105,7 @@ const config$6 = {
|
|
|
104
105
|
type: "unsorted"
|
|
105
106
|
}] }
|
|
106
107
|
};
|
|
107
|
-
var config_formatting_react_default = config$
|
|
108
|
+
var config_formatting_react_default = config$7;
|
|
108
109
|
|
|
109
110
|
//#endregion
|
|
110
111
|
//#region src/config-formatting/index.ts
|
|
@@ -112,7 +113,7 @@ var config_formatting_react_default = config$6;
|
|
|
112
113
|
* This config is intentionally limited to formatting options
|
|
113
114
|
* not supported by Prettier.
|
|
114
115
|
*/
|
|
115
|
-
const config$
|
|
116
|
+
const config$6 = {
|
|
116
117
|
name: "Formatting",
|
|
117
118
|
plugins: { perfectionist: pluginPerfectionist },
|
|
118
119
|
rules: {
|
|
@@ -124,12 +125,12 @@ const config$5 = {
|
|
|
124
125
|
"perfectionist/sort-exports": ["error", { type: "natural" }],
|
|
125
126
|
"perfectionist/sort-imports": ["error", {
|
|
126
127
|
customGroups: [{
|
|
127
|
-
elementNamePattern: "^.*/_*(mocks)_*/.*$",
|
|
128
128
|
groupName: "mock-side-effect",
|
|
129
|
+
elementNamePattern: "^.*/_*(mocks)_*/.*$",
|
|
129
130
|
selector: "side-effect"
|
|
130
131
|
}, {
|
|
131
|
-
elementNamePattern: "^.*/_*(mocks)_*/.*$",
|
|
132
132
|
groupName: "mock",
|
|
133
|
+
elementNamePattern: "^.*/_*(mocks)_*/.*$",
|
|
133
134
|
selector: "import"
|
|
134
135
|
}],
|
|
135
136
|
groups: [
|
|
@@ -192,16 +193,16 @@ const config$5 = {
|
|
|
192
193
|
"perfectionist/sort-union-types": ["error", {
|
|
193
194
|
customGroups: [
|
|
194
195
|
{
|
|
195
|
-
|
|
196
|
-
|
|
196
|
+
groupName: "false",
|
|
197
|
+
elementNamePattern: "^false$"
|
|
197
198
|
},
|
|
198
199
|
{
|
|
199
|
-
|
|
200
|
-
|
|
200
|
+
groupName: "never",
|
|
201
|
+
elementNamePattern: "^never$"
|
|
201
202
|
},
|
|
202
203
|
{
|
|
203
|
-
|
|
204
|
-
|
|
204
|
+
groupName: "react",
|
|
205
|
+
elementNamePattern: "^react.+"
|
|
205
206
|
}
|
|
206
207
|
],
|
|
207
208
|
groups: [
|
|
@@ -216,22 +217,28 @@ const config$5 = {
|
|
|
216
217
|
}]
|
|
217
218
|
}
|
|
218
219
|
};
|
|
219
|
-
var config_formatting_default = config$
|
|
220
|
+
var config_formatting_default = config$6;
|
|
220
221
|
|
|
221
222
|
//#endregion
|
|
222
223
|
//#region src/config-ignores/index.ts
|
|
223
|
-
const configPath$
|
|
224
|
-
const config$
|
|
224
|
+
const configPath$2 = path.resolve(".gitignore");
|
|
225
|
+
const config$5 = [fs.existsSync(configPath$2) ? includeIgnoreFile(configPath$2, ".gitignore") : {}, {
|
|
225
226
|
name: "Ignored Paths",
|
|
226
227
|
ignores: ["**/fixtures/**"]
|
|
227
228
|
}];
|
|
228
|
-
var config_ignores_default = config$
|
|
229
|
+
var config_ignores_default = config$5;
|
|
229
230
|
|
|
230
231
|
//#endregion
|
|
231
232
|
//#region src/config-oxlint/index.ts
|
|
232
|
-
const configPath = path.resolve(".oxlintrc.json");
|
|
233
|
-
const config$
|
|
234
|
-
var config_oxlint_default = config$
|
|
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;
|
|
235
242
|
|
|
236
243
|
//#endregion
|
|
237
244
|
//#region src/config-react/index.ts
|
|
@@ -323,7 +330,8 @@ function defineConfig(...configs) {
|
|
|
323
330
|
...config_formatting_config_files_default
|
|
324
331
|
},
|
|
325
332
|
includeReactConfig(configExtension),
|
|
326
|
-
config_oxlint_default
|
|
333
|
+
config_oxlint_default,
|
|
334
|
+
config_prettier_default
|
|
327
335
|
]
|
|
328
336
|
});
|
|
329
337
|
}
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["config","config","config","configPath","config","_includeIgnoreFile","config","config","config","eslintDefineConfig","configIgnores","configTypeScriptSettings","configTypeScript","configFormatting","configFormattingConfigFiles","configOxlint","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-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\telementNamePattern: '^extends$',\n\t\t\t\t\t\tgroupName: 'extends',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\telementNamePattern: '^files$',\n\t\t\t\t\t\tgroupName: 'files',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\telementNamePattern: '^(ignores|ignorePatterns)$',\n\t\t\t\t\t\tgroupName: 'ignores',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\telementNamePattern: '^name$',\n\t\t\t\t\t\tgroupName: 'name',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\telementNamePattern: '^overrides$',\n\t\t\t\t\t\tgroupName: 'overrides',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\telementNamePattern: '^plugins$',\n\t\t\t\t\t\tgroupName: 'plugins',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\telementNamePattern: '^rules$',\n\t\t\t\t\t\tgroupName: '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\telementNamePattern: '^as$',\n\t\t\t\t\t\tgroupName: 'as',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\telementNamePattern: '^on.+',\n\t\t\t\t\t\tgroupName: 'callback',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\telementNamePattern: '^children$',\n\t\t\t\t\t\tgroupName: 'children',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\telementNamePattern: '^key$',\n\t\t\t\t\t\tgroupName: 'key',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\telementNamePattern: '^ref$',\n\t\t\t\t\t\tgroupName: 'ref',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\telementNamePattern: '^dangerously.+',\n\t\t\t\t\t\tgroupName: 'unsafe',\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\telementNamePattern: '^.*/_*(mocks)_*/.*$',\n\t\t\t\t\t\tgroupName: 'mock-side-effect',\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\telementNamePattern: '^.*/_*(mocks)_*/.*$',\n\t\t\t\t\t\tgroupName: 'mock',\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\telementNamePattern: '^false$',\n\t\t\t\t\t\tgroupName: 'false',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\telementNamePattern: '^never$',\n\t\t\t\t\t\tgroupName: 'never',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\telementNamePattern: '^react.+',\n\t\t\t\t\t\tgroupName: '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 { 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 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],\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,oBAAoB;IACpB,WAAW;IACX;GACD;IACC,oBAAoB;IACpB,WAAW;IACX;GACD;IACC,oBAAoB;IACpB,WAAW;IACX;GACD;IACC,oBAAoB;IACpB,WAAW;IACX;GACD;IACC,oBAAoB;IACpB,WAAW;IACX;GACD;IACC,oBAAoB;IACpB,WAAW;IACX;GACD;IACC,oBAAoB;IACpB,WAAW;IACX;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,oBAAoB;IACpB,WAAW;IACX;GACD;IACC,oBAAoB;IACpB,WAAW;IACX;GACD;IACC,oBAAoB;IACpB,WAAW;IACX;GACD;IACC,oBAAoB;IACpB,WAAW;IACX;GACD;IACC,oBAAoB;IACpB,WAAW;IACX;GACD;IACC,oBAAoB;IACpB,WAAW;IACX;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,oBAAoB;IACpB,WAAW;IACX,UAAU;IACV,EACD;IACC,oBAAoB;IACpB,WAAW;IACX,UAAU;IACV,CACD;GACD,QAAQ;IACP;IACA;IACA,CAAC,gBAAgB,gBAAgB;IACjC;IACA;KAAC;KAAe;KAAgB;KAAa;IAC7C,CAAC,iBAAiB,iBAAiB;IACnC;IACA;KAAC;KAAgB;KAAiB;KAAc;IAChD;IACA;IACA;IACA;IACA;GACD,iBAAiB,CAAC,YAAY;GAC9B,iBAAiB;GACjB,iBAAiB;GACjB,MAAM;G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AI,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","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,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|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
2
|
+
"name": "@standard-config/eslint",
|
|
3
|
+
"version": "1.2.1",
|
|
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": ">=20"
|
|
34
|
+
},
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"@eslint/compat": "^2.0.1",
|
|
37
|
+
"eslint-config-prettier": "^10.1.8",
|
|
38
|
+
"eslint-plugin-oxlint": "^1.41.0",
|
|
39
|
+
"eslint-plugin-perfectionist": "^5.4.0",
|
|
40
|
+
"eslint-plugin-prettier": "^5.5.5",
|
|
41
|
+
"eslint-plugin-react": "^7.37.5",
|
|
42
|
+
"eslint-plugin-react-hooks": "^7.0.1",
|
|
43
|
+
"typescript-eslint": "^8.53.1"
|
|
44
|
+
},
|
|
45
|
+
"peerDependencies": {
|
|
46
|
+
"eslint": ">=9",
|
|
47
|
+
"typescript": ">=5"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@standard-config/prettier": "1.6.0",
|
|
51
|
+
"@standard-config/tsconfig": "2.0.1",
|
|
52
|
+
"@types/node": "^22.19.7",
|
|
53
|
+
"@vitest/coverage-v8": "4.0.18",
|
|
54
|
+
"eslint": "9.39.2",
|
|
55
|
+
"husky": "9.1.7",
|
|
56
|
+
"jiti": "2.6.1",
|
|
57
|
+
"oxlint": "1.41.0",
|
|
58
|
+
"oxlint-tsgolint": "0.11.2",
|
|
59
|
+
"prettier": "3.8.1",
|
|
60
|
+
"publint": "0.3.17",
|
|
61
|
+
"tsdown": "0.20.1",
|
|
62
|
+
"typescript": "5.9.3",
|
|
63
|
+
"vitest": "4.0.18"
|
|
64
|
+
},
|
|
65
|
+
"scripts": {
|
|
66
|
+
"build": "tsdown",
|
|
67
|
+
"fix": "pnpm format && pnpm lint",
|
|
68
|
+
"format": "prettier --write --ignore-unknown .",
|
|
69
|
+
"format:check": "prettier --check --ignore-unknown .",
|
|
70
|
+
"lint": "oxlint --fix --type-aware --type-check --deny-warnings --report-unused-disable-directives && eslint . --fix",
|
|
71
|
+
"lint:check": "oxlint --type-aware --type-check --deny-warnings --report-unused-disable-directives && eslint .",
|
|
72
|
+
"test": "vitest run",
|
|
73
|
+
"typecheck": "tsc --noEmit"
|
|
74
|
+
}
|
|
75
|
+
}
|