@antfu/eslint-config 7.4.3 → 7.6.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/cli.mjs +23 -23
- package/dist/index.d.mts +83 -10
- package/dist/index.mjs +41 -17
- package/dist/{lib-DRA-mDV0.mjs → lib-B1Rme4qD.mjs} +222 -222
- package/package.json +33 -34
package/dist/cli.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import process from "node:process";
|
|
2
|
-
import
|
|
3
|
-
import fs
|
|
2
|
+
import fsPromises from "node:fs/promises";
|
|
3
|
+
import fs from "node:fs";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import * as p from "@clack/prompts";
|
|
6
6
|
import c, { green } from "ansis";
|
|
@@ -9,7 +9,7 @@ import parse from "parse-gitignore";
|
|
|
9
9
|
import { execSync } from "node:child_process";
|
|
10
10
|
|
|
11
11
|
//#region package.json
|
|
12
|
-
var version = "7.
|
|
12
|
+
var version = "7.6.0";
|
|
13
13
|
|
|
14
14
|
//#endregion
|
|
15
15
|
//#region src/cli/constants.ts
|
|
@@ -143,13 +143,13 @@ async function updateEslintFiles(result) {
|
|
|
143
143
|
const cwd = process.cwd();
|
|
144
144
|
const pathESLintIgnore = path.join(cwd, ".eslintignore");
|
|
145
145
|
const pathPackageJSON = path.join(cwd, "package.json");
|
|
146
|
-
const pkgContent = await
|
|
146
|
+
const pkgContent = await fsPromises.readFile(pathPackageJSON, "utf-8");
|
|
147
147
|
const configFileName = JSON.parse(pkgContent).type === "module" ? "eslint.config.js" : "eslint.config.mjs";
|
|
148
148
|
const pathFlatConfig = path.join(cwd, configFileName);
|
|
149
149
|
const eslintIgnores = [];
|
|
150
|
-
if (fs
|
|
150
|
+
if (fs.existsSync(pathESLintIgnore)) {
|
|
151
151
|
p.log.step(c.cyan`Migrating existing .eslintignore`);
|
|
152
|
-
const globs = parse(await
|
|
152
|
+
const globs = parse(await fsPromises.readFile(pathESLintIgnore, "utf-8")).globs();
|
|
153
153
|
for (const glob of globs) if (glob.type === "ignore") eslintIgnores.push(...glob.patterns);
|
|
154
154
|
else if (glob.type === "unignore") eslintIgnores.push(...glob.patterns.map((pattern) => `!${pattern}`));
|
|
155
155
|
}
|
|
@@ -159,9 +159,9 @@ async function updateEslintFiles(result) {
|
|
|
159
159
|
if (result.extra.includes("unocss")) configLines.push(`unocss: true,`);
|
|
160
160
|
for (const framework of result.frameworks) configLines.push(`${framework}: true,`);
|
|
161
161
|
const eslintConfigContent = getEslintConfigContent(configLines.map((i) => ` ${i}`).join("\n"), []);
|
|
162
|
-
await
|
|
162
|
+
await fsPromises.writeFile(pathFlatConfig, eslintConfigContent);
|
|
163
163
|
p.log.success(c.green`Created ${configFileName}`);
|
|
164
|
-
const files = fs
|
|
164
|
+
const files = fs.readdirSync(cwd);
|
|
165
165
|
const legacyConfig = [];
|
|
166
166
|
files.forEach((file) => {
|
|
167
167
|
if (/eslint|prettier/.test(file) && !/eslint\.config\./.test(file)) legacyConfig.push(file);
|
|
@@ -172,20 +172,20 @@ async function updateEslintFiles(result) {
|
|
|
172
172
|
//#endregion
|
|
173
173
|
//#region src/cli/constants-generated.ts
|
|
174
174
|
const versionsMap = {
|
|
175
|
-
"@eslint-react/eslint-plugin": "^2.
|
|
175
|
+
"@eslint-react/eslint-plugin": "^2.13.0",
|
|
176
176
|
"@next/eslint-plugin-next": "^16.1.6",
|
|
177
177
|
"@unocss/eslint-plugin": "^66.6.0",
|
|
178
|
-
"astro-eslint-parser": "^1.
|
|
179
|
-
"eslint": "^
|
|
180
|
-
"eslint-plugin-astro": "^1.
|
|
181
|
-
"eslint-plugin-format": "^
|
|
178
|
+
"astro-eslint-parser": "^1.3.0",
|
|
179
|
+
"eslint": "^10.0.2",
|
|
180
|
+
"eslint-plugin-astro": "^1.6.0",
|
|
181
|
+
"eslint-plugin-format": "^2.0.0",
|
|
182
182
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
183
|
-
"eslint-plugin-react-refresh": "^0.5.
|
|
183
|
+
"eslint-plugin-react-refresh": "^0.5.2",
|
|
184
184
|
"eslint-plugin-solid": "^0.14.5",
|
|
185
185
|
"eslint-plugin-svelte": "^3.15.0",
|
|
186
186
|
"prettier-plugin-astro": "^0.14.1",
|
|
187
187
|
"prettier-plugin-slidev": "^1.0.5",
|
|
188
|
-
"svelte-eslint-parser": "^1.
|
|
188
|
+
"svelte-eslint-parser": "^1.5.0"
|
|
189
189
|
};
|
|
190
190
|
|
|
191
191
|
//#endregion
|
|
@@ -194,7 +194,7 @@ async function updatePackageJson(result) {
|
|
|
194
194
|
const cwd = process.cwd();
|
|
195
195
|
const pathPackageJSON = path.join(cwd, "package.json");
|
|
196
196
|
p.log.step(c.cyan`Bumping @antfu/eslint-config to v${version}`);
|
|
197
|
-
const pkgContent = await
|
|
197
|
+
const pkgContent = await fsPromises.readFile(pathPackageJSON, "utf-8");
|
|
198
198
|
const pkg = JSON.parse(pkgContent);
|
|
199
199
|
pkg.devDependencies ??= {};
|
|
200
200
|
pkg.devDependencies["@antfu/eslint-config"] = `^${version}`;
|
|
@@ -225,7 +225,7 @@ async function updatePackageJson(result) {
|
|
|
225
225
|
});
|
|
226
226
|
}
|
|
227
227
|
if (addedPackages.length) p.note(c.dim(addedPackages.join(", ")), "Added packages");
|
|
228
|
-
await
|
|
228
|
+
await fsPromises.writeFile(pathPackageJSON, JSON.stringify(pkg, null, 2));
|
|
229
229
|
p.log.success(c.green`Changes wrote to package.json`);
|
|
230
230
|
}
|
|
231
231
|
|
|
@@ -236,16 +236,16 @@ async function updateVscodeSettings(result) {
|
|
|
236
236
|
if (!result.updateVscodeSettings) return;
|
|
237
237
|
const dotVscodePath = path.join(cwd, ".vscode");
|
|
238
238
|
const settingsPath = path.join(dotVscodePath, "settings.json");
|
|
239
|
-
if (!fs
|
|
240
|
-
if (!fs
|
|
241
|
-
await
|
|
239
|
+
if (!fs.existsSync(dotVscodePath)) await fsPromises.mkdir(dotVscodePath, { recursive: true });
|
|
240
|
+
if (!fs.existsSync(settingsPath)) {
|
|
241
|
+
await fsPromises.writeFile(settingsPath, `{${vscodeSettingsString}}\n`, "utf-8");
|
|
242
242
|
p.log.success(green`Created .vscode/settings.json`);
|
|
243
243
|
} else {
|
|
244
|
-
let settingsContent = await
|
|
244
|
+
let settingsContent = await fsPromises.readFile(settingsPath, "utf8");
|
|
245
245
|
settingsContent = settingsContent.trim().replace(/\s*\}$/, "");
|
|
246
246
|
settingsContent += settingsContent.endsWith(",") || settingsContent.endsWith("{") ? "" : ",";
|
|
247
247
|
settingsContent += `${vscodeSettingsString}}\n`;
|
|
248
|
-
await
|
|
248
|
+
await fsPromises.writeFile(settingsPath, settingsContent, "utf-8");
|
|
249
249
|
p.log.success(green`Updated .vscode/settings.json`);
|
|
250
250
|
}
|
|
251
251
|
}
|
|
@@ -256,7 +256,7 @@ async function run(options = {}) {
|
|
|
256
256
|
const argSkipPrompt = !!process.env.SKIP_PROMPT || options.yes;
|
|
257
257
|
const argTemplate = options.frameworks?.map((m) => m?.trim()).filter(Boolean);
|
|
258
258
|
const argExtra = options.extra?.map((m) => m?.trim()).filter(Boolean);
|
|
259
|
-
if (fs
|
|
259
|
+
if (fs.existsSync(path.join(process.cwd(), "eslint.config.js"))) {
|
|
260
260
|
p.log.warn(c.yellow`eslint.config.js already exists, migration wizard exited.`);
|
|
261
261
|
return process.exit(1);
|
|
262
262
|
}
|
package/dist/index.d.mts
CHANGED
|
@@ -1011,6 +1011,10 @@ interface RuleOptions {
|
|
|
1011
1011
|
* Use dprint to format code
|
|
1012
1012
|
*/
|
|
1013
1013
|
'format/dprint'?: Linter.RuleEntry<FormatDprint>;
|
|
1014
|
+
/**
|
|
1015
|
+
* Use oxfmt to format code
|
|
1016
|
+
*/
|
|
1017
|
+
'format/oxfmt'?: Linter.RuleEntry<FormatOxfmt>;
|
|
1014
1018
|
/**
|
|
1015
1019
|
* Use Prettier to format code
|
|
1016
1020
|
*/
|
|
@@ -3270,6 +3274,11 @@ interface RuleOptions {
|
|
|
3270
3274
|
* @see https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/prefer-global/console.md
|
|
3271
3275
|
*/
|
|
3272
3276
|
'node/prefer-global/console'?: Linter.RuleEntry<NodePreferGlobalConsole>;
|
|
3277
|
+
/**
|
|
3278
|
+
* enforce either `crypto` or `require("crypto").webcrypto`
|
|
3279
|
+
* @see https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/prefer-global/crypto.md
|
|
3280
|
+
*/
|
|
3281
|
+
'node/prefer-global/crypto'?: Linter.RuleEntry<NodePreferGlobalCrypto>;
|
|
3273
3282
|
/**
|
|
3274
3283
|
* enforce either `process` or `require("process")`
|
|
3275
3284
|
* @see https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/prefer-global/process.md
|
|
@@ -3285,6 +3294,11 @@ interface RuleOptions {
|
|
|
3285
3294
|
* @see https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/prefer-global/text-encoder.md
|
|
3286
3295
|
*/
|
|
3287
3296
|
'node/prefer-global/text-encoder'?: Linter.RuleEntry<NodePreferGlobalTextEncoder>;
|
|
3297
|
+
/**
|
|
3298
|
+
* enforce either global timer functions or `require("timers")`
|
|
3299
|
+
* @see https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/prefer-global/timers.md
|
|
3300
|
+
*/
|
|
3301
|
+
'node/prefer-global/timers'?: Linter.RuleEntry<NodePreferGlobalTimers>;
|
|
3288
3302
|
/**
|
|
3289
3303
|
* enforce either `URL` or `require("url").URL`
|
|
3290
3304
|
* @see https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/prefer-global/url.md
|
|
@@ -3618,7 +3632,7 @@ interface RuleOptions {
|
|
|
3618
3632
|
*/
|
|
3619
3633
|
'quotes'?: Linter.RuleEntry<Quotes>;
|
|
3620
3634
|
/**
|
|
3621
|
-
* Enforce the
|
|
3635
|
+
* Enforce the use of the radix argument when using `parseInt()`
|
|
3622
3636
|
* @see https://eslint.org/docs/latest/rules/radix
|
|
3623
3637
|
*/
|
|
3624
3638
|
'radix'?: Linter.RuleEntry<Radix>;
|
|
@@ -3855,6 +3869,11 @@ interface RuleOptions {
|
|
|
3855
3869
|
* @see https://eslint-react.xyz/docs/rules/naming-convention-filename-extension
|
|
3856
3870
|
*/
|
|
3857
3871
|
'react-naming-convention/filename-extension'?: Linter.RuleEntry<ReactNamingConventionFilenameExtension>;
|
|
3872
|
+
/**
|
|
3873
|
+
* Enforces identifier names assigned from 'useId' calls to be either 'id' or end with 'Id'.
|
|
3874
|
+
* @see https://eslint-react.xyz/docs/rules/naming-convention-id-name
|
|
3875
|
+
*/
|
|
3876
|
+
'react-naming-convention/id-name'?: Linter.RuleEntry<[]>;
|
|
3858
3877
|
/**
|
|
3859
3878
|
* Enforces identifier names assigned from 'useRef' calls to be either 'ref' or end with 'Ref'.
|
|
3860
3879
|
* @see https://eslint-react.xyz/docs/rules/naming-convention-ref-name
|
|
@@ -3892,7 +3911,7 @@ interface RuleOptions {
|
|
|
3892
3911
|
*/
|
|
3893
3912
|
'react-web-api/no-leaked-timeout'?: Linter.RuleEntry<[]>;
|
|
3894
3913
|
/**
|
|
3895
|
-
* Prevents
|
|
3914
|
+
* Prevents unintentional '$' sign before expression.
|
|
3896
3915
|
* @see https://eslint-react.xyz/docs/rules/jsx-dollar
|
|
3897
3916
|
*/
|
|
3898
3917
|
'react/jsx-dollar'?: Linter.RuleEntry<[]>;
|
|
@@ -6169,11 +6188,21 @@ interface RuleOptions {
|
|
|
6169
6188
|
* @see https://ota-meshi.github.io/eslint-plugin-toml/rules/indent.html
|
|
6170
6189
|
*/
|
|
6171
6190
|
'toml/indent'?: Linter.RuleEntry<TomlIndent>;
|
|
6191
|
+
/**
|
|
6192
|
+
* enforce linebreaks after opening and before closing braces
|
|
6193
|
+
* @see https://ota-meshi.github.io/eslint-plugin-toml/rules/inline-table-curly-newline.html
|
|
6194
|
+
*/
|
|
6195
|
+
'toml/inline-table-curly-newline'?: Linter.RuleEntry<TomlInlineTableCurlyNewline>;
|
|
6172
6196
|
/**
|
|
6173
6197
|
* enforce consistent spacing inside braces
|
|
6174
6198
|
* @see https://ota-meshi.github.io/eslint-plugin-toml/rules/inline-table-curly-spacing.html
|
|
6175
6199
|
*/
|
|
6176
6200
|
'toml/inline-table-curly-spacing'?: Linter.RuleEntry<TomlInlineTableCurlySpacing>;
|
|
6201
|
+
/**
|
|
6202
|
+
* enforce placing inline table key-value pairs on separate lines
|
|
6203
|
+
* @see https://ota-meshi.github.io/eslint-plugin-toml/rules/inline-table-key-value-newline.html
|
|
6204
|
+
*/
|
|
6205
|
+
'toml/inline-table-key-value-newline'?: Linter.RuleEntry<TomlInlineTableKeyValueNewline>;
|
|
6177
6206
|
/**
|
|
6178
6207
|
* enforce consistent spacing between keys and values in key/value pairs
|
|
6179
6208
|
* @see https://ota-meshi.github.io/eslint-plugin-toml/rules/key-spacing.html
|
|
@@ -9001,7 +9030,7 @@ interface RuleOptions {
|
|
|
9001
9030
|
* enforce valid `v-for` directives
|
|
9002
9031
|
* @see https://eslint.vuejs.org/rules/valid-v-for.html
|
|
9003
9032
|
*/
|
|
9004
|
-
'vue/valid-v-for'?: Linter.RuleEntry<
|
|
9033
|
+
'vue/valid-v-for'?: Linter.RuleEntry<VueValidVFor>;
|
|
9005
9034
|
/**
|
|
9006
9035
|
* enforce valid `v-html` directives
|
|
9007
9036
|
* @see https://eslint.vuejs.org/rules/valid-v-html.html
|
|
@@ -9815,6 +9844,10 @@ type FormatDprint = [] | [{
|
|
|
9815
9844
|
plugins?: unknown[];
|
|
9816
9845
|
[k: string]: unknown | undefined;
|
|
9817
9846
|
}];
|
|
9847
|
+
// ----- format/oxfmt -----
|
|
9848
|
+
type FormatOxfmt = [] | [{
|
|
9849
|
+
[k: string]: unknown | undefined;
|
|
9850
|
+
}];
|
|
9818
9851
|
// ----- format/prettier -----
|
|
9819
9852
|
type FormatPrettier = [] | [{
|
|
9820
9853
|
parser: string;
|
|
@@ -10469,6 +10502,7 @@ type JsdocTagLines = [] | [("always" | "any" | "never")] | [("always" | "any" |
|
|
|
10469
10502
|
endLines?: (number | null);
|
|
10470
10503
|
maxBlockLines?: (number | null);
|
|
10471
10504
|
startLines?: (number | null);
|
|
10505
|
+
startLinesWithNoTags?: number;
|
|
10472
10506
|
tags?: {
|
|
10473
10507
|
[k: string]: {
|
|
10474
10508
|
count?: number;
|
|
@@ -10697,6 +10731,7 @@ type JsoncObjectCurlyNewline = [] | [((("always" | "never") | {
|
|
|
10697
10731
|
type JsoncObjectCurlySpacing = [] | [("always" | "never")] | [("always" | "never"), {
|
|
10698
10732
|
arraysInObjects?: boolean;
|
|
10699
10733
|
objectsInObjects?: boolean;
|
|
10734
|
+
emptyObjects?: ("ignore" | "always" | "never");
|
|
10700
10735
|
}];
|
|
10701
10736
|
// ----- jsonc/object-property-newline -----
|
|
10702
10737
|
type JsoncObjectPropertyNewline = [] | [{
|
|
@@ -11544,6 +11579,7 @@ type MaxParams = [] | [(number | {
|
|
|
11544
11579
|
maximum?: number;
|
|
11545
11580
|
max?: number;
|
|
11546
11581
|
countVoidThis?: boolean;
|
|
11582
|
+
countThis?: ("never" | "except-void" | "always");
|
|
11547
11583
|
})];
|
|
11548
11584
|
// ----- max-statements -----
|
|
11549
11585
|
type MaxStatements = [] | [(number | {
|
|
@@ -12202,12 +12238,16 @@ type NodeNoUnsupportedFeaturesNodeBuiltins = [] | [{
|
|
|
12202
12238
|
type NodePreferGlobalBuffer = [] | [("always" | "never")];
|
|
12203
12239
|
// ----- node/prefer-global/console -----
|
|
12204
12240
|
type NodePreferGlobalConsole = [] | [("always" | "never")];
|
|
12241
|
+
// ----- node/prefer-global/crypto -----
|
|
12242
|
+
type NodePreferGlobalCrypto = [] | [("always" | "never")];
|
|
12205
12243
|
// ----- node/prefer-global/process -----
|
|
12206
12244
|
type NodePreferGlobalProcess = [] | [("always" | "never")];
|
|
12207
12245
|
// ----- node/prefer-global/text-decoder -----
|
|
12208
12246
|
type NodePreferGlobalTextDecoder = [] | [("always" | "never")];
|
|
12209
12247
|
// ----- node/prefer-global/text-encoder -----
|
|
12210
12248
|
type NodePreferGlobalTextEncoder = [] | [("always" | "never")];
|
|
12249
|
+
// ----- node/prefer-global/timers -----
|
|
12250
|
+
type NodePreferGlobalTimers = [] | [("always" | "never")];
|
|
12211
12251
|
// ----- node/prefer-global/url -----
|
|
12212
12252
|
type NodePreferGlobalUrl = [] | [("always" | "never")];
|
|
12213
12253
|
// ----- node/prefer-global/url-search-params -----
|
|
@@ -16415,13 +16455,17 @@ type StylePaddedBlocks = [] | [(("always" | "never" | "start" | "end") | {
|
|
|
16415
16455
|
}];
|
|
16416
16456
|
// ----- style/padding-line-between-statements -----
|
|
16417
16457
|
type _StylePaddingLineBetweenStatementsPaddingType = ("any" | "never" | "always");
|
|
16418
|
-
type _StylePaddingLineBetweenStatementsStatementOption = (
|
|
16458
|
+
type _StylePaddingLineBetweenStatementsStatementOption = (_StylePaddingLineBetweenStatementsStatementMatcher | [_StylePaddingLineBetweenStatementsStatementMatcher, ...(_StylePaddingLineBetweenStatementsStatementMatcher)[]]);
|
|
16459
|
+
type _StylePaddingLineBetweenStatementsStatementMatcher = (_StylePaddingLineBetweenStatementsStatementType | _StylePaddingLineBetweenStatements_SelectorOption);
|
|
16419
16460
|
type _StylePaddingLineBetweenStatementsStatementType = ("*" | "exports" | "require" | "directive" | "iife" | "block" | "empty" | "function" | "ts-method" | "break" | "case" | "class" | "continue" | "debugger" | "default" | "do" | "for" | "if" | "import" | "switch" | "throw" | "try" | "while" | "with" | "cjs-export" | "cjs-import" | "enum" | "interface" | "function-overload" | "block-like" | "singleline-block-like" | "multiline-block-like" | "expression" | "singleline-expression" | "multiline-expression" | "return" | "singleline-return" | "multiline-return" | "export" | "singleline-export" | "multiline-export" | "var" | "singleline-var" | "multiline-var" | "let" | "singleline-let" | "multiline-let" | "const" | "singleline-const" | "multiline-const" | "using" | "singleline-using" | "multiline-using" | "type" | "singleline-type" | "multiline-type");
|
|
16420
16461
|
type StylePaddingLineBetweenStatements = {
|
|
16421
16462
|
blankLine: _StylePaddingLineBetweenStatementsPaddingType;
|
|
16422
16463
|
prev: _StylePaddingLineBetweenStatementsStatementOption;
|
|
16423
16464
|
next: _StylePaddingLineBetweenStatementsStatementOption;
|
|
16424
16465
|
}[];
|
|
16466
|
+
interface _StylePaddingLineBetweenStatements_SelectorOption {
|
|
16467
|
+
selector: string;
|
|
16468
|
+
}
|
|
16425
16469
|
// ----- style/quote-props -----
|
|
16426
16470
|
type StyleQuoteProps = ([] | [("always" | "as-needed" | "consistent" | "consistent-as-needed")] | [] | [("always" | "as-needed" | "consistent" | "consistent-as-needed")] | [("always" | "as-needed" | "consistent" | "consistent-as-needed"), {
|
|
16427
16471
|
keywords?: boolean;
|
|
@@ -16889,10 +16933,21 @@ type TomlIndent = [] | [("tab" | number)] | [("tab" | number), {
|
|
|
16889
16933
|
subTables?: number;
|
|
16890
16934
|
keyValuePairs?: number;
|
|
16891
16935
|
}];
|
|
16936
|
+
// ----- toml/inline-table-curly-newline -----
|
|
16937
|
+
type TomlInlineTableCurlyNewline = [] | [(("always" | "never") | {
|
|
16938
|
+
multiline?: boolean;
|
|
16939
|
+
minProperties?: number;
|
|
16940
|
+
consistent?: boolean;
|
|
16941
|
+
})];
|
|
16892
16942
|
// ----- toml/inline-table-curly-spacing -----
|
|
16893
16943
|
type TomlInlineTableCurlySpacing = [] | [("always" | "never")] | [("always" | "never"), {
|
|
16894
16944
|
arraysInObjects?: boolean;
|
|
16895
16945
|
objectsInObjects?: boolean;
|
|
16946
|
+
emptyObjects?: ("ignore" | "always" | "never");
|
|
16947
|
+
}];
|
|
16948
|
+
// ----- toml/inline-table-key-value-newline -----
|
|
16949
|
+
type TomlInlineTableKeyValueNewline = [] | [{
|
|
16950
|
+
allowAllPropertiesOnSameLine?: boolean;
|
|
16896
16951
|
}];
|
|
16897
16952
|
// ----- toml/key-spacing -----
|
|
16898
16953
|
type TomlKeySpacing = [] | [({
|
|
@@ -18337,6 +18392,7 @@ type VueAttributesOrder = [] | [{
|
|
|
18337
18392
|
order?: (("DEFINITION" | "LIST_RENDERING" | "CONDITIONALS" | "RENDER_MODIFIERS" | "GLOBAL" | "UNIQUE" | "SLOT" | "TWO_WAY_BINDING" | "OTHER_DIRECTIVES" | "OTHER_ATTR" | "ATTR_STATIC" | "ATTR_DYNAMIC" | "ATTR_SHORTHAND_BOOL" | "EVENTS" | "CONTENT") | ("DEFINITION" | "LIST_RENDERING" | "CONDITIONALS" | "RENDER_MODIFIERS" | "GLOBAL" | "UNIQUE" | "SLOT" | "TWO_WAY_BINDING" | "OTHER_DIRECTIVES" | "OTHER_ATTR" | "ATTR_STATIC" | "ATTR_DYNAMIC" | "ATTR_SHORTHAND_BOOL" | "EVENTS" | "CONTENT")[])[];
|
|
18338
18393
|
alphabetical?: boolean;
|
|
18339
18394
|
sortLineLength?: boolean;
|
|
18395
|
+
ignoreVBindObject?: boolean;
|
|
18340
18396
|
}];
|
|
18341
18397
|
// ----- vue/block-lang -----
|
|
18342
18398
|
type VueBlockLang = [] | [{
|
|
@@ -18428,7 +18484,7 @@ type VueDefineMacrosOrder = [] | [{
|
|
|
18428
18484
|
type VueDefinePropsDeclaration = [] | [("type-based" | "runtime")];
|
|
18429
18485
|
// ----- vue/define-props-destructuring -----
|
|
18430
18486
|
type VueDefinePropsDestructuring = [] | [{
|
|
18431
|
-
destructure?: ("always" | "never");
|
|
18487
|
+
destructure?: ("only-when-assigned" | "always" | "never");
|
|
18432
18488
|
}];
|
|
18433
18489
|
// ----- vue/dot-location -----
|
|
18434
18490
|
type VueDotLocation = [] | [("object" | "property")];
|
|
@@ -19481,6 +19537,10 @@ type VueVSlotStyle = [] | [(("shorthand" | "longform") | {
|
|
|
19481
19537
|
default?: ("shorthand" | "longform" | "v-slot");
|
|
19482
19538
|
named?: ("shorthand" | "longform");
|
|
19483
19539
|
})];
|
|
19540
|
+
// ----- vue/valid-v-for -----
|
|
19541
|
+
type VueValidVFor = [] | [{
|
|
19542
|
+
allowEmptyAlias?: boolean;
|
|
19543
|
+
}];
|
|
19484
19544
|
// ----- vue/valid-v-on -----
|
|
19485
19545
|
type VueValidVOn = [] | [{
|
|
19486
19546
|
modifiers?: unknown[];
|
|
@@ -19527,6 +19587,7 @@ type YamlFlowMappingCurlyNewline = [] | [(("always" | "never") | {
|
|
|
19527
19587
|
type YamlFlowMappingCurlySpacing = [] | [("always" | "never")] | [("always" | "never"), {
|
|
19528
19588
|
arraysInObjects?: boolean;
|
|
19529
19589
|
objectsInObjects?: boolean;
|
|
19590
|
+
emptyObjects?: ("ignore" | "always" | "never");
|
|
19530
19591
|
}];
|
|
19531
19592
|
// ----- yaml/flow-sequence-bracket-newline -----
|
|
19532
19593
|
type YamlFlowSequenceBracketNewline = [] | [(("always" | "never" | "consistent") | {
|
|
@@ -19712,7 +19773,7 @@ type Yoda = [] | [("always" | "never")] | [("always" | "never"), {
|
|
|
19712
19773
|
onlyEquality?: boolean;
|
|
19713
19774
|
}];
|
|
19714
19775
|
// Names of all the configs
|
|
19715
|
-
type ConfigNames = 'antfu/gitignore' | 'antfu/ignores' | 'antfu/javascript/setup' | 'antfu/javascript/rules' | 'antfu/eslint-comments/rules' | 'antfu/command/rules' | 'antfu/perfectionist/setup' | 'antfu/node/rules' | 'antfu/jsdoc/rules' | 'antfu/imports/rules' | 'antfu/unicorn/rules' | 'antfu/jsx/setup' | 'antfu/typescript/setup' | 'antfu/typescript/parser' | 'antfu/typescript/type-aware-parser' | 'antfu/typescript/rules' | 'antfu/typescript/rules-type-aware' | 'antfu/typescript/erasable-syntax-only' | 'antfu/stylistic/rules' | 'antfu/regexp/rules' | 'antfu/test/setup' | 'antfu/test/rules' | 'antfu/vue/setup' | 'antfu/vue/rules' | 'antfu/react/setup' | 'antfu/react/rules' | 'antfu/react/typescript' | 'antfu/react/type-aware-rules' | 'antfu/nextjs/setup' | 'antfu/nextjs/rules' | 'antfu/solid/setup' | 'antfu/solid/rules' | 'antfu/svelte/setup' | 'antfu/svelte/rules' | 'antfu/unocss' | 'antfu/astro/setup' | 'antfu/astro/rules' | 'antfu/angular/setup' | 'antfu/angular/rules/ts' | 'antfu/angular/rules/template' | 'antfu/jsonc/setup' | 'antfu/jsonc/rules' | 'antfu/sort/package-json' | 'antfu/sort/tsconfig-json' | 'antfu/pnpm/package-json' | 'antfu/pnpm/pnpm-workspace-yaml' | 'antfu/pnpm/pnpm-workspace-yaml-sort' | 'antfu/yaml/setup' | 'antfu/yaml/rules' | 'antfu/toml/setup' | 'antfu/toml/rules' | 'antfu/markdown/setup' | 'antfu/markdown/processor' | 'antfu/markdown/parser' | 'antfu/markdown/disables' | 'antfu/formatter/setup' | 'antfu/formatter/css' | 'antfu/formatter/scss' | 'antfu/formatter/less' | 'antfu/formatter/html' | 'antfu/formatter/xml' | 'antfu/formatter/svg' | 'antfu/formatter/markdown' | 'antfu/formatter/astro' | 'antfu/formatter/astro/disables' | 'antfu/formatter/graphql' | 'antfu/disables/scripts' | 'antfu/disables/cli' | 'antfu/disables/bin' | 'antfu/disables/dts' | 'antfu/disables/cjs' | 'antfu/disables/config-files';
|
|
19776
|
+
type ConfigNames = 'antfu/gitignore' | 'antfu/ignores' | 'antfu/javascript/setup' | 'antfu/javascript/rules' | 'antfu/eslint-comments/rules' | 'antfu/command/rules' | 'antfu/perfectionist/setup' | 'antfu/node/rules' | 'antfu/jsdoc/setup' | 'antfu/jsdoc/rules' | 'antfu/imports/rules' | 'antfu/unicorn/rules' | 'antfu/jsx/setup' | 'antfu/typescript/setup' | 'antfu/typescript/parser' | 'antfu/typescript/type-aware-parser' | 'antfu/typescript/rules' | 'antfu/typescript/rules-type-aware' | 'antfu/typescript/erasable-syntax-only' | 'antfu/stylistic/rules' | 'antfu/regexp/rules' | 'antfu/test/setup' | 'antfu/test/rules' | 'antfu/vue/setup' | 'antfu/vue/rules' | 'antfu/react/setup' | 'antfu/react/rules' | 'antfu/react/typescript' | 'antfu/react/type-aware-rules' | 'antfu/nextjs/setup' | 'antfu/nextjs/rules' | 'antfu/solid/setup' | 'antfu/solid/rules' | 'antfu/svelte/setup' | 'antfu/svelte/rules' | 'antfu/unocss' | 'antfu/astro/setup' | 'antfu/astro/rules' | 'antfu/angular/setup' | 'antfu/angular/rules/ts' | 'antfu/angular/rules/template' | 'antfu/jsonc/setup' | 'antfu/jsonc/rules' | 'antfu/sort/package-json' | 'antfu/sort/tsconfig-json' | 'antfu/pnpm/package-json' | 'antfu/pnpm/pnpm-workspace-yaml' | 'antfu/pnpm/pnpm-workspace-yaml-sort' | 'antfu/yaml/setup' | 'antfu/yaml/rules' | 'antfu/toml/setup' | 'antfu/toml/rules' | 'antfu/markdown/setup' | 'antfu/markdown/processor' | 'antfu/markdown/parser' | 'antfu/markdown/rules' | 'antfu/markdown/disables/markdown' | 'antfu/markdown/disables/code' | 'antfu/formatter/setup' | 'antfu/formatter/css' | 'antfu/formatter/scss' | 'antfu/formatter/less' | 'antfu/formatter/html' | 'antfu/formatter/xml' | 'antfu/formatter/svg' | 'antfu/formatter/markdown' | 'antfu/formatter/astro' | 'antfu/formatter/astro/disables' | 'antfu/formatter/graphql' | 'antfu/disables/scripts' | 'antfu/disables/cli' | 'antfu/disables/bin' | 'antfu/disables/dts' | 'antfu/disables/cjs' | 'antfu/disables/config-files';
|
|
19716
19777
|
//#endregion
|
|
19717
19778
|
//#region src/vender/prettier-types.d.ts
|
|
19718
19779
|
/**
|
|
@@ -19979,6 +20040,18 @@ interface OptionsUnicorn extends OptionsOverrides {
|
|
|
19979
20040
|
*/
|
|
19980
20041
|
allRecommended?: boolean;
|
|
19981
20042
|
}
|
|
20043
|
+
interface OptionsMarkdown extends OptionsOverrides {
|
|
20044
|
+
/**
|
|
20045
|
+
* Enable GFM (GitHub Flavored Markdown) support.
|
|
20046
|
+
*
|
|
20047
|
+
* @default true
|
|
20048
|
+
*/
|
|
20049
|
+
gfm?: boolean;
|
|
20050
|
+
/**
|
|
20051
|
+
* Override rules for markdown itself.
|
|
20052
|
+
*/
|
|
20053
|
+
overridesMarkdown?: TypedFlatConfigItem['rules'];
|
|
20054
|
+
}
|
|
19982
20055
|
interface OptionsTypeScriptParserOptions {
|
|
19983
20056
|
/**
|
|
19984
20057
|
* Additional parser options for TypeScript.
|
|
@@ -20210,13 +20283,13 @@ interface OptionsConfig extends OptionsComponentExts, OptionsProjectType {
|
|
|
20210
20283
|
*/
|
|
20211
20284
|
angular?: boolean | OptionsOverrides;
|
|
20212
20285
|
/**
|
|
20213
|
-
* Enable linting for **code snippets** in Markdown.
|
|
20286
|
+
* Enable linting for **code snippets** in Markdown and the markdown content itself.
|
|
20214
20287
|
*
|
|
20215
20288
|
* For formatting Markdown content, enable also `formatters.markdown`.
|
|
20216
20289
|
*
|
|
20217
20290
|
* @default true
|
|
20218
20291
|
*/
|
|
20219
|
-
markdown?: boolean |
|
|
20292
|
+
markdown?: boolean | OptionsMarkdown;
|
|
20220
20293
|
/**
|
|
20221
20294
|
* Enable stylistic rules.
|
|
20222
20295
|
*
|
|
@@ -20401,7 +20474,7 @@ declare function jsonc(options?: OptionsFiles & OptionsStylistic & OptionsOverri
|
|
|
20401
20474
|
declare function jsx(options?: OptionsJSX): Promise<TypedFlatConfigItem[]>;
|
|
20402
20475
|
//#endregion
|
|
20403
20476
|
//#region src/configs/markdown.d.ts
|
|
20404
|
-
declare function markdown(options?: OptionsFiles & OptionsComponentExts &
|
|
20477
|
+
declare function markdown(options?: OptionsFiles & OptionsComponentExts & OptionsMarkdown): Promise<TypedFlatConfigItem[]>;
|
|
20405
20478
|
//#endregion
|
|
20406
20479
|
//#region src/configs/nextjs.d.ts
|
|
20407
20480
|
declare function nextjs(options?: OptionsOverrides & OptionsFiles): Promise<TypedFlatConfigItem[]>;
|
|
@@ -20579,4 +20652,4 @@ declare function ensurePackages(packages: (string | undefined)[]): Promise<void>
|
|
|
20579
20652
|
declare function isInEditorEnv(): boolean;
|
|
20580
20653
|
declare function isInGitHooksOrLintStaged(): boolean;
|
|
20581
20654
|
//#endregion
|
|
20582
|
-
export { Awaitable, CONFIG_PRESET_FULL_OFF, CONFIG_PRESET_FULL_ON, type ConfigNames, GLOB_ALL_SRC, GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_CSS, GLOB_EXCLUDE, GLOB_GRAPHQL, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVELTE, GLOB_SVG, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_XML, GLOB_YAML, OptionsComponentExts, OptionsConfig, OptionsFiles, OptionsFormatters, OptionsHasTypeScript, OptionsIsInEditor, OptionsJSX, OptionsJSXA11y, OptionsOverrides, OptionsPnpm, OptionsProjectType, OptionsReact, OptionsRegExp, OptionsStylistic, OptionsTypeScriptErasableOnly, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes, OptionsTypescript, OptionsUnicorn, OptionsUnoCSS, OptionsVue, ResolvedOptions, type RuleOptions, Rules, StylisticConfig, StylisticConfigDefaults, StylisticOptions, TypedFlatConfigItem, angular, antfu, antfu as default, astro, combine, command, comments, defaultPluginRenaming, disables, ensurePackages, formatters, getOverrides, ignores, imports, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, javascript, jsdoc, jsonc, jsx, markdown, nextjs, node, parserPlain, perfectionist, pnpm, react, regexp, renamePluginInConfigs, renameRules, resolveSubOptions, solid, sortPackageJson, sortTsconfig, stylistic, svelte, test, toArray, toml, typescript, unicorn, unocss, vue, yaml };
|
|
20655
|
+
export { Awaitable, CONFIG_PRESET_FULL_OFF, CONFIG_PRESET_FULL_ON, type ConfigNames, GLOB_ALL_SRC, GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_CSS, GLOB_EXCLUDE, GLOB_GRAPHQL, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVELTE, GLOB_SVG, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_XML, GLOB_YAML, OptionsComponentExts, OptionsConfig, OptionsFiles, OptionsFormatters, OptionsHasTypeScript, OptionsIsInEditor, OptionsJSX, OptionsJSXA11y, OptionsMarkdown, OptionsOverrides, OptionsPnpm, OptionsProjectType, OptionsReact, OptionsRegExp, OptionsStylistic, OptionsTypeScriptErasableOnly, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes, OptionsTypescript, OptionsUnicorn, OptionsUnoCSS, OptionsVue, ResolvedOptions, type RuleOptions, Rules, StylisticConfig, StylisticConfigDefaults, StylisticOptions, TypedFlatConfigItem, angular, antfu, antfu as default, astro, combine, command, comments, defaultPluginRenaming, disables, ensurePackages, formatters, getOverrides, ignores, imports, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, javascript, jsdoc, jsonc, jsx, markdown, nextjs, node, parserPlain, perfectionist, pnpm, react, regexp, renamePluginInConfigs, renameRules, resolveSubOptions, solid, sortPackageJson, sortTsconfig, stylistic, svelte, test, toArray, toml, typescript, unicorn, unocss, vue, yaml };
|
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { FlatConfigComposer } from "eslint-flat-config-utils";
|
|
2
2
|
import process from "node:process";
|
|
3
|
-
import
|
|
3
|
+
import fsPromises from "node:fs/promises";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
|
-
import fs
|
|
5
|
+
import fs from "node:fs";
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
import { isPackageExists } from "local-pkg";
|
|
8
8
|
import createCommand from "eslint-plugin-command/config";
|
|
@@ -27,7 +27,7 @@ async function findUp(name, { cwd = process.cwd(), type = "file", stopAt } = {})
|
|
|
27
27
|
while (directory) {
|
|
28
28
|
const filePath = isAbsoluteName ? name : path.join(directory, name);
|
|
29
29
|
try {
|
|
30
|
-
const stats = await
|
|
30
|
+
const stats = await fsPromises.stat(filePath);
|
|
31
31
|
if (type === "file" && stats.isFile() || type === "directory" && stats.isDirectory()) return filePath;
|
|
32
32
|
} catch {}
|
|
33
33
|
if (directory === stopAt || directory === root) break;
|
|
@@ -42,7 +42,7 @@ function findUpSync(name, { cwd = process.cwd(), type = "file", stopAt } = {}) {
|
|
|
42
42
|
while (directory) {
|
|
43
43
|
const filePath = isAbsoluteName ? name : path.join(directory, name);
|
|
44
44
|
try {
|
|
45
|
-
const stats = fs
|
|
45
|
+
const stats = fs.statSync(filePath, { throwIfNoEntry: false });
|
|
46
46
|
if (type === "file" && stats?.isFile() || type === "directory" && stats?.isDirectory()) return filePath;
|
|
47
47
|
} catch {}
|
|
48
48
|
if (directory === stopAt || directory === root) break;
|
|
@@ -911,9 +911,11 @@ async function javascript(options = {}) {
|
|
|
911
911
|
async function jsdoc(options = {}) {
|
|
912
912
|
const { stylistic: stylistic$1 = true } = options;
|
|
913
913
|
return [{
|
|
914
|
+
name: "antfu/jsdoc/setup",
|
|
915
|
+
plugins: { jsdoc: await interopDefault(import("eslint-plugin-jsdoc")) }
|
|
916
|
+
}, {
|
|
914
917
|
files: [GLOB_SRC],
|
|
915
918
|
name: "antfu/jsdoc/rules",
|
|
916
|
-
plugins: { jsdoc: await interopDefault(import("eslint-plugin-jsdoc")) },
|
|
917
919
|
rules: {
|
|
918
920
|
"jsdoc/check-access": "warn",
|
|
919
921
|
"jsdoc/check-param-names": "warn",
|
|
@@ -947,13 +949,12 @@ async function jsonc(options = {}) {
|
|
|
947
949
|
GLOB_JSONC
|
|
948
950
|
], overrides = {}, stylistic: stylistic$1 = true } = options;
|
|
949
951
|
const { indent = 2 } = typeof stylistic$1 === "boolean" ? {} : stylistic$1;
|
|
950
|
-
const [pluginJsonc, parserJsonc] = await Promise.all([interopDefault(import("eslint-plugin-jsonc")), interopDefault(import("jsonc-eslint-parser"))]);
|
|
951
952
|
return [{
|
|
952
953
|
name: "antfu/jsonc/setup",
|
|
953
|
-
plugins: { jsonc:
|
|
954
|
+
plugins: { jsonc: await interopDefault(import("eslint-plugin-jsonc")) }
|
|
954
955
|
}, {
|
|
955
956
|
files,
|
|
956
|
-
|
|
957
|
+
language: "jsonc/x",
|
|
957
958
|
name: "antfu/jsonc/rules",
|
|
958
959
|
rules: {
|
|
959
960
|
"jsonc/no-bigint-literals": "error",
|
|
@@ -1047,7 +1048,7 @@ async function jsx(options = {}) {
|
|
|
1047
1048
|
//#endregion
|
|
1048
1049
|
//#region src/configs/markdown.ts
|
|
1049
1050
|
async function markdown(options = {}) {
|
|
1050
|
-
const { componentExts = [], files = [GLOB_MARKDOWN], overrides = {} } = options;
|
|
1051
|
+
const { componentExts = [], files = [GLOB_MARKDOWN], gfm = true, overrides = {}, overridesMarkdown = {} } = options;
|
|
1051
1052
|
const markdown$1 = await interopDefault(import("@eslint/markdown"));
|
|
1052
1053
|
return [
|
|
1053
1054
|
{
|
|
@@ -1062,13 +1063,37 @@ async function markdown(options = {}) {
|
|
|
1062
1063
|
},
|
|
1063
1064
|
{
|
|
1064
1065
|
files,
|
|
1065
|
-
|
|
1066
|
+
language: gfm ? "markdown/gfm" : "markdown/commonmark",
|
|
1066
1067
|
name: "antfu/markdown/parser"
|
|
1067
1068
|
},
|
|
1069
|
+
{
|
|
1070
|
+
files,
|
|
1071
|
+
name: "antfu/markdown/rules",
|
|
1072
|
+
rules: {
|
|
1073
|
+
...markdown$1.configs.recommended.at(0)?.rules,
|
|
1074
|
+
"markdown/no-missing-label-refs": "off",
|
|
1075
|
+
...overridesMarkdown
|
|
1076
|
+
}
|
|
1077
|
+
},
|
|
1078
|
+
{
|
|
1079
|
+
files,
|
|
1080
|
+
name: "antfu/markdown/disables/markdown",
|
|
1081
|
+
rules: {
|
|
1082
|
+
"command/command": "off",
|
|
1083
|
+
"no-irregular-whitespace": "off",
|
|
1084
|
+
"perfectionist/sort-exports": "off",
|
|
1085
|
+
"perfectionist/sort-imports": "off",
|
|
1086
|
+
"regexp/no-legacy-features": "off",
|
|
1087
|
+
"regexp/no-missing-g-flag": "off",
|
|
1088
|
+
"regexp/no-useless-dollar-replacements": "off",
|
|
1089
|
+
"regexp/no-useless-flag": "off",
|
|
1090
|
+
"style/indent": "off"
|
|
1091
|
+
}
|
|
1092
|
+
},
|
|
1068
1093
|
{
|
|
1069
1094
|
files: [GLOB_MARKDOWN_CODE, ...componentExts.map((ext) => `${GLOB_MARKDOWN}/**/*.${ext}`)],
|
|
1070
1095
|
languageOptions: { parserOptions: { ecmaFeatures: { impliedStrict: true } } },
|
|
1071
|
-
name: "antfu/markdown/disables",
|
|
1096
|
+
name: "antfu/markdown/disables/code",
|
|
1072
1097
|
rules: {
|
|
1073
1098
|
"antfu/no-top-level-await": "off",
|
|
1074
1099
|
"no-alert": "off",
|
|
@@ -1213,21 +1238,20 @@ async function perfectionist() {
|
|
|
1213
1238
|
async function detectCatalogUsage() {
|
|
1214
1239
|
const workspaceFile = await findUp("pnpm-workspace.yaml");
|
|
1215
1240
|
if (!workspaceFile) return false;
|
|
1216
|
-
const yaml$1 = await
|
|
1241
|
+
const yaml$1 = await fsPromises.readFile(workspaceFile, "utf-8");
|
|
1217
1242
|
return yaml$1.includes("catalog:") || yaml$1.includes("catalogs:");
|
|
1218
1243
|
}
|
|
1219
1244
|
async function pnpm(options) {
|
|
1220
|
-
const [pluginPnpm, pluginYaml, yamlParser
|
|
1245
|
+
const [pluginPnpm, pluginYaml, yamlParser] = await Promise.all([
|
|
1221
1246
|
interopDefault(import("eslint-plugin-pnpm")),
|
|
1222
1247
|
interopDefault(import("eslint-plugin-yml")),
|
|
1223
|
-
interopDefault(import("yaml-eslint-parser"))
|
|
1224
|
-
interopDefault(import("jsonc-eslint-parser"))
|
|
1248
|
+
interopDefault(import("yaml-eslint-parser"))
|
|
1225
1249
|
]);
|
|
1226
1250
|
const { catalogs = await detectCatalogUsage(), isInEditor = false, json = true, sort = true, yaml: yaml$1 = true } = options;
|
|
1227
1251
|
const configs$1 = [];
|
|
1228
1252
|
if (json) configs$1.push({
|
|
1229
1253
|
files: ["package.json", "**/package.json"],
|
|
1230
|
-
|
|
1254
|
+
language: "jsonc/x",
|
|
1231
1255
|
name: "antfu/pnpm/package-json",
|
|
1232
1256
|
plugins: { pnpm: pluginPnpm },
|
|
1233
1257
|
rules: {
|
|
@@ -2119,7 +2143,7 @@ async function typescript(options = {}) {
|
|
|
2119
2143
|
}] : [],
|
|
2120
2144
|
...erasableOnly ? [{
|
|
2121
2145
|
name: "antfu/typescript/erasable-syntax-only",
|
|
2122
|
-
plugins: { "erasable-syntax-only": await interopDefault(import("./lib-
|
|
2146
|
+
plugins: { "erasable-syntax-only": await interopDefault(import("./lib-B1Rme4qD.mjs")) },
|
|
2123
2147
|
rules: {
|
|
2124
2148
|
"erasable-syntax-only/enums": "error",
|
|
2125
2149
|
"erasable-syntax-only/import-aliases": "error",
|