@so1ve/eslint-config 3.11.3 → 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 -4
- package/package.json +4 -3
package/dist/index.js
CHANGED
|
@@ -200,7 +200,6 @@ async function formatting(options) {
|
|
|
200
200
|
"so1ve/pad-after-last-import": "error",
|
|
201
201
|
"so1ve/function-style": "error",
|
|
202
202
|
"style/quote-props": ["error", "consistent-as-needed"],
|
|
203
|
-
"style/curly-newline": ["error", { minElements: 1 }],
|
|
204
203
|
"style/no-extra-parens": ["error", "functions"],
|
|
205
204
|
"style/padding-line-between-statements": ["error", {
|
|
206
205
|
blankLine: "always",
|
|
@@ -887,6 +886,37 @@ const onlyError = () => [{
|
|
|
887
886
|
plugins: { "only-error": pluginOnlyError }
|
|
888
887
|
}];
|
|
889
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
|
+
|
|
890
920
|
//#endregion
|
|
891
921
|
//#region src/configs/pnpm.ts
|
|
892
922
|
async function pnpm() {
|
|
@@ -1539,9 +1569,9 @@ const VuePackages = [
|
|
|
1539
1569
|
"@slidev/cli"
|
|
1540
1570
|
];
|
|
1541
1571
|
const defaultPluginRenaming = {
|
|
1572
|
+
"@html-eslint": "html",
|
|
1542
1573
|
"@stylistic": "style",
|
|
1543
1574
|
"@typescript-eslint": "ts",
|
|
1544
|
-
"@html-eslint": "html",
|
|
1545
1575
|
"import-x": "import",
|
|
1546
1576
|
"n": "node",
|
|
1547
1577
|
"yml": "yaml"
|
|
@@ -1550,7 +1580,7 @@ const defaultPluginRenaming = {
|
|
|
1550
1580
|
* Construct an array of ESLint flat config items.
|
|
1551
1581
|
*/
|
|
1552
1582
|
function so1ve(options = {}, ...userConfigs) {
|
|
1553
|
-
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;
|
|
1554
1584
|
const configs = [];
|
|
1555
1585
|
if (enableGitignore) if (typeof enableGitignore === "boolean") {
|
|
1556
1586
|
if (fs.existsSync(".gitignore")) configs.push(interopDefault(import("eslint-config-flat-gitignore")).then((r) => [r()]));
|
|
@@ -1574,6 +1604,7 @@ function so1ve(options = {}, ...userConfigs) {
|
|
|
1574
1604
|
typescript: !!enableTypeScript
|
|
1575
1605
|
}));
|
|
1576
1606
|
if (options.formatting ?? true) configs.push(formatting(options));
|
|
1607
|
+
if (options.perfectionist ?? true) configs.push(perfectionist());
|
|
1577
1608
|
if (options.jsonc ?? true) configs.push(jsonc());
|
|
1578
1609
|
if (options.toml ?? true) configs.push(toml({ overrides: getOverrides(options, "toml") }));
|
|
1579
1610
|
if (options.yaml ?? true) configs.push(yaml({ overrides: getOverrides(options, "yaml") }));
|
|
@@ -1598,4 +1629,4 @@ function getOverrides(options, key) {
|
|
|
1598
1629
|
}
|
|
1599
1630
|
|
|
1600
1631
|
//#endregion
|
|
1601
|
-
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-sort-imports": "3.
|
|
78
|
-
"@so1ve/eslint-plugin": "3.
|
|
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",
|