@so1ve/eslint-config 3.11.4 → 3.14.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 +2406 -149
- package/dist/index.js +39 -3
- package/package.json +20 -19
package/dist/index.js
CHANGED
|
@@ -886,6 +886,37 @@ const onlyError = () => [{
|
|
|
886
886
|
plugins: { "only-error": pluginOnlyError }
|
|
887
887
|
}];
|
|
888
888
|
|
|
889
|
+
//#endregion
|
|
890
|
+
//#region src/configs/perfectionist.ts
|
|
891
|
+
async function perfectionist() {
|
|
892
|
+
return [{
|
|
893
|
+
name: "so1ve/perfectionist/setup",
|
|
894
|
+
plugins: { perfectionist: await interopDefault(import("eslint-plugin-perfectionist")) }
|
|
895
|
+
}, {
|
|
896
|
+
name: "so1ve/perfectionist/rules",
|
|
897
|
+
rules: {
|
|
898
|
+
"perfectionist/sort-array-includes": ["error", {
|
|
899
|
+
ignoreCase: false,
|
|
900
|
+
partitionByComment: true,
|
|
901
|
+
partitionByNewLine: true,
|
|
902
|
+
type: "natural"
|
|
903
|
+
}],
|
|
904
|
+
"perfectionist/sort-decorators": ["error", { type: "natural" }],
|
|
905
|
+
"perfectionist/sort-heritage-clauses": ["error", { type: "natural" }],
|
|
906
|
+
"perfectionist/sort-maps": ["error", {
|
|
907
|
+
partitionByComment: true,
|
|
908
|
+
partitionByNewLine: true,
|
|
909
|
+
type: "natural"
|
|
910
|
+
}],
|
|
911
|
+
"perfectionist/sort-sets": ["error", {
|
|
912
|
+
partitionByComment: true,
|
|
913
|
+
partitionByNewLine: true,
|
|
914
|
+
type: "natural"
|
|
915
|
+
}]
|
|
916
|
+
}
|
|
917
|
+
}];
|
|
918
|
+
}
|
|
919
|
+
|
|
889
920
|
//#endregion
|
|
890
921
|
//#region src/configs/pnpm.ts
|
|
891
922
|
async function pnpm() {
|
|
@@ -1134,6 +1165,7 @@ const typescript = async ({ componentExts = [], parserOptions, overrides } = {})
|
|
|
1134
1165
|
accessibility: "explicit",
|
|
1135
1166
|
overrides: { constructors: "no-public" }
|
|
1136
1167
|
}],
|
|
1168
|
+
"ts/no-empty-object-type": ["error", { allowInterfaces: "always" }],
|
|
1137
1169
|
"no-useless-constructor": "off",
|
|
1138
1170
|
"no-invalid-this": "off",
|
|
1139
1171
|
"ts/no-invalid-this": "error",
|
|
@@ -1282,6 +1314,8 @@ const unicorn = () => [{
|
|
|
1282
1314
|
"unicorn/no-lonely-if": "error",
|
|
1283
1315
|
"unicorn/no-negated-condition": "error",
|
|
1284
1316
|
"unicorn/no-useless-spread": "error",
|
|
1317
|
+
"unicorn/no-useless-collection-argument": "error",
|
|
1318
|
+
"unicorn/no-immediate-mutation": "error",
|
|
1285
1319
|
"unicorn/require-module-specifiers": "error",
|
|
1286
1320
|
"unicorn/prefer-ternary": "error",
|
|
1287
1321
|
"unicorn/prefer-query-selector": "error",
|
|
@@ -1302,6 +1336,7 @@ const unicorn = () => [{
|
|
|
1302
1336
|
"unicorn/prefer-node-protocol": "error",
|
|
1303
1337
|
"unicorn/prefer-negative-index": "error",
|
|
1304
1338
|
"unicorn/prefer-regexp-test": "error",
|
|
1339
|
+
"unicorn/prefer-response-static-json": "error",
|
|
1305
1340
|
"unicorn/prefer-optional-catch-binding": "error",
|
|
1306
1341
|
"unicorn/prefer-object-from-entries": "error",
|
|
1307
1342
|
"unicorn/prefer-prototype-methods": "error",
|
|
@@ -1538,9 +1573,9 @@ const VuePackages = [
|
|
|
1538
1573
|
"@slidev/cli"
|
|
1539
1574
|
];
|
|
1540
1575
|
const defaultPluginRenaming = {
|
|
1576
|
+
"@html-eslint": "html",
|
|
1541
1577
|
"@stylistic": "style",
|
|
1542
1578
|
"@typescript-eslint": "ts",
|
|
1543
|
-
"@html-eslint": "html",
|
|
1544
1579
|
"import-x": "import",
|
|
1545
1580
|
"n": "node",
|
|
1546
1581
|
"yml": "yaml"
|
|
@@ -1549,7 +1584,7 @@ const defaultPluginRenaming = {
|
|
|
1549
1584
|
* Construct an array of ESLint flat config items.
|
|
1550
1585
|
*/
|
|
1551
1586
|
function so1ve(options = {}, ...userConfigs) {
|
|
1552
|
-
const { astro: enableAstro = isPackageExists("astro"),
|
|
1587
|
+
const { astro: enableAstro = isPackageExists("astro"), componentExts = [], gitignore: enableGitignore = true, pnpm: enableCatalogs = false, solid: enableSolid = isPackageExists("solid-js"), typescript: enableTypeScript = isPackageExists("typescript"), vue: enableVue = VuePackages.some((i) => isPackageExists(i)) } = options;
|
|
1553
1588
|
const configs = [];
|
|
1554
1589
|
if (enableGitignore) if (typeof enableGitignore === "boolean") {
|
|
1555
1590
|
if (fs.existsSync(".gitignore")) configs.push(interopDefault(import("eslint-config-flat-gitignore")).then((r) => [r()]));
|
|
@@ -1573,6 +1608,7 @@ function so1ve(options = {}, ...userConfigs) {
|
|
|
1573
1608
|
typescript: !!enableTypeScript
|
|
1574
1609
|
}));
|
|
1575
1610
|
if (options.formatting ?? true) configs.push(formatting(options));
|
|
1611
|
+
if (options.perfectionist ?? true) configs.push(perfectionist());
|
|
1576
1612
|
if (options.jsonc ?? true) configs.push(jsonc());
|
|
1577
1613
|
if (options.toml ?? true) configs.push(toml({ overrides: getOverrides(options, "toml") }));
|
|
1578
1614
|
if (options.yaml ?? true) configs.push(yaml({ overrides: getOverrides(options, "yaml") }));
|
|
@@ -1597,4 +1633,4 @@ function getOverrides(options, key) {
|
|
|
1597
1633
|
}
|
|
1598
1634
|
|
|
1599
1635
|
//#endregion
|
|
1600
|
-
export { GLOB_ALL_SRC, GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_CSS, GLOB_DTS, GLOB_ESLINTRC, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_PACKAGEJSON, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSCONFIG, GLOB_TSX, GLOB_VUE, GLOB_YAML, astro, comments, defaultPluginRenaming, formatting, getOverrides, html, ignores, imports, interopDefault, javascript, jsonc, mdx, node, onlyError, pnpm, promise, renameRules, resolveSubOptions, so1ve, solid, sortImports, test, toml, typescript, unicorn, vue, yaml };
|
|
1636
|
+
export { GLOB_ALL_SRC, GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_CSS, GLOB_DTS, GLOB_ESLINTRC, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_PACKAGEJSON, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSCONFIG, GLOB_TSX, GLOB_VUE, GLOB_YAML, astro, comments, defaultPluginRenaming, formatting, getOverrides, html, ignores, imports, interopDefault, javascript, jsonc, mdx, node, onlyError, perfectionist, pnpm, promise, renameRules, resolveSubOptions, so1ve, solid, sortImports, test, toml, typescript, unicorn, vue, yaml };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@so1ve/eslint-config",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.14.0",
|
|
4
4
|
"author": "Ray <i@mk1.io> (https://github.com/so1ve/)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Ray's eslint config.",
|
|
@@ -33,21 +33,21 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.5.0",
|
|
36
|
-
"@html-eslint/eslint-plugin": "^0.
|
|
37
|
-
"@html-eslint/parser": "^0.
|
|
38
|
-
"@stylistic/eslint-plugin": "^5.
|
|
39
|
-
"@typescript-eslint/parser": "^8.
|
|
40
|
-
"@typescript-eslint/utils": "^8.
|
|
41
|
-
"@unocss/eslint-config": "^66.5.
|
|
42
|
-
"@vitest/eslint-plugin": "^1.3
|
|
36
|
+
"@html-eslint/eslint-plugin": "^0.49.0",
|
|
37
|
+
"@html-eslint/parser": "^0.49.0",
|
|
38
|
+
"@stylistic/eslint-plugin": "^5.6.1",
|
|
39
|
+
"@typescript-eslint/parser": "^8.47.0",
|
|
40
|
+
"@typescript-eslint/utils": "^8.47.0",
|
|
41
|
+
"@unocss/eslint-config": "^66.5.9",
|
|
42
|
+
"@vitest/eslint-plugin": "^1.4.3",
|
|
43
43
|
"astro-eslint-parser": "^1.2.2",
|
|
44
44
|
"eslint-config-flat-gitignore": "^2.1.0",
|
|
45
45
|
"eslint-flat-config-utils": "^2.1.4",
|
|
46
46
|
"eslint-import-resolver-typescript": "^4.4.4",
|
|
47
47
|
"eslint-mdx": "^3.6.2",
|
|
48
48
|
"eslint-plugin-array-func": "^5.1.0",
|
|
49
|
-
"eslint-plugin-astro": "^1.
|
|
50
|
-
"eslint-plugin-case-police": "^2.
|
|
49
|
+
"eslint-plugin-astro": "^1.5.0",
|
|
50
|
+
"eslint-plugin-case-police": "^2.1.1",
|
|
51
51
|
"eslint-plugin-html": "^8.1.3",
|
|
52
52
|
"eslint-plugin-import-x": "^4.16.1",
|
|
53
53
|
"eslint-plugin-jest-formatting": "^3.1.0",
|
|
@@ -58,27 +58,28 @@
|
|
|
58
58
|
"eslint-plugin-no-explicit-type-exports": "^0.12.1",
|
|
59
59
|
"eslint-plugin-no-only-tests": "^3.3.0",
|
|
60
60
|
"eslint-plugin-only-error": "^1.0.2",
|
|
61
|
-
"eslint-plugin-
|
|
61
|
+
"eslint-plugin-perfectionist": "^4.15.1",
|
|
62
|
+
"eslint-plugin-pnpm": "^1.3.0",
|
|
62
63
|
"eslint-plugin-promise": "^7.2.1",
|
|
63
64
|
"eslint-plugin-regexp": "^2.10.0",
|
|
64
65
|
"eslint-plugin-solid": "^0.14.5",
|
|
65
66
|
"eslint-plugin-toml": "^0.12.0",
|
|
66
|
-
"eslint-plugin-unicorn": "^
|
|
67
|
-
"eslint-plugin-unused-imports": "^4.
|
|
68
|
-
"eslint-plugin-vue": "^10.5.
|
|
67
|
+
"eslint-plugin-unicorn": "^62.0.0",
|
|
68
|
+
"eslint-plugin-unused-imports": "^4.3.0",
|
|
69
|
+
"eslint-plugin-vue": "^10.5.1",
|
|
69
70
|
"eslint-plugin-yml": "^1.19.0",
|
|
70
|
-
"globals": "^16.
|
|
71
|
+
"globals": "^16.5.0",
|
|
71
72
|
"jsonc-eslint-parser": "^2.4.1",
|
|
72
73
|
"local-pkg": "^1.1.2",
|
|
73
74
|
"toml-eslint-parser": "^0.10.0",
|
|
74
|
-
"typescript-eslint": "^8.
|
|
75
|
+
"typescript-eslint": "^8.47.0",
|
|
75
76
|
"vue-eslint-parser": "^10.2.0",
|
|
76
77
|
"yaml-eslint-parser": "^1.3.0",
|
|
77
|
-
"@so1ve/eslint-plugin": "3.
|
|
78
|
-
"@so1ve/eslint-plugin
|
|
78
|
+
"@so1ve/eslint-plugin-sort-imports": "3.14.0",
|
|
79
|
+
"@so1ve/eslint-plugin": "3.14.0"
|
|
79
80
|
},
|
|
80
81
|
"peerDependencies": {
|
|
81
|
-
"eslint": "^9.
|
|
82
|
+
"eslint": "^9.39.1",
|
|
82
83
|
"prettier": "^3.6.2"
|
|
83
84
|
},
|
|
84
85
|
"scripts": {
|