@so1ve/eslint-config 3.16.0 → 3.18.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.ts +50 -1
- package/dist/index.js +58 -18
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -884,6 +884,41 @@ interface RuleOptions {
|
|
|
884
884
|
* @deprecated
|
|
885
885
|
*/
|
|
886
886
|
'implicit-arrow-linebreak'?: Linter.RuleEntry<ImplicitArrowLinebreak>;
|
|
887
|
+
/**
|
|
888
|
+
* Enforce or ban the use of inline type-only markers for named imports.
|
|
889
|
+
* @see https://github.com/9romise/eslint-plugin-import-lite/blob/main/src/rules/consistent-type-specifier-style/README.md
|
|
890
|
+
*/
|
|
891
|
+
'import-lite/consistent-type-specifier-style'?: Linter.RuleEntry<ImportLiteConsistentTypeSpecifierStyle>;
|
|
892
|
+
/**
|
|
893
|
+
* Ensure all imports appear before other statements.
|
|
894
|
+
* @see https://github.com/9romise/eslint-plugin-import-lite/blob/main/src/rules/first/README.md
|
|
895
|
+
*/
|
|
896
|
+
'import-lite/first'?: Linter.RuleEntry<ImportLiteFirst>;
|
|
897
|
+
/**
|
|
898
|
+
* Enforce a newline after import statements.
|
|
899
|
+
* @see https://github.com/9romise/eslint-plugin-import-lite/blob/main/src/rules/newline-after-import/README.md
|
|
900
|
+
*/
|
|
901
|
+
'import-lite/newline-after-import'?: Linter.RuleEntry<ImportLiteNewlineAfterImport>;
|
|
902
|
+
/**
|
|
903
|
+
* Forbid default exports.
|
|
904
|
+
* @see https://github.com/9romise/eslint-plugin-import-lite/blob/main/src/rules/no-default-export/README.md
|
|
905
|
+
*/
|
|
906
|
+
'import-lite/no-default-export'?: Linter.RuleEntry<[]>;
|
|
907
|
+
/**
|
|
908
|
+
* Forbid repeated import of the same module in multiple places.
|
|
909
|
+
* @see https://github.com/9romise/eslint-plugin-import-lite/blob/main/src/rules/no-duplicates/README.md
|
|
910
|
+
*/
|
|
911
|
+
'import-lite/no-duplicates'?: Linter.RuleEntry<ImportLiteNoDuplicates>;
|
|
912
|
+
/**
|
|
913
|
+
* Forbid the use of mutable exports with `var` or `let`.
|
|
914
|
+
* @see https://github.com/9romise/eslint-plugin-import-lite/blob/main/src/rules/no-mutable-exports/README.md
|
|
915
|
+
*/
|
|
916
|
+
'import-lite/no-mutable-exports'?: Linter.RuleEntry<[]>;
|
|
917
|
+
/**
|
|
918
|
+
* Forbid named default exports.
|
|
919
|
+
* @see https://github.com/9romise/eslint-plugin-import-lite/blob/main/src/rules/no-named-default/README.md
|
|
920
|
+
*/
|
|
921
|
+
'import-lite/no-named-default'?: Linter.RuleEntry<[]>;
|
|
887
922
|
/**
|
|
888
923
|
* Enforce or ban the use of inline type-only markers for named imports.
|
|
889
924
|
* @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.16.1/docs/rules/consistent-type-specifier-style.md
|
|
@@ -7749,6 +7784,20 @@ type IdMatch = [] | [string] | [string, {
|
|
|
7749
7784
|
}];
|
|
7750
7785
|
// ----- implicit-arrow-linebreak -----
|
|
7751
7786
|
type ImplicitArrowLinebreak = [] | [("beside" | "below")];
|
|
7787
|
+
// ----- import-lite/consistent-type-specifier-style -----
|
|
7788
|
+
type ImportLiteConsistentTypeSpecifierStyle = [] | [("top-level" | "inline" | "prefer-top-level")];
|
|
7789
|
+
// ----- import-lite/first -----
|
|
7790
|
+
type ImportLiteFirst = [] | [("absolute-first" | "disable-absolute-first")];
|
|
7791
|
+
// ----- import-lite/newline-after-import -----
|
|
7792
|
+
type ImportLiteNewlineAfterImport = [] | [{
|
|
7793
|
+
count?: number;
|
|
7794
|
+
exactCount?: boolean;
|
|
7795
|
+
considerComments?: boolean;
|
|
7796
|
+
}];
|
|
7797
|
+
// ----- import-lite/no-duplicates -----
|
|
7798
|
+
type ImportLiteNoDuplicates = [] | [{
|
|
7799
|
+
"prefer-inline"?: boolean;
|
|
7800
|
+
}];
|
|
7752
7801
|
// ----- import/consistent-type-specifier-style -----
|
|
7753
7802
|
type ImportConsistentTypeSpecifierStyle = [] | [("prefer-top-level" | "prefer-inline")];
|
|
7754
7803
|
// ----- import/dynamic-import-chunkname -----
|
|
@@ -15803,7 +15852,7 @@ type Yoda = [] | [("always" | "never")] | [("always" | "never"), {
|
|
|
15803
15852
|
onlyEquality?: boolean;
|
|
15804
15853
|
}];
|
|
15805
15854
|
// Names of all the configs
|
|
15806
|
-
type ConfigNames = 'antfu/astro/setup' | 'antfu/astro/rules' | 'so1ve/comments/setup' | 'so1ve/comments/rules' | 'so1ve/formatting/setup' | 'so1ve/formatting/rules' | 'so1ve/formatting/rules/sort-package-json' | 'so1ve/formatting/rules/sort-tsconfig' | 'so1ve/formatting/rules/test' | 'so1ve/html/setup' | 'so1ve/html/rules' | 'so1ve/ignores' | 'so1ve/imports/setup' | 'so1ve/imports/rules' | 'so1ve/imports/rules/dts' | 'so1ve/javascript/setup' | 'so1ve/javascript/rules' | 'so1ve/javascript/regexp' | 'so1ve/javascript/cli' | 'so1ve/jsonc/setup' | 'so1ve/jsonc/rules' | 'so1ve/mdx/setup' | 'so1ve/mdx/rules' | 'so1ve/node/setup' | 'so1ve/node/rules' | 'so1ve/only-error' | 'so1ve/perfectionist/setup' | 'so1ve/perfectionist/rules' | 'so1ve/pnpm/package-json' | 'so1ve/pnpm/pnpm-workspace-yaml' | 'so1ve/promise/setup' | 'so1ve/promise/rules' | 'so1ve/solid/setup' | 'so1ve/solid/rules' | 'so1ve/sort-imports/setup' | 'so1ve/sort-imports/rules' | 'so1ve/test/setup' | 'so1ve/test/rules' | 'so1ve/toml/setup' | 'so1ve/toml/rules' | 'so1ve/typescript/setup' | 'so1ve/typescript/rules' | 'so1ve/typescript/rules/type-aware' | 'so1ve/typescript/rules/dts' | 'so1ve/typescript/rules/js' | 'so1ve/unicorn/setup' | 'so1ve/unicorn/rules' | 'so1ve/vue/setup' | 'so1ve/vue/rules' | 'so1ve/yaml/setup' | 'so1ve/yaml/rules';
|
|
15855
|
+
type ConfigNames = 'antfu/astro/setup' | 'antfu/astro/rules' | 'so1ve/comments/setup' | 'so1ve/comments/rules' | 'so1ve/formatting/setup' | 'so1ve/formatting/rules' | 'so1ve/formatting/rules/sort-package-json' | 'so1ve/formatting/rules/sort-tsconfig' | 'so1ve/formatting/rules/test' | 'so1ve/html/setup' | 'so1ve/html/rules' | 'so1ve/ignores' | 'so1ve/imports/setup' | 'so1ve/imports/rules' | 'so1ve/imports/rules/dts' | 'so1ve/javascript/setup' | 'so1ve/javascript/rules' | 'so1ve/javascript/regexp' | 'so1ve/javascript/cli' | 'so1ve/jsonc/setup' | 'so1ve/jsonc/rules' | 'so1ve/mdx/setup' | 'so1ve/mdx/rules' | 'so1ve/node/setup' | 'so1ve/node/rules' | 'so1ve/only-error' | 'so1ve/perfectionist/setup' | 'so1ve/perfectionist/rules' | 'so1ve/pnpm/package-json' | 'so1ve/pnpm/pnpm-workspace-yaml' | 'so1ve/promise/setup' | 'so1ve/promise/rules' | 'so1ve/solid/setup' | 'so1ve/solid/rules' | 'so1ve/sort-imports/setup' | 'so1ve/sort-imports/rules' | 'so1ve/test/setup' | 'so1ve/test/rules' | 'so1ve/toml/setup' | 'so1ve/toml/rules' | 'so1ve/typescript/setup' | 'so1ve/typescript/rules' | 'so1ve/typescript/rules/type-aware' | 'so1ve/typescript/rules/dts' | 'so1ve/typescript/rules/js' | 'so1ve/unicorn/setup' | 'so1ve/unicorn/rules' | 'so1ve/vue/setup' | 'so1ve/vue/rules' | 'so1ve/yaml/setup' | 'so1ve/yaml/rules' | 'so1ve/yaml/pnpm-workspace';
|
|
15807
15856
|
//#endregion
|
|
15808
15857
|
//#region src/types.d.ts
|
|
15809
15858
|
type MaybePromise<T> = T | Promise<T>;
|
package/dist/index.js
CHANGED
|
@@ -262,6 +262,7 @@ async function formatting(options) {
|
|
|
262
262
|
rules: { "jsonc/sort-keys": [
|
|
263
263
|
"error",
|
|
264
264
|
{
|
|
265
|
+
pathPattern: "^$",
|
|
265
266
|
order: [
|
|
266
267
|
"extends",
|
|
267
268
|
"compilerOptions",
|
|
@@ -269,10 +270,10 @@ async function formatting(options) {
|
|
|
269
270
|
"files",
|
|
270
271
|
"include",
|
|
271
272
|
"exclude"
|
|
272
|
-
]
|
|
273
|
-
pathPattern: "^$"
|
|
273
|
+
]
|
|
274
274
|
},
|
|
275
275
|
{
|
|
276
|
+
pathPattern: "^compilerOptions$",
|
|
276
277
|
order: [
|
|
277
278
|
"incremental",
|
|
278
279
|
"composite",
|
|
@@ -362,8 +363,11 @@ async function formatting(options) {
|
|
|
362
363
|
"skipDefaultLibCheck",
|
|
363
364
|
"skipLibCheck",
|
|
364
365
|
"paths"
|
|
365
|
-
]
|
|
366
|
-
|
|
366
|
+
]
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
pathPattern: "^compilerOptions\\.paths$",
|
|
370
|
+
order: { type: "asc" }
|
|
367
371
|
}
|
|
368
372
|
] }
|
|
369
373
|
}],
|
|
@@ -1551,21 +1555,57 @@ async function vue({ overrides, typescript: typescript$1 } = {}) {
|
|
|
1551
1555
|
//#region src/configs/yaml.ts
|
|
1552
1556
|
async function yaml({ overrides } = {}) {
|
|
1553
1557
|
const [parserYaml, pluginYaml] = await Promise.all([interopDefault(import("yaml-eslint-parser")), interopDefault(import("eslint-plugin-yml"))]);
|
|
1554
|
-
return [
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1558
|
+
return [
|
|
1559
|
+
{
|
|
1560
|
+
name: "so1ve/yaml/setup",
|
|
1561
|
+
plugins: { yaml: pluginYaml }
|
|
1562
|
+
},
|
|
1563
|
+
{
|
|
1564
|
+
name: "so1ve/yaml/rules",
|
|
1565
|
+
languageOptions: { parser: parserYaml },
|
|
1566
|
+
files: [GLOB_YAML],
|
|
1567
|
+
rules: {
|
|
1568
|
+
...renameRules(pluginYaml.configs.prettier.rules, { yml: "yaml" }),
|
|
1569
|
+
...renameRules(pluginYaml.configs.recommended.rules, { yml: "yaml" }),
|
|
1570
|
+
"style/spaced-comment": "off",
|
|
1571
|
+
"yaml/no-empty-document": "off",
|
|
1572
|
+
...overrides
|
|
1573
|
+
}
|
|
1574
|
+
},
|
|
1575
|
+
{
|
|
1576
|
+
files: ["pnpm-workspace.yaml"],
|
|
1577
|
+
name: "so1ve/yaml/pnpm-workspace",
|
|
1578
|
+
rules: { "yaml/sort-keys": [
|
|
1579
|
+
"error",
|
|
1580
|
+
{
|
|
1581
|
+
order: [
|
|
1582
|
+
"packages",
|
|
1583
|
+
"overrides",
|
|
1584
|
+
"patchedDependencies",
|
|
1585
|
+
"hoistPattern",
|
|
1586
|
+
"allowedDeprecatedVersions",
|
|
1587
|
+
"allowNonAppliedPatches",
|
|
1588
|
+
"configDependencies",
|
|
1589
|
+
"ignoredBuiltDependencies",
|
|
1590
|
+
"ignoredOptionalDependencies",
|
|
1591
|
+
"neverBuiltDependencies",
|
|
1592
|
+
"onlyBuiltDependencies",
|
|
1593
|
+
"onlyBuiltDependenciesFile",
|
|
1594
|
+
"packageExtensions",
|
|
1595
|
+
"peerDependencyRules",
|
|
1596
|
+
"supportedArchitectures",
|
|
1597
|
+
"catalog",
|
|
1598
|
+
"catalogs"
|
|
1599
|
+
],
|
|
1600
|
+
pathPattern: "^$"
|
|
1601
|
+
},
|
|
1602
|
+
{
|
|
1603
|
+
order: { type: "asc" },
|
|
1604
|
+
pathPattern: ".*"
|
|
1605
|
+
}
|
|
1606
|
+
] }
|
|
1567
1607
|
}
|
|
1568
|
-
|
|
1608
|
+
];
|
|
1569
1609
|
}
|
|
1570
1610
|
|
|
1571
1611
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@so1ve/eslint-config",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.18.0",
|
|
4
4
|
"author": "Ray <i@mk1.io> (https://github.com/so1ve/)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Ray's eslint config.",
|
|
@@ -77,8 +77,8 @@
|
|
|
77
77
|
"typescript-eslint": "^8.47.0",
|
|
78
78
|
"vue-eslint-parser": "^10.2.0",
|
|
79
79
|
"yaml-eslint-parser": "^1.3.0",
|
|
80
|
-
"@so1ve/eslint-plugin": "3.
|
|
81
|
-
"@so1ve/eslint-plugin
|
|
80
|
+
"@so1ve/eslint-plugin-sort-imports": "3.18.0",
|
|
81
|
+
"@so1ve/eslint-plugin": "3.18.0"
|
|
82
82
|
},
|
|
83
83
|
"peerDependencies": {
|
|
84
84
|
"eslint": "^9.39.1",
|