@standard-config/eslint 1.4.0 → 1.5.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/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +116 -14
- package/dist/index.mjs.map +1 -1
- package/package.json +21 -18
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":["Linter","defineConfig","eslintDefineConfig","LinterConfigEntry","Config","Omit","InfiniteLinterConfig","Parameters","StandardConfig","ReadonlyArray","Exclude","react","InfiniteLinterConfigs","StandardConfigArray"],"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":";;;;KAGYG,iBAAAA,GAAoBE,IAAAA,CAAKL,MAAAA,CAAOI,MAAAA;AAAAA,KAEvCE,oBAAAA,GAAuBC,UAAAA,QAAkBL,cAAAA;AAAAA,KAElCM,cAAAA,GAAiBE,OAAAA,CAC5BJ,oBAAAA,EACAG,aAAAA;;;AAN4D;;EAY5DE,KAAAA;AAAAA;AAAAA,KAGIC,qBAAAA,IAAyBJ,cAAAA,KAAmBF,oBAAAA;AAAAA,KAErCO,mBAAAA,GACTP,oBAAAA,KACAM,qBAAAA,IACCA,qBAAAA,KAA0BN,oBAAAA;;;;;;AApB9B;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":["Linter","defineConfig","eslintDefineConfig","LinterConfigEntry","Config","Omit","InfiniteLinterConfig","Parameters","StandardConfig","ReadonlyArray","Exclude","react","InfiniteLinterConfigs","StandardConfigArray"],"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":";;;;KAGYG,iBAAAA,GAAoBE,IAAAA,CAAKL,MAAAA,CAAOI,MAAAA;AAAAA,KAEvCE,oBAAAA,GAAuBC,UAAAA,QAAkBL,cAAAA;AAAAA,KAElCM,cAAAA,GAAiBE,OAAAA,CAC5BJ,oBAAAA,EACAG,aAAAA;;;AAN4D;;EAY5DE,KAAAA;AAAAA;AAAAA,KAGIC,qBAAAA,IAAyBJ,cAAAA,KAAmBF,oBAAAA;AAAAA,KAErCO,mBAAAA,GACTP,oBAAAA,KACAM,qBAAAA,IACCA,qBAAAA,KAA0BN,oBAAAA;;;;;;AApB9B;cCMM,MAAA,EAAQ,iBAAA;;;cCNR,QAAA,EAAQ,iBAAA;;;;;;AFAd;cGSM,QAAA,EAAQ,iBAAA;;;;;AHTd;iBIQwB,YAAA,CAAA,GACpB,OAAA,EAAS,mBAAA,GACV,MAAA"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import pluginStylistic from "@stylistic/eslint-plugin";
|
|
1
2
|
import pluginPerfectionist from "eslint-plugin-perfectionist";
|
|
2
3
|
import tseslint from "typescript-eslint";
|
|
3
4
|
import pluginReact from "eslint-plugin-react";
|
|
4
5
|
import pluginReactHooks from "eslint-plugin-react-hooks";
|
|
5
|
-
import
|
|
6
|
+
import pluginReactNamingConvention from "eslint-plugin-react-naming-convention";
|
|
7
|
+
import pluginReactX from "eslint-plugin-react-x";
|
|
6
8
|
import { defineConfig as defineConfig$1 } from "eslint/config";
|
|
7
9
|
import { includeIgnoreFile } from "@eslint/compat";
|
|
8
10
|
import fs from "node:fs";
|
|
@@ -16,12 +18,16 @@ import path from "node:path";
|
|
|
16
18
|
const config = {
|
|
17
19
|
name: "Base Config",
|
|
18
20
|
plugins: {
|
|
21
|
+
"@stylistic": pluginStylistic,
|
|
19
22
|
"@typescript-eslint": tseslint.plugin,
|
|
20
23
|
"perfectionist": pluginPerfectionist
|
|
21
24
|
},
|
|
22
25
|
languageOptions: {
|
|
23
26
|
parser: tseslint.parser,
|
|
24
|
-
parserOptions: {
|
|
27
|
+
parserOptions: {
|
|
28
|
+
projectService: true,
|
|
29
|
+
warnOnUnsupportedTypeScriptVersion: false
|
|
30
|
+
}
|
|
25
31
|
},
|
|
26
32
|
linterOptions: {
|
|
27
33
|
reportUnusedDisableDirectives: "error",
|
|
@@ -35,10 +41,83 @@ const config = {
|
|
|
35
41
|
"never",
|
|
36
42
|
{ considerPropertyDescriptor: true }
|
|
37
43
|
],
|
|
38
|
-
"@
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
44
|
+
"@stylistic/lines-between-class-members": [
|
|
45
|
+
"error",
|
|
46
|
+
"always",
|
|
47
|
+
{ exceptAfterSingleLine: true }
|
|
48
|
+
],
|
|
49
|
+
"@stylistic/padding-line-between-statements": [
|
|
50
|
+
"error",
|
|
51
|
+
{
|
|
52
|
+
blankLine: "always",
|
|
53
|
+
next: "*",
|
|
54
|
+
prev: [
|
|
55
|
+
"block-like",
|
|
56
|
+
"directive",
|
|
57
|
+
"export",
|
|
58
|
+
"function",
|
|
59
|
+
"import",
|
|
60
|
+
"interface",
|
|
61
|
+
"type"
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
blankLine: "always",
|
|
66
|
+
next: [
|
|
67
|
+
"block-like",
|
|
68
|
+
"directive",
|
|
69
|
+
"export",
|
|
70
|
+
"function",
|
|
71
|
+
"import",
|
|
72
|
+
"interface",
|
|
73
|
+
"type"
|
|
74
|
+
],
|
|
75
|
+
prev: "*"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
blankLine: "always",
|
|
79
|
+
next: "*",
|
|
80
|
+
prev: ["case", "default"]
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
blankLine: "never",
|
|
84
|
+
next: "directive",
|
|
85
|
+
prev: "directive"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
blankLine: "any",
|
|
89
|
+
next: "export",
|
|
90
|
+
prev: "export"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
blankLine: "never",
|
|
94
|
+
next: ["function", "function-overload"],
|
|
95
|
+
prev: "function-overload"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
blankLine: "never",
|
|
99
|
+
next: "import",
|
|
100
|
+
prev: "import"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
blankLine: "any",
|
|
104
|
+
next: "interface",
|
|
105
|
+
prev: "interface"
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
blankLine: "any",
|
|
109
|
+
next: "type",
|
|
110
|
+
prev: "type"
|
|
111
|
+
}
|
|
112
|
+
],
|
|
113
|
+
"@stylistic/spaced-comment": [
|
|
114
|
+
"error",
|
|
115
|
+
"always",
|
|
116
|
+
{
|
|
117
|
+
block: { balanced: true },
|
|
118
|
+
line: { markers: ["/"] }
|
|
119
|
+
}
|
|
120
|
+
],
|
|
42
121
|
"@typescript-eslint/consistent-type-exports": ["error", { fixMixedExportsWithInlineTypeSpecifier: true }],
|
|
43
122
|
"@typescript-eslint/no-unnecessary-qualifier": "error",
|
|
44
123
|
"@typescript-eslint/no-useless-default-assignment": "error",
|
|
@@ -212,7 +291,9 @@ const config$2 = {
|
|
|
212
291
|
plugins: {
|
|
213
292
|
"perfectionist": pluginPerfectionist,
|
|
214
293
|
"react": pluginReact,
|
|
215
|
-
"react-hooks": pluginReactHooks
|
|
294
|
+
"react-hooks": pluginReactHooks,
|
|
295
|
+
"react-naming-convention": pluginReactNamingConvention,
|
|
296
|
+
"react-x": pluginReactX
|
|
216
297
|
},
|
|
217
298
|
settings: { react: { version: "detect" } },
|
|
218
299
|
rules: {
|
|
@@ -255,16 +336,38 @@ const config$2 = {
|
|
|
255
336
|
],
|
|
256
337
|
type: "unsorted"
|
|
257
338
|
}],
|
|
258
|
-
"react/
|
|
339
|
+
"react-naming-convention/component-name": "error",
|
|
340
|
+
"react-naming-convention/context-name": "error",
|
|
341
|
+
"react-naming-convention/ref-name": "error",
|
|
342
|
+
"react-naming-convention/use-state": "error",
|
|
343
|
+
"react-x/jsx-dollar": "error",
|
|
344
|
+
"react-x/jsx-key-before-spread": "error",
|
|
345
|
+
"react-x/jsx-no-iife": "error",
|
|
346
|
+
"react-x/no-access-state-in-setstate": "error",
|
|
347
|
+
"react-x/no-class-component": "error",
|
|
348
|
+
"react-x/no-context-provider": "error",
|
|
349
|
+
"react-x/no-default-props": "error",
|
|
350
|
+
"react-x/no-duplicate-key": "error",
|
|
351
|
+
"react-x/no-forward-ref": "error",
|
|
352
|
+
"react-x/no-implicit-key": "error",
|
|
353
|
+
"react-x/no-leaked-conditional-rendering": "error",
|
|
354
|
+
"react-x/no-misused-capture-owner-stack": "error",
|
|
355
|
+
"react-x/no-nested-component-definitions": "error",
|
|
356
|
+
"react-x/no-nested-lazy-component-declarations": "error",
|
|
357
|
+
"react-x/no-prop-types": "error",
|
|
358
|
+
"react-x/no-unnecessary-use-callback": "error",
|
|
359
|
+
"react-x/no-unnecessary-use-memo": "error",
|
|
360
|
+
"react-x/no-unstable-context-value": "error",
|
|
361
|
+
"react-x/no-unstable-default-props": "error",
|
|
362
|
+
"react-x/no-use-context": "error",
|
|
363
|
+
"react-x/prefer-destructuring-assignment": "error",
|
|
364
|
+
"react-x/prefer-use-state-lazy-initialization": "error",
|
|
259
365
|
"react/function-component-definition": ["error", {
|
|
260
366
|
namedComponents: ["arrow-function", "function-declaration"],
|
|
261
367
|
unnamedComponents: "arrow-function"
|
|
262
368
|
}],
|
|
263
|
-
"react/hook-use-state": "error",
|
|
264
|
-
"react/jsx-no-constructed-context-values": "error",
|
|
265
369
|
"react/no-adjacent-inline-elements": "error",
|
|
266
|
-
"react/
|
|
267
|
-
...Object.fromEntries(Object.keys(pluginReactHooks.configs.flat["recommended-latest"].rules).map((rule) => [rule, "error"]))
|
|
370
|
+
...Object.fromEntries(Object.keys(pluginReactHooks.configs.flat["recommended-latest"].rules).filter((rule) => !["react-hooks/exhaustive-deps", "react-hooks/rules-of-hooks"].includes(rule)).map((rule) => [rule, "error"]))
|
|
268
371
|
}
|
|
269
372
|
};
|
|
270
373
|
|
|
@@ -289,8 +392,7 @@ function defineConfig(...configs) {
|
|
|
289
392
|
files: ["**/*.config.{ts,cts,mts}"],
|
|
290
393
|
...config$1
|
|
291
394
|
},
|
|
292
|
-
...normalizeExtensionConfigs(configs)
|
|
293
|
-
pluginOxlint.configs["flat/all"]
|
|
395
|
+
...normalizeExtensionConfigs(configs)
|
|
294
396
|
]
|
|
295
397
|
});
|
|
296
398
|
}
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["config","config","config","_includeIgnoreFile","eslintDefineConfig","configIgnores","configBase","configConfigFiles","configReact"],"sources":["../src/config-base/index.ts","../src/config-config-files/index.ts","../src/config-react/index.ts","../src/config-ignores/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: 'parser',\n\t\t\t\t\t\telementNamePattern: '^parser$',\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'parser',\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\tsettings: {\n\t\treact: {\n\t\t\tversion: 'detect',\n\t\t},\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 { Config } from 'eslint/config';\nimport type { StandardConfig, StandardConfigArray } from '../types/index.d.ts';\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 configReact from '../config-react/index.ts';\n\n/**\n * Combine Standard Config with optional additional config.\n */\nexport default function defineConfig(\n\t...configs: StandardConfigArray\n): Config[] {\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\t...normalizeExtensionConfigs(configs),\n\t\t\tpluginOxlint.configs['flat/all'],\n\t\t],\n\t});\n}\n\nfunction normalizeExtensionConfigs(configs: StandardConfigArray) {\n\tconst configArray = configs.flat();\n\tconst extensions: Array<Config | Config[]> = [];\n\n\tif (configArray.length === 0) {\n\t\treturn extensions;\n\t}\n\n\tif ((configArray[0] as StandardConfig).react) {\n\t\textensions.push(configReact);\n\t}\n\n\textensions.push(\n\t\teslintDefineConfig(\n\t\t\t// Ensure `react` doesn’t break the expected config structure\n\t\t\tconfigArray.map((configEntry) => {\n\t\t\t\tif (Array.isArray(configEntry)) {\n\t\t\t\t\treturn configEntry;\n\t\t\t\t}\n\n\t\t\t\t/* oxlint-disable-next-line eslint/no-unused-vars */\n\t\t\t\tconst { react, ...config } = configEntry as StandardConfig;\n\t\t\t\treturn config;\n\t\t\t})\n\t\t)\n\t);\n\n\treturn extensions;\n}\n"],"mappings":";;;;;;;;;;;;;;;AAQA,MAAM,SAA4B;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,2BAA2B;EAC3B;CACD,OAAO;EAGL,aAAa,CAAC,SAAS,EAAE,YAAY,UAAU,CAAC;EAChD,gBAAgB;EAChB,sBAAsB;GACrB;GACA;GACA,EAAE,4BAA4B,MAAM;GACpC;EAEF,iDAAiD,CAChD,SACA;GACC,gBAAgB;GAChB,6BAA6B;GAC7B,CACD;EACD,8CAA8C,CAC7C,SACA,EAAE,wCAAwC,MAAM,CAChD;EACD,+CAA+C;EAC/C,oDAAoD;EACpD,2CAA2C,CAC1C,SACA,EAAE,QAAQ,sBAAsB,CAChC;EACD,sCAAsC;EACtC,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,oBAAoB;IACpB,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;GACN,CACD;EACD,iCAAiC,CAChC,SACA;GACC,QAAQ;IAAC;IAAmB;IAAW;IAAS;GAChD,MAAM;GACN,CACD;EACD,yCAAyC,CAAC,SAAS,EAAE,MAAM,WAAW,CAAC;EACvE,oCAAoC,CAAC,SAAS,EAAE,MAAM,WAAW,CAAC;EAClE,oCAAoC,CAAC,SAAS,EAAE,MAAM,WAAW,CAAC;EAClE,mCAAmC,CAClC,SACA;GACC,QAAQ;IAAC;IAAmB;IAAW;IAAS;GAChD,MAAM;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;;;;AC3JD,MAAMA,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;IACC,WAAW;IACX,oBAAoB;IACpB;GACD;EACD,QAAQ;GACP;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACD,iBAAiB;EACjB,MAAM;EACN,CACD,EACD;CACD;;;;;;;;ACpDD,MAAMC,WAA4B;CACjC,MAAM;CACN,SAAS;EACR,iBAAiB;EACjB,SAAS;EACT,eAAe;EACf;CACD,UAAU,EACT,OAAO,EACN,SAAS,UACT,EACD;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;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACD,MAAM;GACN,CACD;EACD,kCAAkC,CAAC,SAAS,SAAS;EACrD,uCAAuC,CACtC,SACA;GACC,iBAAiB,CAAC,kBAAkB,uBAAuB;GAC3D,mBAAmB;GACnB,CACD;EACD,wBAAwB;EACxB,2CAA2C;EAC3C,qCAAqC;EACrC,uCAAuC;EAGvC,GAAG,OAAO,YACT,OAAO,KACN,iBAAiB,QAAQ,KAAK,sBAAsB,MACpD,CAAC,KAAK,SAAS,CAAC,MAAM,QAAQ,CAAC,CAChC;EACD;CACD;;;;AChFD,MAAM,aAAa,KAAK,QAAQ,aAAa;AAG7C,MAAMC,WAFe,GAAG,WAAW,WAAW,GAG3CC,kBAAmB,YAAY,aAAa,GAC5C,EAAE;;;;;;;ACEL,SAAwB,aACvB,GAAG,SACQ;AACX,QAAOC,eAAmB;EACzB,MAAM;EACN,OAAO,CAAC,wBAAwB;EAChC,SAAS;GACRC;GACAC;GACA;IACC,OAAO,CAAC,2BAA2B;IACnC,GAAGC;IACH;GACD,GAAG,0BAA0B,QAAQ;GACrC,aAAa,QAAQ;GACrB;EACD,CAAC;;AAGH,SAAS,0BAA0B,SAA8B;CAChE,MAAM,cAAc,QAAQ,MAAM;CAClC,MAAM,aAAuC,EAAE;AAE/C,KAAI,YAAY,WAAW,EAC1B,QAAO;AAGR,KAAK,YAAY,GAAsB,MACtC,YAAW,KAAKC,SAAY;AAG7B,YAAW,KACVJ,eAEC,YAAY,KAAK,gBAAgB;AAChC,MAAI,MAAM,QAAQ,YAAY,CAC7B,QAAO;EAIR,MAAM,EAAE,OAAO,GAAG,WAAW;AAC7B,SAAO;GACN,CACF,CACD;AAED,QAAO"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["config","config","config","eslintDefineConfig","configIgnores","configBase","configConfigFiles","configReact"],"sources":["../src/config-base/index.ts","../src/config-config-files/index.ts","../src/config-react/index.ts","../src/config-ignores/index.ts","../src/define-config/index.ts"],"sourcesContent":["import type { LinterConfigEntry } from '../types/index.d.ts';\nimport pluginStylistic from '@stylistic/eslint-plugin';\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'@stylistic': pluginStylistic,\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\twarnOnUnsupportedTypeScriptVersion: false,\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'@stylistic/lines-between-class-members': [\n\t\t\t'error',\n\t\t\t'always',\n\t\t\t{ exceptAfterSingleLine: true },\n\t\t],\n\t\t'@stylistic/padding-line-between-statements': [\n\t\t\t'error',\n\t\t\t{\n\t\t\t\tblankLine: 'always',\n\t\t\t\tnext: '*',\n\t\t\t\tprev: [\n\t\t\t\t\t'block-like',\n\t\t\t\t\t'directive',\n\t\t\t\t\t'export',\n\t\t\t\t\t'function',\n\t\t\t\t\t'import',\n\t\t\t\t\t'interface',\n\t\t\t\t\t'type',\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\tblankLine: 'always',\n\t\t\t\tnext: [\n\t\t\t\t\t'block-like',\n\t\t\t\t\t'directive',\n\t\t\t\t\t'export',\n\t\t\t\t\t'function',\n\t\t\t\t\t'import',\n\t\t\t\t\t'interface',\n\t\t\t\t\t'type',\n\t\t\t\t],\n\t\t\t\tprev: '*',\n\t\t\t},\n\t\t\t{\n\t\t\t\tblankLine: 'always',\n\t\t\t\tnext: '*',\n\t\t\t\tprev: ['case', 'default'],\n\t\t\t},\n\t\t\t{\n\t\t\t\tblankLine: 'never',\n\t\t\t\tnext: 'directive',\n\t\t\t\tprev: 'directive',\n\t\t\t},\n\t\t\t{\n\t\t\t\tblankLine: 'any',\n\t\t\t\tnext: 'export',\n\t\t\t\tprev: 'export',\n\t\t\t},\n\t\t\t{\n\t\t\t\tblankLine: 'never',\n\t\t\t\tnext: ['function', 'function-overload'],\n\t\t\t\tprev: 'function-overload',\n\t\t\t},\n\t\t\t{\n\t\t\t\tblankLine: 'never',\n\t\t\t\tnext: 'import',\n\t\t\t\tprev: 'import',\n\t\t\t},\n\t\t\t{\n\t\t\t\tblankLine: 'any',\n\t\t\t\tnext: 'interface',\n\t\t\t\tprev: 'interface',\n\t\t\t},\n\t\t\t{\n\t\t\t\tblankLine: 'any',\n\t\t\t\tnext: 'type',\n\t\t\t\tprev: 'type',\n\t\t\t},\n\t\t],\n\t\t'@stylistic/spaced-comment': [\n\t\t\t'error',\n\t\t\t'always',\n\t\t\t{\n\t\t\t\tblock: {\n\t\t\t\t\tbalanced: true,\n\t\t\t\t},\n\t\t\t\tline: {\n\t\t\t\t\tmarkers: ['/'],\n\t\t\t\t},\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: 'parser',\n\t\t\t\t\t\telementNamePattern: '^parser$',\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'parser',\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';\nimport pluginReactNamingConvention from 'eslint-plugin-react-naming-convention';\nimport pluginReactX from 'eslint-plugin-react-x';\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\t'react-naming-convention': pluginReactNamingConvention,\n\t\t'react-x': pluginReactX,\n\t},\n\tsettings: {\n\t\treact: {\n\t\t\tversion: 'detect',\n\t\t},\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-naming-convention/component-name': 'error',\n\t\t'react-naming-convention/context-name': 'error',\n\t\t'react-naming-convention/ref-name': 'error',\n\t\t'react-naming-convention/use-state': 'error',\n\t\t'react-x/jsx-dollar': 'error',\n\t\t'react-x/jsx-key-before-spread': 'error',\n\t\t'react-x/jsx-no-iife': 'error',\n\t\t'react-x/no-access-state-in-setstate': 'error',\n\t\t'react-x/no-class-component': 'error',\n\t\t'react-x/no-context-provider': 'error',\n\t\t'react-x/no-default-props': 'error',\n\t\t'react-x/no-duplicate-key': 'error',\n\t\t'react-x/no-forward-ref': 'error',\n\t\t'react-x/no-implicit-key': 'error',\n\t\t'react-x/no-leaked-conditional-rendering': 'error',\n\t\t'react-x/no-misused-capture-owner-stack': 'error',\n\t\t'react-x/no-nested-component-definitions': 'error',\n\t\t'react-x/no-nested-lazy-component-declarations': 'error',\n\t\t'react-x/no-prop-types': 'error',\n\t\t'react-x/no-unnecessary-use-callback': 'error',\n\t\t'react-x/no-unnecessary-use-memo': 'error',\n\t\t'react-x/no-unstable-context-value': 'error',\n\t\t'react-x/no-unstable-default-props': 'error',\n\t\t'react-x/no-use-context': 'error',\n\t\t'react-x/prefer-destructuring-assignment': 'error',\n\t\t'react-x/prefer-use-state-lazy-initialization': 'error',\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/no-adjacent-inline-elements': '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)\n\t\t\t\t.filter(\n\t\t\t\t\t(rule) =>\n\t\t\t\t\t\t![\n\t\t\t\t\t\t\t'react-hooks/exhaustive-deps',\n\t\t\t\t\t\t\t'react-hooks/rules-of-hooks',\n\t\t\t\t\t\t].includes(rule)\n\t\t\t\t)\n\t\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 } 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 { Config } from 'eslint/config';\nimport type { StandardConfig, StandardConfigArray } from '../types/index.d.ts';\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 configReact from '../config-react/index.ts';\n\n/**\n * Combine Standard Config with optional additional config.\n */\nexport default function defineConfig(\n\t...configs: StandardConfigArray\n): Config[] {\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\t...normalizeExtensionConfigs(configs),\n\t\t],\n\t});\n}\n\nfunction normalizeExtensionConfigs(configs: StandardConfigArray) {\n\tconst configArray = configs.flat();\n\tconst extensions: Array<Config | Config[]> = [];\n\n\tif (configArray.length === 0) {\n\t\treturn extensions;\n\t}\n\n\tif ((configArray[0] as StandardConfig).react) {\n\t\textensions.push(configReact);\n\t}\n\n\textensions.push(\n\t\teslintDefineConfig(\n\t\t\t// Ensure `react` doesn’t break the expected config structure\n\t\t\tconfigArray.map((configEntry) => {\n\t\t\t\tif (Array.isArray(configEntry)) {\n\t\t\t\t\treturn configEntry;\n\t\t\t\t}\n\n\t\t\t\t/* oxlint-disable-next-line eslint/no-unused-vars */\n\t\t\t\tconst { react, ...config } = configEntry as StandardConfig;\n\t\t\t\treturn config;\n\t\t\t})\n\t\t)\n\t);\n\n\treturn extensions;\n}\n"],"mappings":"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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;GACA;EACD,iBAAiB;EACjB,MAAM;EACN,CACD,EACD;CACD;;;;;;;;AClDD,MAAMC,WAA4B;CACjC,MAAM;CACN,SAAS;EACR,iBAAiB;EACjB,SAAS;EACT,eAAe;EACf,2BAA2B;EAC3B,WAAW;EACX;CACD,UAAU,EACT,OAAO,EACN,SAAS,UACT,EACD;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;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACD,MAAM;GACN,CACD;EACD,0CAA0C;EAC1C,wCAAwC;EACxC,oCAAoC;EACpC,qCAAqC;EACrC,sBAAsB;EACtB,iCAAiC;EACjC,uBAAuB;EACvB,uCAAuC;EACvC,8BAA8B;EAC9B,+BAA+B;EAC/B,4BAA4B;EAC5B,4BAA4B;EAC5B,0BAA0B;EAC1B,2BAA2B;EAC3B,2CAA2C;EAC3C,0CAA0C;EAC1C,2CAA2C;EAC3C,iDAAiD;EACjD,yBAAyB;EACzB,uCAAuC;EACvC,mCAAmC;EACnC,qCAAqC;EACrC,qCAAqC;EACrC,0BAA0B;EAC1B,2CAA2C;EAC3C,gDAAgD;EAChD,uCAAuC,CACtC,SACA;GACC,iBAAiB,CAAC,kBAAkB,uBAAuB;GAC3D,mBAAmB;GACnB,CACD;EACD,qCAAqC;EAGrC,GAAG,OAAO,YACT,OAAO,KACN,iBAAiB,QAAQ,KAAK,sBAAsB,MACpD,CACC,QACC,SACA,CAAC,CACA,+BACA,6BACA,CAAC,SAAS,KAAK,CACjB,CACA,KAAK,SAAS,CAAC,MAAM,QAAQ,CAAC,CAChC;EACD;CACD;;;;AClHD,MAAM,aAAa,KAAK,QAAQ,aAAa;AAG7C,MAAMC,WAFe,GAAG,WAAW,WAAW,GAG3C,kBAAkB,YAAY,aAAa,GAC3C,EAAE;;;;;;;ACCL,SAAwB,aACvB,GAAG,SACQ;AACX,QAAOC,eAAmB;EACzB,MAAM;EACN,OAAO,CAAC,wBAAwB;EAChC,SAAS;GACRC;GACAC;GACA;IACC,OAAO,CAAC,2BAA2B;IACnC,GAAGC;IACH;GACD,GAAG,0BAA0B,QAAQ;GACrC;EACD,CAAC;;AAGH,SAAS,0BAA0B,SAA8B;CAChE,MAAM,cAAc,QAAQ,MAAM;CAClC,MAAM,aAAuC,EAAE;AAE/C,KAAI,YAAY,WAAW,EAC1B,QAAO;AAGR,KAAK,YAAY,GAAsB,MACtC,YAAW,KAAKC,SAAY;AAG7B,YAAW,KACVJ,eAEC,YAAY,KAAK,gBAAgB;AAChC,MAAI,MAAM,QAAQ,YAAY,CAC7B,QAAO;EAIR,MAAM,EAAE,OAAO,GAAG,WAAW;AAC7B,SAAO;GACN,CACF,CACD;AAED,QAAO"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@standard-config/eslint",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "TypeScript-first ESLint config designed to complement Oxlint",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -35,11 +35,13 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@eslint/compat": "^2.0.2",
|
|
38
|
-
"eslint-plugin
|
|
38
|
+
"@stylistic/eslint-plugin": "^5.8.0",
|
|
39
39
|
"eslint-plugin-perfectionist": "^5.5.0",
|
|
40
40
|
"eslint-plugin-react": "^7.37.5",
|
|
41
41
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
42
|
-
"
|
|
42
|
+
"eslint-plugin-react-naming-convention": "^2.13.0",
|
|
43
|
+
"eslint-plugin-react-x": "^2.13.0",
|
|
44
|
+
"typescript-eslint": "^8.56.0"
|
|
43
45
|
},
|
|
44
46
|
"peerDependencies": {
|
|
45
47
|
"@standard-config/oxlint": "*",
|
|
@@ -52,21 +54,22 @@
|
|
|
52
54
|
}
|
|
53
55
|
},
|
|
54
56
|
"devDependencies": {
|
|
55
|
-
"@standard-config/oxlint": "1.1.
|
|
56
|
-
"@standard-config/prettier": "1.9.1",
|
|
57
|
-
"@standard-config/tsconfig": "2.0.2",
|
|
58
|
-
"@types/node": "22.19.11",
|
|
59
|
-
"@vitest/coverage-v8": "4.0.18",
|
|
60
|
-
"eslint": "
|
|
61
|
-
"husky": "9.1.7",
|
|
62
|
-
"jiti": "2.6.1",
|
|
63
|
-
"oxlint": "1.
|
|
64
|
-
"oxlint-tsgolint": "0.
|
|
65
|
-
"prettier": "3.8.1",
|
|
66
|
-
"publint": "0.3.17",
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
57
|
+
"@standard-config/oxlint": "^1.1.3",
|
|
58
|
+
"@standard-config/prettier": "^1.9.1",
|
|
59
|
+
"@standard-config/tsconfig": "^2.0.2",
|
|
60
|
+
"@types/node": "^22.19.11",
|
|
61
|
+
"@vitest/coverage-v8": "^4.0.18",
|
|
62
|
+
"eslint": "^9.39.2",
|
|
63
|
+
"husky": "^9.1.7",
|
|
64
|
+
"jiti": "^2.6.1",
|
|
65
|
+
"oxlint": "^1.47.0",
|
|
66
|
+
"oxlint-tsgolint": "^0.14.0",
|
|
67
|
+
"prettier": "^3.8.1",
|
|
68
|
+
"publint": "^0.3.17",
|
|
69
|
+
"react": "^19.2.4",
|
|
70
|
+
"tsdown": "^0.20.3",
|
|
71
|
+
"typescript": "^5.9.3",
|
|
72
|
+
"vitest": "^4.0.18"
|
|
70
73
|
},
|
|
71
74
|
"scripts": {
|
|
72
75
|
"build": "tsdown",
|