@so1ve/eslint-config 3.11.4 → 3.12.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 → index-CPXgTZqf.d.ts} +2164 -4
- package/dist/index.js +35 -3
- package/package.json +4 -3
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() {
|
|
@@ -1538,9 +1569,9 @@ const VuePackages = [
|
|
|
1538
1569
|
"@slidev/cli"
|
|
1539
1570
|
];
|
|
1540
1571
|
const defaultPluginRenaming = {
|
|
1572
|
+
"@html-eslint": "html",
|
|
1541
1573
|
"@stylistic": "style",
|
|
1542
1574
|
"@typescript-eslint": "ts",
|
|
1543
|
-
"@html-eslint": "html",
|
|
1544
1575
|
"import-x": "import",
|
|
1545
1576
|
"n": "node",
|
|
1546
1577
|
"yml": "yaml"
|
|
@@ -1549,7 +1580,7 @@ const defaultPluginRenaming = {
|
|
|
1549
1580
|
* Construct an array of ESLint flat config items.
|
|
1550
1581
|
*/
|
|
1551
1582
|
function so1ve(options = {}, ...userConfigs) {
|
|
1552
|
-
const { astro: enableAstro = isPackageExists("astro"),
|
|
1583
|
+
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
1584
|
const configs = [];
|
|
1554
1585
|
if (enableGitignore) if (typeof enableGitignore === "boolean") {
|
|
1555
1586
|
if (fs.existsSync(".gitignore")) configs.push(interopDefault(import("eslint-config-flat-gitignore")).then((r) => [r()]));
|
|
@@ -1573,6 +1604,7 @@ function so1ve(options = {}, ...userConfigs) {
|
|
|
1573
1604
|
typescript: !!enableTypeScript
|
|
1574
1605
|
}));
|
|
1575
1606
|
if (options.formatting ?? true) configs.push(formatting(options));
|
|
1607
|
+
if (options.perfectionist ?? true) configs.push(perfectionist());
|
|
1576
1608
|
if (options.jsonc ?? true) configs.push(jsonc());
|
|
1577
1609
|
if (options.toml ?? true) configs.push(toml({ overrides: getOverrides(options, "toml") }));
|
|
1578
1610
|
if (options.yaml ?? true) configs.push(yaml({ overrides: getOverrides(options, "yaml") }));
|
|
@@ -1597,4 +1629,4 @@ function getOverrides(options, key) {
|
|
|
1597
1629
|
}
|
|
1598
1630
|
|
|
1599
1631
|
//#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 };
|
|
1632
|
+
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.12.0",
|
|
4
4
|
"author": "Ray <i@mk1.io> (https://github.com/so1ve/)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Ray's eslint config.",
|
|
@@ -58,6 +58,7 @@
|
|
|
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-perfectionist": "^4.15.1",
|
|
61
62
|
"eslint-plugin-pnpm": "^1.2.0",
|
|
62
63
|
"eslint-plugin-promise": "^7.2.1",
|
|
63
64
|
"eslint-plugin-regexp": "^2.10.0",
|
|
@@ -74,8 +75,8 @@
|
|
|
74
75
|
"typescript-eslint": "^8.46.1",
|
|
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.12.0",
|
|
79
|
+
"@so1ve/eslint-plugin": "3.12.0"
|
|
79
80
|
},
|
|
80
81
|
"peerDependencies": {
|
|
81
82
|
"eslint": "^9.37.0",
|