@so1ve/eslint-config 3.20.1 → 3.21.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 +123 -126
- package/dist/index.js +2 -4
- package/package.json +4 -6
package/dist/index.d.ts
CHANGED
|
@@ -15860,24 +15860,24 @@ type MaybeArray<T> = T | T[];
|
|
|
15860
15860
|
type Rules = RuleOptions;
|
|
15861
15861
|
type TypedFlatConfigItem = Omit<Linter.Config<Linter.RulesRecord & Rules>, "plugins"> & {
|
|
15862
15862
|
/**
|
|
15863
|
-
|
|
15864
|
-
|
|
15865
|
-
|
|
15866
|
-
|
|
15867
|
-
|
|
15868
|
-
|
|
15863
|
+
* An object containing a name-value mapping of plugin names to plugin
|
|
15864
|
+
* objects. When `files` is specified, these plugins are only available to the
|
|
15865
|
+
* matching files.
|
|
15866
|
+
*
|
|
15867
|
+
* @see [Using plugins in your configuration](https://eslint.org/docs/latest/user-guide/configuring/configuration-files-new#using-plugins-in-your-configuration)
|
|
15868
|
+
*/
|
|
15869
15869
|
plugins?: Record<string, any>;
|
|
15870
15870
|
};
|
|
15871
15871
|
interface OptionsComponentExts {
|
|
15872
15872
|
/**
|
|
15873
|
-
|
|
15874
|
-
|
|
15873
|
+
* Additional extensions for components.
|
|
15874
|
+
*/
|
|
15875
15875
|
componentExts?: string[];
|
|
15876
15876
|
}
|
|
15877
15877
|
interface OptionsTypeScriptParserOptions {
|
|
15878
15878
|
/**
|
|
15879
|
-
|
|
15880
|
-
|
|
15879
|
+
* Additional parser options for TypeScript.
|
|
15880
|
+
*/
|
|
15881
15881
|
parserOptions?: Partial<ParserOptions>;
|
|
15882
15882
|
}
|
|
15883
15883
|
interface OptionsHasTypeScript {
|
|
@@ -15888,101 +15888,101 @@ interface OptionsOverrides {
|
|
|
15888
15888
|
}
|
|
15889
15889
|
interface Options extends OptionsComponentExts {
|
|
15890
15890
|
/**
|
|
15891
|
-
|
|
15892
|
-
|
|
15893
|
-
|
|
15894
|
-
|
|
15895
|
-
|
|
15896
|
-
|
|
15897
|
-
|
|
15891
|
+
* Enable gitignore support.
|
|
15892
|
+
*
|
|
15893
|
+
* Passing an object to configure the options.
|
|
15894
|
+
*
|
|
15895
|
+
* @default true
|
|
15896
|
+
* @see https://github.com/antfu/eslint-config-flat-gitignore
|
|
15897
|
+
*/
|
|
15898
15898
|
gitignore?: boolean | FlatGitignoreOptions;
|
|
15899
15899
|
/**
|
|
15900
|
-
|
|
15901
|
-
|
|
15902
|
-
|
|
15903
|
-
|
|
15900
|
+
* Enable pnpm catalogs support.
|
|
15901
|
+
*
|
|
15902
|
+
* @default false
|
|
15903
|
+
*/
|
|
15904
15904
|
pnpm?: boolean;
|
|
15905
15905
|
/**
|
|
15906
|
-
|
|
15907
|
-
|
|
15906
|
+
* Core rules. Can't be disabled.
|
|
15907
|
+
*/
|
|
15908
15908
|
javascript?: OptionsOverrides;
|
|
15909
15909
|
/**
|
|
15910
|
-
|
|
15911
|
-
|
|
15910
|
+
* Enable HTML support.
|
|
15911
|
+
*/
|
|
15912
15912
|
html?: boolean;
|
|
15913
15913
|
/**
|
|
15914
|
-
|
|
15915
|
-
|
|
15916
|
-
|
|
15917
|
-
|
|
15918
|
-
|
|
15919
|
-
|
|
15914
|
+
* Enable TypeScript support.
|
|
15915
|
+
*
|
|
15916
|
+
* Passing an object to enable TypeScript Language Server support.
|
|
15917
|
+
*
|
|
15918
|
+
* @default auto-detect based on the dependencies
|
|
15919
|
+
*/
|
|
15920
15920
|
typescript?: boolean | OptionsOverrides;
|
|
15921
15921
|
/**
|
|
15922
|
-
|
|
15923
|
-
|
|
15924
|
-
|
|
15925
|
-
|
|
15922
|
+
* Enable test support.
|
|
15923
|
+
*
|
|
15924
|
+
* @default true
|
|
15925
|
+
*/
|
|
15926
15926
|
test?: boolean | OptionsOverrides;
|
|
15927
15927
|
/**
|
|
15928
|
-
|
|
15929
|
-
|
|
15930
|
-
|
|
15931
|
-
|
|
15928
|
+
* Enable Astro support.
|
|
15929
|
+
*
|
|
15930
|
+
* @default auto-detect based on the dependencies
|
|
15931
|
+
*/
|
|
15932
15932
|
astro?: boolean | OptionsOverrides;
|
|
15933
15933
|
/**
|
|
15934
|
-
|
|
15935
|
-
|
|
15936
|
-
|
|
15937
|
-
|
|
15934
|
+
* Enable Vue support.
|
|
15935
|
+
*
|
|
15936
|
+
* @default auto-detect based on the dependencies
|
|
15937
|
+
*/
|
|
15938
15938
|
vue?: boolean | OptionsOverrides;
|
|
15939
15939
|
/**
|
|
15940
|
-
|
|
15941
|
-
|
|
15942
|
-
|
|
15943
|
-
|
|
15940
|
+
* Enable Solid.js support.
|
|
15941
|
+
*
|
|
15942
|
+
* @default auto-detect based on the dependencies
|
|
15943
|
+
*/
|
|
15944
15944
|
solid?: boolean | OptionsOverrides;
|
|
15945
15945
|
/**
|
|
15946
|
-
|
|
15947
|
-
|
|
15948
|
-
|
|
15949
|
-
|
|
15946
|
+
* Enable JSONC support.
|
|
15947
|
+
*
|
|
15948
|
+
* @default true
|
|
15949
|
+
*/
|
|
15950
15950
|
jsonc?: boolean | OptionsOverrides;
|
|
15951
15951
|
/**
|
|
15952
|
-
|
|
15953
|
-
|
|
15954
|
-
|
|
15955
|
-
|
|
15952
|
+
* Enable YAML support.
|
|
15953
|
+
*
|
|
15954
|
+
* @default true
|
|
15955
|
+
*/
|
|
15956
15956
|
yaml?: boolean | OptionsOverrides;
|
|
15957
15957
|
/**
|
|
15958
|
-
|
|
15959
|
-
|
|
15960
|
-
|
|
15961
|
-
|
|
15958
|
+
* Enable TOML support.
|
|
15959
|
+
*
|
|
15960
|
+
* @default true
|
|
15961
|
+
*/
|
|
15962
15962
|
toml?: boolean | OptionsOverrides;
|
|
15963
15963
|
/**
|
|
15964
|
-
|
|
15965
|
-
|
|
15966
|
-
|
|
15967
|
-
|
|
15964
|
+
* Enable markdown and mdx support.
|
|
15965
|
+
*
|
|
15966
|
+
* @default true
|
|
15967
|
+
*/
|
|
15968
15968
|
mdx?: boolean | OptionsOverrides;
|
|
15969
15969
|
/**
|
|
15970
|
-
|
|
15971
|
-
|
|
15972
|
-
|
|
15973
|
-
|
|
15970
|
+
* Enable formatting rules.
|
|
15971
|
+
*
|
|
15972
|
+
* @default true
|
|
15973
|
+
*/
|
|
15974
15974
|
formatting?: boolean;
|
|
15975
15975
|
/**
|
|
15976
|
-
|
|
15977
|
-
|
|
15978
|
-
|
|
15979
|
-
|
|
15976
|
+
* Enable perfectionist rules.
|
|
15977
|
+
*
|
|
15978
|
+
* @default true
|
|
15979
|
+
*/
|
|
15980
15980
|
perfectionist?: boolean;
|
|
15981
15981
|
/**
|
|
15982
|
-
|
|
15983
|
-
|
|
15984
|
-
|
|
15985
|
-
|
|
15982
|
+
* Provide overrides for rules for each integration.
|
|
15983
|
+
*
|
|
15984
|
+
* @deprecated Use `overrides` option in each integration key instead
|
|
15985
|
+
*/
|
|
15986
15986
|
overrides?: {
|
|
15987
15987
|
javascript?: TypedFlatConfigItem["rules"];
|
|
15988
15988
|
typescript?: TypedFlatConfigItem["rules"];
|
|
@@ -16098,69 +16098,66 @@ declare const defaultPluginRenaming: {
|
|
|
16098
16098
|
yml: string;
|
|
16099
16099
|
};
|
|
16100
16100
|
/**
|
|
16101
|
-
|
|
16102
|
-
|
|
16101
|
+
* Construct an array of ESLint flat config items.
|
|
16102
|
+
*/
|
|
16103
16103
|
declare function so1ve(options?: Options & TypedFlatConfigItem, ...userConfigs: MaybeArray<TypedFlatConfigItem>[]): FlatConfigComposer<TypedFlatConfigItem, ConfigNames>;
|
|
16104
16104
|
type ResolvedOptions<T> = T extends boolean ? never : NonNullable<T>;
|
|
16105
|
-
declare
|
|
16106
|
-
declare function getOverrides<K extends keyof Options>(options: Options, key: K): any;
|
|
16105
|
+
declare function getOverrides<K extends keyof Options>(options: Options, key: K): TypedFlatConfigItem["rules"];
|
|
16107
16106
|
//#endregion
|
|
16108
16107
|
//#region src/globs.d.ts
|
|
16109
|
-
declare const GLOB_SRC_EXT
|
|
16110
|
-
declare const GLOB_SRC
|
|
16111
|
-
declare const GLOB_JS
|
|
16112
|
-
declare const GLOB_JSX
|
|
16113
|
-
declare const GLOB_TS
|
|
16114
|
-
declare const GLOB_TSX
|
|
16115
|
-
declare const GLOB_DTS
|
|
16116
|
-
declare const GLOB_STYLE
|
|
16117
|
-
declare const GLOB_CSS
|
|
16118
|
-
declare const GLOB_LESS
|
|
16119
|
-
declare const GLOB_SCSS
|
|
16120
|
-
declare const GLOB_JSON
|
|
16121
|
-
declare const GLOB_JSON5
|
|
16122
|
-
declare const GLOB_JSONC
|
|
16123
|
-
declare const GLOB_ESLINTRC
|
|
16124
|
-
declare const GLOB_MARKDOWN
|
|
16125
|
-
declare const GLOB_ASTRO
|
|
16126
|
-
declare const GLOB_ASTRO_TS
|
|
16127
|
-
declare const GLOB_VUE
|
|
16128
|
-
declare const GLOB_YAML
|
|
16129
|
-
declare const GLOB_TOML
|
|
16130
|
-
declare const GLOB_HTML
|
|
16131
|
-
declare const GLOB_PACKAGEJSON
|
|
16108
|
+
declare const GLOB_SRC_EXT: string;
|
|
16109
|
+
declare const GLOB_SRC: string;
|
|
16110
|
+
declare const GLOB_JS: string;
|
|
16111
|
+
declare const GLOB_JSX: string;
|
|
16112
|
+
declare const GLOB_TS: string;
|
|
16113
|
+
declare const GLOB_TSX: string;
|
|
16114
|
+
declare const GLOB_DTS: string;
|
|
16115
|
+
declare const GLOB_STYLE: string;
|
|
16116
|
+
declare const GLOB_CSS: string;
|
|
16117
|
+
declare const GLOB_LESS: string;
|
|
16118
|
+
declare const GLOB_SCSS: string;
|
|
16119
|
+
declare const GLOB_JSON: string;
|
|
16120
|
+
declare const GLOB_JSON5: string;
|
|
16121
|
+
declare const GLOB_JSONC: string;
|
|
16122
|
+
declare const GLOB_ESLINTRC: string;
|
|
16123
|
+
declare const GLOB_MARKDOWN: string;
|
|
16124
|
+
declare const GLOB_ASTRO: string;
|
|
16125
|
+
declare const GLOB_ASTRO_TS: string;
|
|
16126
|
+
declare const GLOB_VUE: string;
|
|
16127
|
+
declare const GLOB_YAML: string;
|
|
16128
|
+
declare const GLOB_TOML: string;
|
|
16129
|
+
declare const GLOB_HTML: string;
|
|
16130
|
+
declare const GLOB_PACKAGEJSON: string;
|
|
16132
16131
|
declare const GLOB_TSCONFIG: string[];
|
|
16133
|
-
declare const GLOB_MARKDOWN_CODE
|
|
16132
|
+
declare const GLOB_MARKDOWN_CODE: string;
|
|
16134
16133
|
declare const GLOB_TESTS: string[];
|
|
16135
16134
|
declare const GLOB_ALL_SRC: string[];
|
|
16136
16135
|
declare const GLOB_EXCLUDE: string[];
|
|
16137
16136
|
//#endregion
|
|
16138
16137
|
//#region src/utils.d.ts
|
|
16139
16138
|
/**
|
|
16140
|
-
|
|
16141
|
-
|
|
16142
|
-
|
|
16143
|
-
|
|
16144
|
-
|
|
16145
|
-
|
|
16146
|
-
|
|
16147
|
-
|
|
16148
|
-
|
|
16149
|
-
|
|
16150
|
-
|
|
16151
|
-
|
|
16152
|
-
|
|
16153
|
-
|
|
16154
|
-
|
|
16155
|
-
|
|
16156
|
-
|
|
16157
|
-
|
|
16158
|
-
|
|
16159
|
-
declare const renameRules: (rules: Record<string, any>, map: Record<string, string>) =>
|
|
16160
|
-
[k: string]: any;
|
|
16161
|
-
};
|
|
16139
|
+
* Rename plugin prefixes in a rule object. Accepts a map of prefixes to rename.
|
|
16140
|
+
*
|
|
16141
|
+
* @example
|
|
16142
|
+
*
|
|
16143
|
+
* ```ts
|
|
16144
|
+
* import { renameRules } from "@antfu/eslint-config";
|
|
16145
|
+
*
|
|
16146
|
+
* export default [
|
|
16147
|
+
* {
|
|
16148
|
+
* rules: renameRules(
|
|
16149
|
+
* {
|
|
16150
|
+
* "@typescript-eslint/indent": "error",
|
|
16151
|
+
* },
|
|
16152
|
+
* { "@typescript-eslint": "ts" },
|
|
16153
|
+
* ),
|
|
16154
|
+
* },
|
|
16155
|
+
* ];
|
|
16156
|
+
* ```
|
|
16157
|
+
*/
|
|
16158
|
+
declare const renameRules: (rules: Record<string, any>, map: Record<string, string>) => Record<string, any>;
|
|
16162
16159
|
declare function interopDefault<T>(m: MaybePromise<T>): Promise<T extends {
|
|
16163
16160
|
default: infer U;
|
|
16164
16161
|
} ? U : T>;
|
|
16165
16162
|
//#endregion
|
|
16166
|
-
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, MaybeArray, MaybePromise, Options, OptionsComponentExts, OptionsHasTypeScript, OptionsOverrides, OptionsTypeScriptParserOptions, ResolvedOptions, Rules, TypedFlatConfigItem, astro, command, comments, defaultPluginRenaming, formatting, getOverrides, html, ignores, imports, interopDefault, javascript, jsonc, mdx, node, onlyError, perfectionist, pnpm, promise, renameRules,
|
|
16163
|
+
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, MaybeArray, MaybePromise, Options, OptionsComponentExts, OptionsHasTypeScript, OptionsOverrides, OptionsTypeScriptParserOptions, ResolvedOptions, Rules, TypedFlatConfigItem, astro, command, comments, defaultPluginRenaming, formatting, getOverrides, html, ignores, imports, interopDefault, javascript, jsonc, mdx, node, onlyError, perfectionist, pnpm, promise, renameRules, so1ve, solid, sortImports, test, toml, typescript$1 as typescript, unicorn, vue, yaml };
|
package/dist/index.js
CHANGED
|
@@ -1313,7 +1313,6 @@ const unicorn = () => [{
|
|
|
1313
1313
|
"unicorn/no-await-expression-member": "error",
|
|
1314
1314
|
"unicorn/no-await-in-promise-methods": "error",
|
|
1315
1315
|
"unicorn/no-for-loop": "error",
|
|
1316
|
-
"unicorn/no-immediate-mutation": "error",
|
|
1317
1316
|
"unicorn/no-instanceof-builtins": "error",
|
|
1318
1317
|
"unicorn/no-lonely-if": "error",
|
|
1319
1318
|
"unicorn/no-negated-condition": "error",
|
|
@@ -1670,9 +1669,8 @@ function so1ve(options = {}, ...userConfigs) {
|
|
|
1670
1669
|
if (Object.keys(fusedConfig).length > 0) configs.push([fusedConfig]);
|
|
1671
1670
|
return new FlatConfigComposer().append(...configs, ...userConfigs).renamePlugins(defaultPluginRenaming);
|
|
1672
1671
|
}
|
|
1673
|
-
const resolveSubOptions = (options, key) => typeof options[key] === "boolean" ? {} : options[key] ?? {};
|
|
1674
1672
|
function getOverrides(options, key) {
|
|
1675
|
-
const sub =
|
|
1673
|
+
const sub = typeof options[key] === "boolean" ? {} : options[key] ?? {};
|
|
1676
1674
|
return {
|
|
1677
1675
|
...options.overrides?.[key],
|
|
1678
1676
|
..."overrides" in sub ? sub.overrides : {}
|
|
@@ -1680,4 +1678,4 @@ function getOverrides(options, key) {
|
|
|
1680
1678
|
}
|
|
1681
1679
|
|
|
1682
1680
|
//#endregion
|
|
1683
|
-
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, command, comments, defaultPluginRenaming, formatting, getOverrides, html, ignores, imports, interopDefault, javascript, jsonc, mdx, node, onlyError, perfectionist, pnpm, promise, renameRules,
|
|
1681
|
+
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, command, comments, defaultPluginRenaming, formatting, getOverrides, html, ignores, imports, interopDefault, javascript, jsonc, mdx, node, onlyError, perfectionist, pnpm, promise, renameRules, 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.21.0",
|
|
4
4
|
"author": "Ray <i@mk1.io> (https://github.com/so1ve/)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Ray's eslint config.",
|
|
@@ -77,16 +77,14 @@
|
|
|
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-sort-imports": "3.
|
|
80
|
+
"@so1ve/eslint-plugin": "3.21.0",
|
|
81
|
+
"@so1ve/eslint-plugin-sort-imports": "3.21.0"
|
|
82
82
|
},
|
|
83
83
|
"peerDependencies": {
|
|
84
84
|
"eslint": "^9.39.1",
|
|
85
85
|
"prettier": "^3.6.2"
|
|
86
86
|
},
|
|
87
87
|
"scripts": {
|
|
88
|
-
"
|
|
89
|
-
"typegen": "tsx ./scripts/typegen.ts",
|
|
90
|
-
"watch": "tsdown --watch"
|
|
88
|
+
"typegen": "tsx ./scripts/typegen.ts"
|
|
91
89
|
}
|
|
92
90
|
}
|