@antfu/eslint-config 3.2.1 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.cjs +79 -77
- package/dist/cli.js +79 -77
- package/dist/index.cjs +119 -111
- package/dist/index.d.cts +128 -128
- package/dist/index.d.ts +128 -128
- package/dist/index.js +131 -123
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -112,8 +112,8 @@ var getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${_
|
|
|
112
112
|
var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
|
|
113
113
|
|
|
114
114
|
// src/factory.ts
|
|
115
|
-
var import_local_pkg4 = require("local-pkg");
|
|
116
115
|
var import_eslint_flat_config_utils = require("eslint-flat-config-utils");
|
|
116
|
+
var import_local_pkg4 = require("local-pkg");
|
|
117
117
|
|
|
118
118
|
// src/globs.ts
|
|
119
119
|
var GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
|
|
@@ -360,13 +360,13 @@ async function command() {
|
|
|
360
360
|
}
|
|
361
361
|
|
|
362
362
|
// src/plugins.ts
|
|
363
|
-
var import_eslint_plugin_antfu = __toESM(require("eslint-plugin-antfu"), 1);
|
|
364
363
|
var import_eslint_plugin_eslint_comments = __toESM(require("@eslint-community/eslint-plugin-eslint-comments"), 1);
|
|
364
|
+
var import_eslint_plugin_antfu = __toESM(require("eslint-plugin-antfu"), 1);
|
|
365
365
|
var pluginImport = __toESM(require("eslint-plugin-import-x"), 1);
|
|
366
366
|
var import_eslint_plugin_n = __toESM(require("eslint-plugin-n"), 1);
|
|
367
|
+
var import_eslint_plugin_perfectionist = __toESM(require("eslint-plugin-perfectionist"), 1);
|
|
367
368
|
var import_eslint_plugin_unicorn = __toESM(require("eslint-plugin-unicorn"), 1);
|
|
368
369
|
var import_eslint_plugin_unused_imports = __toESM(require("eslint-plugin-unused-imports"), 1);
|
|
369
|
-
var import_eslint_plugin_perfectionist = __toESM(require("eslint-plugin-perfectionist"), 1);
|
|
370
370
|
|
|
371
371
|
// src/configs/comments.ts
|
|
372
372
|
async function comments() {
|
|
@@ -386,6 +386,60 @@ async function comments() {
|
|
|
386
386
|
];
|
|
387
387
|
}
|
|
388
388
|
|
|
389
|
+
// src/configs/disables.ts
|
|
390
|
+
async function disables() {
|
|
391
|
+
return [
|
|
392
|
+
{
|
|
393
|
+
files: [`scripts/${GLOB_SRC}`],
|
|
394
|
+
name: "antfu/disables/scripts",
|
|
395
|
+
rules: {
|
|
396
|
+
"no-console": "off",
|
|
397
|
+
"ts/explicit-function-return-type": "off",
|
|
398
|
+
"unicorn/consistent-function-scoping": "off"
|
|
399
|
+
}
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
files: [`cli/${GLOB_SRC}`, `cli.${GLOB_SRC_EXT}`],
|
|
403
|
+
name: "antfu/disables/cli",
|
|
404
|
+
rules: {
|
|
405
|
+
"no-console": "off"
|
|
406
|
+
}
|
|
407
|
+
},
|
|
408
|
+
{
|
|
409
|
+
files: ["**/bin/**/*", `**/bin.${GLOB_SRC_EXT}`],
|
|
410
|
+
name: "antfu/disables/bin",
|
|
411
|
+
rules: {
|
|
412
|
+
"antfu/no-import-dist": "off",
|
|
413
|
+
"antfu/no-import-node-modules-by-path": "off"
|
|
414
|
+
}
|
|
415
|
+
},
|
|
416
|
+
{
|
|
417
|
+
files: ["**/*.d.?([cm])ts"],
|
|
418
|
+
name: "antfu/disables/dts",
|
|
419
|
+
rules: {
|
|
420
|
+
"eslint-comments/no-unlimited-disable": "off",
|
|
421
|
+
"import/no-duplicates": "off",
|
|
422
|
+
"no-restricted-syntax": "off",
|
|
423
|
+
"unused-imports/no-unused-vars": "off"
|
|
424
|
+
}
|
|
425
|
+
},
|
|
426
|
+
{
|
|
427
|
+
files: ["**/*.{test,spec}.([tj])s?(x)"],
|
|
428
|
+
name: "antfu/disables/test",
|
|
429
|
+
rules: {
|
|
430
|
+
"no-unused-expressions": "off"
|
|
431
|
+
}
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
files: ["**/*.js", "**/*.cjs"],
|
|
435
|
+
name: "antfu/disables/cjs",
|
|
436
|
+
rules: {
|
|
437
|
+
"ts/no-require-imports": "off"
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
];
|
|
441
|
+
}
|
|
442
|
+
|
|
389
443
|
// src/configs/formatters.ts
|
|
390
444
|
var import_local_pkg2 = require("local-pkg");
|
|
391
445
|
|
|
@@ -758,7 +812,6 @@ async function imports(options = {}) {
|
|
|
758
812
|
"import/no-named-default": "error",
|
|
759
813
|
"import/no-self-import": "error",
|
|
760
814
|
"import/no-webpack-loader-syntax": "error",
|
|
761
|
-
"import/order": "error",
|
|
762
815
|
...stylistic2 ? {
|
|
763
816
|
"import/newline-after-import": ["error", { count: 1 }]
|
|
764
817
|
} : {}
|
|
@@ -949,16 +1002,6 @@ async function javascript(options = {}) {
|
|
|
949
1002
|
"prefer-rest-params": "error",
|
|
950
1003
|
"prefer-spread": "error",
|
|
951
1004
|
"prefer-template": "error",
|
|
952
|
-
"sort-imports": [
|
|
953
|
-
"error",
|
|
954
|
-
{
|
|
955
|
-
allowSeparatedGroups: false,
|
|
956
|
-
ignoreCase: false,
|
|
957
|
-
ignoreDeclarationSort: true,
|
|
958
|
-
ignoreMemberSort: false,
|
|
959
|
-
memberSyntaxSortOrder: ["none", "all", "multiple", "single"]
|
|
960
|
-
}
|
|
961
|
-
],
|
|
962
1005
|
"symbol-description": "error",
|
|
963
1006
|
"unicode-bom": ["error", "never"],
|
|
964
1007
|
"unused-imports/no-unused-imports": isInEditor ? "off" : "error",
|
|
@@ -1018,23 +1061,6 @@ async function jsdoc(options = {}) {
|
|
|
1018
1061
|
];
|
|
1019
1062
|
}
|
|
1020
1063
|
|
|
1021
|
-
// src/configs/jsx.ts
|
|
1022
|
-
async function jsx() {
|
|
1023
|
-
return [
|
|
1024
|
-
{
|
|
1025
|
-
files: [GLOB_JSX, GLOB_TSX],
|
|
1026
|
-
languageOptions: {
|
|
1027
|
-
parserOptions: {
|
|
1028
|
-
ecmaFeatures: {
|
|
1029
|
-
jsx: true
|
|
1030
|
-
}
|
|
1031
|
-
}
|
|
1032
|
-
},
|
|
1033
|
-
name: "antfu/jsx/setup"
|
|
1034
|
-
}
|
|
1035
|
-
];
|
|
1036
|
-
}
|
|
1037
|
-
|
|
1038
1064
|
// src/configs/jsonc.ts
|
|
1039
1065
|
async function jsonc(options = {}) {
|
|
1040
1066
|
const {
|
|
@@ -1110,6 +1136,23 @@ async function jsonc(options = {}) {
|
|
|
1110
1136
|
];
|
|
1111
1137
|
}
|
|
1112
1138
|
|
|
1139
|
+
// src/configs/jsx.ts
|
|
1140
|
+
async function jsx() {
|
|
1141
|
+
return [
|
|
1142
|
+
{
|
|
1143
|
+
files: [GLOB_JSX, GLOB_TSX],
|
|
1144
|
+
languageOptions: {
|
|
1145
|
+
parserOptions: {
|
|
1146
|
+
ecmaFeatures: {
|
|
1147
|
+
jsx: true
|
|
1148
|
+
}
|
|
1149
|
+
}
|
|
1150
|
+
},
|
|
1151
|
+
name: "antfu/jsx/setup"
|
|
1152
|
+
}
|
|
1153
|
+
];
|
|
1154
|
+
}
|
|
1155
|
+
|
|
1113
1156
|
// src/configs/markdown.ts
|
|
1114
1157
|
var import_eslint_merge_processors = require("eslint-merge-processors");
|
|
1115
1158
|
async function markdown(options = {}) {
|
|
@@ -1217,6 +1260,25 @@ async function perfectionist() {
|
|
|
1217
1260
|
name: "antfu/perfectionist/setup",
|
|
1218
1261
|
plugins: {
|
|
1219
1262
|
perfectionist: import_eslint_plugin_perfectionist.default
|
|
1263
|
+
},
|
|
1264
|
+
rules: {
|
|
1265
|
+
"perfectionist/sort-exports": ["error", { order: "asc", type: "natural" }],
|
|
1266
|
+
"perfectionist/sort-imports": ["error", {
|
|
1267
|
+
groups: [
|
|
1268
|
+
"builtin",
|
|
1269
|
+
"external",
|
|
1270
|
+
"type",
|
|
1271
|
+
["internal", "internal-type"],
|
|
1272
|
+
["parent", "sibling", "index"],
|
|
1273
|
+
["parent-type", "sibling-type", "index-type"],
|
|
1274
|
+
"object",
|
|
1275
|
+
"unknown"
|
|
1276
|
+
],
|
|
1277
|
+
order: "asc",
|
|
1278
|
+
type: "natural"
|
|
1279
|
+
}],
|
|
1280
|
+
"perfectionist/sort-named-exports": ["error", { order: "asc", type: "natural" }],
|
|
1281
|
+
"perfectionist/sort-named-imports": ["error", { order: "asc", type: "natural" }]
|
|
1220
1282
|
}
|
|
1221
1283
|
}
|
|
1222
1284
|
];
|
|
@@ -1375,6 +1437,31 @@ async function react(options = {}) {
|
|
|
1375
1437
|
];
|
|
1376
1438
|
}
|
|
1377
1439
|
|
|
1440
|
+
// src/configs/regexp.ts
|
|
1441
|
+
var import_eslint_plugin_regexp = require("eslint-plugin-regexp");
|
|
1442
|
+
async function regexp(options = {}) {
|
|
1443
|
+
const config = import_eslint_plugin_regexp.configs["flat/recommended"];
|
|
1444
|
+
const rules = {
|
|
1445
|
+
...config.rules
|
|
1446
|
+
};
|
|
1447
|
+
if (options.level === "warn") {
|
|
1448
|
+
for (const key in rules) {
|
|
1449
|
+
if (rules[key] === "error")
|
|
1450
|
+
rules[key] = "warn";
|
|
1451
|
+
}
|
|
1452
|
+
}
|
|
1453
|
+
return [
|
|
1454
|
+
{
|
|
1455
|
+
...config,
|
|
1456
|
+
name: "antfu/regexp/rules",
|
|
1457
|
+
rules: {
|
|
1458
|
+
...rules,
|
|
1459
|
+
...options.overrides
|
|
1460
|
+
}
|
|
1461
|
+
}
|
|
1462
|
+
];
|
|
1463
|
+
}
|
|
1464
|
+
|
|
1378
1465
|
// src/configs/solid.ts
|
|
1379
1466
|
async function solid(options = {}) {
|
|
1380
1467
|
const {
|
|
@@ -2052,7 +2139,7 @@ async function unicorn(options = {}) {
|
|
|
2052
2139
|
rules: {
|
|
2053
2140
|
...options.allRecommended ? import_eslint_plugin_unicorn.default.configs["flat/recommended"].rules : {
|
|
2054
2141
|
"unicorn/consistent-empty-array-spread": "error",
|
|
2055
|
-
"unicorn/consistent-function-scoping": "error",
|
|
2142
|
+
"unicorn/consistent-function-scoping": ["error", { checkArrowFunctions: false }],
|
|
2056
2143
|
"unicorn/error-message": "error",
|
|
2057
2144
|
"unicorn/escape-case": "error",
|
|
2058
2145
|
"unicorn/new-for-builtins": "error",
|
|
@@ -2332,85 +2419,6 @@ async function yaml(options = {}) {
|
|
|
2332
2419
|
];
|
|
2333
2420
|
}
|
|
2334
2421
|
|
|
2335
|
-
// src/configs/regexp.ts
|
|
2336
|
-
var import_eslint_plugin_regexp = require("eslint-plugin-regexp");
|
|
2337
|
-
async function regexp(options = {}) {
|
|
2338
|
-
const config = import_eslint_plugin_regexp.configs["flat/recommended"];
|
|
2339
|
-
const rules = {
|
|
2340
|
-
...config.rules
|
|
2341
|
-
};
|
|
2342
|
-
if (options.level === "warn") {
|
|
2343
|
-
for (const key in rules) {
|
|
2344
|
-
if (rules[key] === "error")
|
|
2345
|
-
rules[key] = "warn";
|
|
2346
|
-
}
|
|
2347
|
-
}
|
|
2348
|
-
return [
|
|
2349
|
-
{
|
|
2350
|
-
...config,
|
|
2351
|
-
name: "antfu/regexp/rules",
|
|
2352
|
-
rules: {
|
|
2353
|
-
...rules,
|
|
2354
|
-
...options.overrides
|
|
2355
|
-
}
|
|
2356
|
-
}
|
|
2357
|
-
];
|
|
2358
|
-
}
|
|
2359
|
-
|
|
2360
|
-
// src/configs/disables.ts
|
|
2361
|
-
async function disables() {
|
|
2362
|
-
return [
|
|
2363
|
-
{
|
|
2364
|
-
files: [`scripts/${GLOB_SRC}`],
|
|
2365
|
-
name: "antfu/disables/scripts",
|
|
2366
|
-
rules: {
|
|
2367
|
-
"no-console": "off",
|
|
2368
|
-
"ts/explicit-function-return-type": "off",
|
|
2369
|
-
"unicorn/consistent-function-scoping": "off"
|
|
2370
|
-
}
|
|
2371
|
-
},
|
|
2372
|
-
{
|
|
2373
|
-
files: [`cli/${GLOB_SRC}`, `cli.${GLOB_SRC_EXT}`],
|
|
2374
|
-
name: "antfu/disables/cli",
|
|
2375
|
-
rules: {
|
|
2376
|
-
"no-console": "off"
|
|
2377
|
-
}
|
|
2378
|
-
},
|
|
2379
|
-
{
|
|
2380
|
-
files: ["**/bin/**/*", `**/bin.${GLOB_SRC_EXT}`],
|
|
2381
|
-
name: "antfu/disables/bin",
|
|
2382
|
-
rules: {
|
|
2383
|
-
"antfu/no-import-dist": "off",
|
|
2384
|
-
"antfu/no-import-node-modules-by-path": "off"
|
|
2385
|
-
}
|
|
2386
|
-
},
|
|
2387
|
-
{
|
|
2388
|
-
files: ["**/*.d.?([cm])ts"],
|
|
2389
|
-
name: "antfu/disables/dts",
|
|
2390
|
-
rules: {
|
|
2391
|
-
"eslint-comments/no-unlimited-disable": "off",
|
|
2392
|
-
"import/no-duplicates": "off",
|
|
2393
|
-
"no-restricted-syntax": "off",
|
|
2394
|
-
"unused-imports/no-unused-vars": "off"
|
|
2395
|
-
}
|
|
2396
|
-
},
|
|
2397
|
-
{
|
|
2398
|
-
files: ["**/*.{test,spec}.([tj])s?(x)"],
|
|
2399
|
-
name: "antfu/disables/test",
|
|
2400
|
-
rules: {
|
|
2401
|
-
"no-unused-expressions": "off"
|
|
2402
|
-
}
|
|
2403
|
-
},
|
|
2404
|
-
{
|
|
2405
|
-
files: ["**/*.js", "**/*.cjs"],
|
|
2406
|
-
name: "antfu/disables/cjs",
|
|
2407
|
-
rules: {
|
|
2408
|
-
"ts/no-require-imports": "off"
|
|
2409
|
-
}
|
|
2410
|
-
}
|
|
2411
|
-
];
|
|
2412
|
-
}
|
|
2413
|
-
|
|
2414
2422
|
// src/factory.ts
|
|
2415
2423
|
var flatConfigProps = [
|
|
2416
2424
|
"name",
|
package/dist/index.d.cts
CHANGED
|
@@ -1,128 +1,9 @@
|
|
|
1
1
|
import { FlatConfigComposer } from 'eslint-flat-config-utils';
|
|
2
2
|
import { Linter } from 'eslint';
|
|
3
|
-
import {
|
|
3
|
+
import { StylisticCustomizeOptions } from '@stylistic/eslint-plugin';
|
|
4
4
|
import { ParserOptions } from '@typescript-eslint/parser';
|
|
5
|
+
import { FlatGitignoreOptions } from 'eslint-config-flat-gitignore';
|
|
5
6
|
import { Options } from 'eslint-processor-vue-blocks';
|
|
6
|
-
import { StylisticCustomizeOptions } from '@stylistic/eslint-plugin';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Vendor types from Prettier so we don't rely on the dependency.
|
|
10
|
-
*/
|
|
11
|
-
type VendoredPrettierOptions = Partial<VendoredPrettierOptionsRequired>;
|
|
12
|
-
interface VendoredPrettierOptionsRequired {
|
|
13
|
-
/**
|
|
14
|
-
* Specify the line length that the printer will wrap on.
|
|
15
|
-
* @default 120
|
|
16
|
-
*/
|
|
17
|
-
printWidth: number;
|
|
18
|
-
/**
|
|
19
|
-
* Specify the number of spaces per indentation-level.
|
|
20
|
-
*/
|
|
21
|
-
tabWidth: number;
|
|
22
|
-
/**
|
|
23
|
-
* Indent lines with tabs instead of spaces
|
|
24
|
-
*/
|
|
25
|
-
useTabs?: boolean;
|
|
26
|
-
/**
|
|
27
|
-
* Print semicolons at the ends of statements.
|
|
28
|
-
*/
|
|
29
|
-
semi: boolean;
|
|
30
|
-
/**
|
|
31
|
-
* Use single quotes instead of double quotes.
|
|
32
|
-
*/
|
|
33
|
-
singleQuote: boolean;
|
|
34
|
-
/**
|
|
35
|
-
* Use single quotes in JSX.
|
|
36
|
-
*/
|
|
37
|
-
jsxSingleQuote: boolean;
|
|
38
|
-
/**
|
|
39
|
-
* Print trailing commas wherever possible.
|
|
40
|
-
*/
|
|
41
|
-
trailingComma: 'none' | 'es5' | 'all';
|
|
42
|
-
/**
|
|
43
|
-
* Print spaces between brackets in object literals.
|
|
44
|
-
*/
|
|
45
|
-
bracketSpacing: boolean;
|
|
46
|
-
/**
|
|
47
|
-
* Put the `>` of a multi-line HTML (HTML, XML, JSX, Vue, Angular) element at the end of the last line instead of being
|
|
48
|
-
* alone on the next line (does not apply to self closing elements).
|
|
49
|
-
*/
|
|
50
|
-
bracketSameLine: boolean;
|
|
51
|
-
/**
|
|
52
|
-
* Put the `>` of a multi-line JSX element at the end of the last line instead of being alone on the next line.
|
|
53
|
-
* @deprecated use bracketSameLine instead
|
|
54
|
-
*/
|
|
55
|
-
jsxBracketSameLine: boolean;
|
|
56
|
-
/**
|
|
57
|
-
* Format only a segment of a file.
|
|
58
|
-
*/
|
|
59
|
-
rangeStart: number;
|
|
60
|
-
/**
|
|
61
|
-
* Format only a segment of a file.
|
|
62
|
-
* @default Number.POSITIVE_INFINITY
|
|
63
|
-
*/
|
|
64
|
-
rangeEnd: number;
|
|
65
|
-
/**
|
|
66
|
-
* By default, Prettier will wrap markdown text as-is since some services use a linebreak-sensitive renderer.
|
|
67
|
-
* In some cases you may want to rely on editor/viewer soft wrapping instead, so this option allows you to opt out.
|
|
68
|
-
* @default "preserve"
|
|
69
|
-
*/
|
|
70
|
-
proseWrap: 'always' | 'never' | 'preserve';
|
|
71
|
-
/**
|
|
72
|
-
* Include parentheses around a sole arrow function parameter.
|
|
73
|
-
* @default "always"
|
|
74
|
-
*/
|
|
75
|
-
arrowParens: 'avoid' | 'always';
|
|
76
|
-
/**
|
|
77
|
-
* Provide ability to support new languages to prettier.
|
|
78
|
-
*/
|
|
79
|
-
plugins: Array<string | any>;
|
|
80
|
-
/**
|
|
81
|
-
* How to handle whitespaces in HTML.
|
|
82
|
-
* @default "css"
|
|
83
|
-
*/
|
|
84
|
-
htmlWhitespaceSensitivity: 'css' | 'strict' | 'ignore';
|
|
85
|
-
/**
|
|
86
|
-
* Which end of line characters to apply.
|
|
87
|
-
* @default "lf"
|
|
88
|
-
*/
|
|
89
|
-
endOfLine: 'auto' | 'lf' | 'crlf' | 'cr';
|
|
90
|
-
/**
|
|
91
|
-
* Change when properties in objects are quoted.
|
|
92
|
-
* @default "as-needed"
|
|
93
|
-
*/
|
|
94
|
-
quoteProps: 'as-needed' | 'consistent' | 'preserve';
|
|
95
|
-
/**
|
|
96
|
-
* Whether or not to indent the code inside <script> and <style> tags in Vue files.
|
|
97
|
-
* @default false
|
|
98
|
-
*/
|
|
99
|
-
vueIndentScriptAndStyle: boolean;
|
|
100
|
-
/**
|
|
101
|
-
* Enforce single attribute per line in HTML, XML, Vue and JSX.
|
|
102
|
-
* @default false
|
|
103
|
-
*/
|
|
104
|
-
singleAttributePerLine: boolean;
|
|
105
|
-
/**
|
|
106
|
-
* How to handle whitespaces in XML.
|
|
107
|
-
* @default "preserve"
|
|
108
|
-
*/
|
|
109
|
-
xmlQuoteAttributes: 'single' | 'double' | 'preserve';
|
|
110
|
-
/**
|
|
111
|
-
* Whether to put a space inside the brackets of self-closing XML elements.
|
|
112
|
-
* @default true
|
|
113
|
-
*/
|
|
114
|
-
xmlSelfClosingSpace: boolean;
|
|
115
|
-
/**
|
|
116
|
-
* Whether to sort attributes by key in XML elements.
|
|
117
|
-
* @default false
|
|
118
|
-
*/
|
|
119
|
-
xmlSortAttributesByKey: boolean;
|
|
120
|
-
/**
|
|
121
|
-
* How to handle whitespaces in XML.
|
|
122
|
-
* @default "ignore"
|
|
123
|
-
*/
|
|
124
|
-
xmlWhitespaceSensitivity: 'ignore' | 'strict' | 'preserve';
|
|
125
|
-
}
|
|
126
7
|
|
|
127
8
|
/* eslint-disable */
|
|
128
9
|
/* prettier-ignore */
|
|
@@ -15208,6 +15089,125 @@ type Yoda = []|[("always" | "never")]|[("always" | "never"), {
|
|
|
15208
15089
|
// Names of all the configs
|
|
15209
15090
|
type ConfigNames = 'antfu/astro/setup' | 'antfu/astro/rules' | 'antfu/eslint-comments/rules' | 'antfu/formatter/setup' | 'antfu/imports/rules' | 'antfu/javascript/setup' | 'antfu/javascript/rules' | 'antfu/jsx/setup' | 'antfu/jsdoc/rules' | 'antfu/jsonc/setup' | 'antfu/jsonc/rules' | 'antfu/markdown/setup' | 'antfu/markdown/processor' | 'antfu/markdown/parser' | 'antfu/markdown/disables' | 'antfu/node/rules' | 'antfu/perfectionist/setup' | 'antfu/react/setup' | 'antfu/react/rules' | 'antfu/solid/setup' | 'antfu/solid/rules' | 'antfu/sort/package-json' | 'antfu/stylistic/rules' | 'antfu/svelte/setup' | 'antfu/svelte/rules' | 'antfu/test/setup' | 'antfu/test/rules' | 'antfu/toml/setup' | 'antfu/toml/rules' | 'antfu/regexp/rules' | 'antfu/typescript/setup' | 'antfu/typescript/parser' | 'antfu/typescript/rules' | 'antfu/unicorn/rules' | 'antfu/unocss' | 'antfu/vue/setup' | 'antfu/vue/rules' | 'antfu/yaml/setup' | 'antfu/yaml/rules'
|
|
15210
15091
|
|
|
15092
|
+
/**
|
|
15093
|
+
* Vendor types from Prettier so we don't rely on the dependency.
|
|
15094
|
+
*/
|
|
15095
|
+
type VendoredPrettierOptions = Partial<VendoredPrettierOptionsRequired>;
|
|
15096
|
+
interface VendoredPrettierOptionsRequired {
|
|
15097
|
+
/**
|
|
15098
|
+
* Specify the line length that the printer will wrap on.
|
|
15099
|
+
* @default 120
|
|
15100
|
+
*/
|
|
15101
|
+
printWidth: number;
|
|
15102
|
+
/**
|
|
15103
|
+
* Specify the number of spaces per indentation-level.
|
|
15104
|
+
*/
|
|
15105
|
+
tabWidth: number;
|
|
15106
|
+
/**
|
|
15107
|
+
* Indent lines with tabs instead of spaces
|
|
15108
|
+
*/
|
|
15109
|
+
useTabs?: boolean;
|
|
15110
|
+
/**
|
|
15111
|
+
* Print semicolons at the ends of statements.
|
|
15112
|
+
*/
|
|
15113
|
+
semi: boolean;
|
|
15114
|
+
/**
|
|
15115
|
+
* Use single quotes instead of double quotes.
|
|
15116
|
+
*/
|
|
15117
|
+
singleQuote: boolean;
|
|
15118
|
+
/**
|
|
15119
|
+
* Use single quotes in JSX.
|
|
15120
|
+
*/
|
|
15121
|
+
jsxSingleQuote: boolean;
|
|
15122
|
+
/**
|
|
15123
|
+
* Print trailing commas wherever possible.
|
|
15124
|
+
*/
|
|
15125
|
+
trailingComma: 'none' | 'es5' | 'all';
|
|
15126
|
+
/**
|
|
15127
|
+
* Print spaces between brackets in object literals.
|
|
15128
|
+
*/
|
|
15129
|
+
bracketSpacing: boolean;
|
|
15130
|
+
/**
|
|
15131
|
+
* Put the `>` of a multi-line HTML (HTML, XML, JSX, Vue, Angular) element at the end of the last line instead of being
|
|
15132
|
+
* alone on the next line (does not apply to self closing elements).
|
|
15133
|
+
*/
|
|
15134
|
+
bracketSameLine: boolean;
|
|
15135
|
+
/**
|
|
15136
|
+
* Put the `>` of a multi-line JSX element at the end of the last line instead of being alone on the next line.
|
|
15137
|
+
* @deprecated use bracketSameLine instead
|
|
15138
|
+
*/
|
|
15139
|
+
jsxBracketSameLine: boolean;
|
|
15140
|
+
/**
|
|
15141
|
+
* Format only a segment of a file.
|
|
15142
|
+
*/
|
|
15143
|
+
rangeStart: number;
|
|
15144
|
+
/**
|
|
15145
|
+
* Format only a segment of a file.
|
|
15146
|
+
* @default Number.POSITIVE_INFINITY
|
|
15147
|
+
*/
|
|
15148
|
+
rangeEnd: number;
|
|
15149
|
+
/**
|
|
15150
|
+
* By default, Prettier will wrap markdown text as-is since some services use a linebreak-sensitive renderer.
|
|
15151
|
+
* In some cases you may want to rely on editor/viewer soft wrapping instead, so this option allows you to opt out.
|
|
15152
|
+
* @default "preserve"
|
|
15153
|
+
*/
|
|
15154
|
+
proseWrap: 'always' | 'never' | 'preserve';
|
|
15155
|
+
/**
|
|
15156
|
+
* Include parentheses around a sole arrow function parameter.
|
|
15157
|
+
* @default "always"
|
|
15158
|
+
*/
|
|
15159
|
+
arrowParens: 'avoid' | 'always';
|
|
15160
|
+
/**
|
|
15161
|
+
* Provide ability to support new languages to prettier.
|
|
15162
|
+
*/
|
|
15163
|
+
plugins: Array<string | any>;
|
|
15164
|
+
/**
|
|
15165
|
+
* How to handle whitespaces in HTML.
|
|
15166
|
+
* @default "css"
|
|
15167
|
+
*/
|
|
15168
|
+
htmlWhitespaceSensitivity: 'css' | 'strict' | 'ignore';
|
|
15169
|
+
/**
|
|
15170
|
+
* Which end of line characters to apply.
|
|
15171
|
+
* @default "lf"
|
|
15172
|
+
*/
|
|
15173
|
+
endOfLine: 'auto' | 'lf' | 'crlf' | 'cr';
|
|
15174
|
+
/**
|
|
15175
|
+
* Change when properties in objects are quoted.
|
|
15176
|
+
* @default "as-needed"
|
|
15177
|
+
*/
|
|
15178
|
+
quoteProps: 'as-needed' | 'consistent' | 'preserve';
|
|
15179
|
+
/**
|
|
15180
|
+
* Whether or not to indent the code inside <script> and <style> tags in Vue files.
|
|
15181
|
+
* @default false
|
|
15182
|
+
*/
|
|
15183
|
+
vueIndentScriptAndStyle: boolean;
|
|
15184
|
+
/**
|
|
15185
|
+
* Enforce single attribute per line in HTML, XML, Vue and JSX.
|
|
15186
|
+
* @default false
|
|
15187
|
+
*/
|
|
15188
|
+
singleAttributePerLine: boolean;
|
|
15189
|
+
/**
|
|
15190
|
+
* How to handle whitespaces in XML.
|
|
15191
|
+
* @default "preserve"
|
|
15192
|
+
*/
|
|
15193
|
+
xmlQuoteAttributes: 'single' | 'double' | 'preserve';
|
|
15194
|
+
/**
|
|
15195
|
+
* Whether to put a space inside the brackets of self-closing XML elements.
|
|
15196
|
+
* @default true
|
|
15197
|
+
*/
|
|
15198
|
+
xmlSelfClosingSpace: boolean;
|
|
15199
|
+
/**
|
|
15200
|
+
* Whether to sort attributes by key in XML elements.
|
|
15201
|
+
* @default false
|
|
15202
|
+
*/
|
|
15203
|
+
xmlSortAttributesByKey: boolean;
|
|
15204
|
+
/**
|
|
15205
|
+
* How to handle whitespaces in XML.
|
|
15206
|
+
* @default "ignore"
|
|
15207
|
+
*/
|
|
15208
|
+
xmlWhitespaceSensitivity: 'ignore' | 'strict' | 'preserve';
|
|
15209
|
+
}
|
|
15210
|
+
|
|
15211
15211
|
type Awaitable<T> = T | Promise<T>;
|
|
15212
15212
|
type Rules = RuleOptions;
|
|
15213
15213
|
|
|
@@ -15612,6 +15612,8 @@ declare function command(): Promise<TypedFlatConfigItem[]>;
|
|
|
15612
15612
|
|
|
15613
15613
|
declare function comments(): Promise<TypedFlatConfigItem[]>;
|
|
15614
15614
|
|
|
15615
|
+
declare function disables(): Promise<TypedFlatConfigItem[]>;
|
|
15616
|
+
|
|
15615
15617
|
declare function formatters(options?: OptionsFormatters | true, stylistic?: StylisticConfig): Promise<TypedFlatConfigItem[]>;
|
|
15616
15618
|
|
|
15617
15619
|
declare function ignores(userIgnores?: string[]): Promise<TypedFlatConfigItem[]>;
|
|
@@ -15622,16 +15624,16 @@ declare function javascript(options?: OptionsIsInEditor & OptionsOverrides): Pro
|
|
|
15622
15624
|
|
|
15623
15625
|
declare function jsdoc(options?: OptionsStylistic): Promise<TypedFlatConfigItem[]>;
|
|
15624
15626
|
|
|
15625
|
-
declare function jsx(): Promise<TypedFlatConfigItem[]>;
|
|
15626
|
-
|
|
15627
15627
|
declare function jsonc(options?: OptionsFiles & OptionsStylistic & OptionsOverrides): Promise<TypedFlatConfigItem[]>;
|
|
15628
15628
|
|
|
15629
|
+
declare function jsx(): Promise<TypedFlatConfigItem[]>;
|
|
15630
|
+
|
|
15629
15631
|
declare function markdown(options?: OptionsFiles & OptionsComponentExts & OptionsOverrides): Promise<TypedFlatConfigItem[]>;
|
|
15630
15632
|
|
|
15631
15633
|
declare function node(): Promise<TypedFlatConfigItem[]>;
|
|
15632
15634
|
|
|
15633
15635
|
/**
|
|
15634
|
-
*
|
|
15636
|
+
* Perfectionist plugin for props and items sorting.
|
|
15635
15637
|
*
|
|
15636
15638
|
* @see https://github.com/azat-io/eslint-plugin-perfectionist
|
|
15637
15639
|
*/
|
|
@@ -15639,6 +15641,8 @@ declare function perfectionist(): Promise<TypedFlatConfigItem[]>;
|
|
|
15639
15641
|
|
|
15640
15642
|
declare function react(options?: OptionsTypeScriptWithTypes & OptionsOverrides & OptionsFiles): Promise<TypedFlatConfigItem[]>;
|
|
15641
15643
|
|
|
15644
|
+
declare function regexp(options?: OptionsRegExp & OptionsOverrides): Promise<TypedFlatConfigItem[]>;
|
|
15645
|
+
|
|
15642
15646
|
declare function solid(options?: OptionsHasTypeScript & OptionsOverrides & OptionsFiles & OptionsTypeScriptWithTypes): Promise<TypedFlatConfigItem[]>;
|
|
15643
15647
|
|
|
15644
15648
|
/**
|
|
@@ -15676,10 +15680,6 @@ declare function vue(options?: OptionsVue & OptionsHasTypeScript & OptionsOverri
|
|
|
15676
15680
|
|
|
15677
15681
|
declare function yaml(options?: OptionsOverrides & OptionsStylistic & OptionsFiles): Promise<TypedFlatConfigItem[]>;
|
|
15678
15682
|
|
|
15679
|
-
declare function regexp(options?: OptionsRegExp & OptionsOverrides): Promise<TypedFlatConfigItem[]>;
|
|
15680
|
-
|
|
15681
|
-
declare function disables(): Promise<TypedFlatConfigItem[]>;
|
|
15682
|
-
|
|
15683
15683
|
declare const GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
|
|
15684
15684
|
declare const GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
|
|
15685
15685
|
declare const GLOB_JS = "**/*.?([cm])js";
|