@ntnyq/eslint-config 2.8.2 → 3.0.0-beta.1
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/README.md +1 -1
- package/dist/index.cjs +279 -119
- package/dist/index.d.cts +129 -40
- package/dist/index.d.ts +129 -40
- package/dist/index.js +276 -118
- package/package.json +10 -11
package/dist/index.d.cts
CHANGED
|
@@ -441,7 +441,7 @@ interface RuleOptions {
|
|
|
441
441
|
*/
|
|
442
442
|
'@typescript-eslint/no-unnecessary-type-constraint'?: Linter.RuleEntry<[]>;
|
|
443
443
|
/**
|
|
444
|
-
* Disallow type parameters that
|
|
444
|
+
* Disallow type parameters that aren't used multiple times
|
|
445
445
|
* @see https://typescript-eslint.io/rules/no-unnecessary-type-parameters
|
|
446
446
|
*/
|
|
447
447
|
'@typescript-eslint/no-unnecessary-type-parameters'?: Linter.RuleEntry<[]>;
|
|
@@ -4922,6 +4922,7 @@ type TypescriptEslintNoMisusedPromises = [] | [
|
|
|
4922
4922
|
checksVoidReturn?: (boolean | {
|
|
4923
4923
|
arguments?: boolean;
|
|
4924
4924
|
attributes?: boolean;
|
|
4925
|
+
inheritedMethods?: boolean;
|
|
4925
4926
|
properties?: boolean;
|
|
4926
4927
|
returns?: boolean;
|
|
4927
4928
|
variables?: boolean;
|
|
@@ -6599,6 +6600,8 @@ type PerfectionistSortEnums = [] | [
|
|
|
6599
6600
|
type?: ("alphabetical" | "natural" | "line-length");
|
|
6600
6601
|
order?: ("asc" | "desc");
|
|
6601
6602
|
ignoreCase?: boolean;
|
|
6603
|
+
sortByValue?: boolean;
|
|
6604
|
+
forceNumericSort?: boolean;
|
|
6602
6605
|
partitionByComment?: (string[] | boolean | string);
|
|
6603
6606
|
}
|
|
6604
6607
|
];
|
|
@@ -8770,7 +8773,7 @@ type YmlSpacedComment = [] | [("always" | "never")] | [
|
|
|
8770
8773
|
markers?: string[];
|
|
8771
8774
|
}
|
|
8772
8775
|
];
|
|
8773
|
-
type ConfigName = 'command' | 'ntnyq/eslint-comments' | 'ntnyq/ignores' | 'ntnyq/imports' | 'ntnyq/js/recommended' | 'ntnyq/js/core' | 'ntnyq/js/script' | 'ntnyq/js/test' | 'ntnyq/jsdoc' | 'ntnyq/jsonc' | 'ntnyq/jsx' | 'markdown/recommended/plugin' | 'markdown/recommended/processor' | 'markdown/recommended/code-blocks' | 'ntnyq/markdown/extensions' | 'ntnyq/node' | 'ntnyq/prettier' | 'ntnyq/prettier/
|
|
8776
|
+
type ConfigName = 'ntnyq/command' | 'ntnyq/eslint-comments' | 'ntnyq/ignores' | 'ntnyq/imports' | 'ntnyq/js/recommended' | 'ntnyq/js/core' | 'ntnyq/js/script' | 'ntnyq/js/test' | 'ntnyq/jsdoc' | 'ntnyq/jsonc' | 'ntnyq/jsx' | 'markdown/recommended/plugin' | 'markdown/recommended/processor' | 'markdown/recommended/code-blocks' | 'ntnyq/markdown/extensions' | 'ntnyq/node' | 'ntnyq/prettier' | 'ntnyq/prettier/disabled' | 'ntnyq/regexp' | 'ntnyq/perfectionist' | 'ntnyq/sort/package-json' | 'ntnyq/sort/tsconfig' | 'typescript-eslint/base' | 'typescript-eslint/eslint-recommended' | 'typescript-eslint/recommended' | 'ntnyq/ts/core' | 'ntnyq/ts/dts' | 'ntnyq/ts/test' | 'ntnyq/ts/cjs' | 'ntnyq/unicorn' | 'ntnyq/unocss' | 'typescript-eslint/base' | 'typescript-eslint/eslint-recommended' | 'typescript-eslint/recommended' | 'ntnyq/ts/core' | 'ntnyq/vue/ts' | 'ntnyq/vue/core' | 'ntnyq/yaml' | 'ntnyq/toml';
|
|
8774
8777
|
|
|
8775
8778
|
/**
|
|
8776
8779
|
* Parser options
|
|
@@ -8789,6 +8792,10 @@ type TypedConfigItem = Omit<Linter.Config<Linter.RulesRecord & Rules>, 'plugins'
|
|
|
8789
8792
|
*/
|
|
8790
8793
|
plugins?: Record<string, any>;
|
|
8791
8794
|
};
|
|
8795
|
+
/**
|
|
8796
|
+
* Refined `Linter.Config` type
|
|
8797
|
+
*/
|
|
8798
|
+
type LinterConfig = TypedConfigItem;
|
|
8792
8799
|
/**
|
|
8793
8800
|
* ESLint rules
|
|
8794
8801
|
*/
|
|
@@ -8812,28 +8819,111 @@ interface OverridesOptions<Rules = TypedConfigItem['rules']> {
|
|
|
8812
8819
|
rules?: Rules;
|
|
8813
8820
|
parserOptions?: ParserOptions;
|
|
8814
8821
|
}
|
|
8822
|
+
type ResolvedOptions<T> = T extends boolean ? never : NonNullable<T>;
|
|
8823
|
+
|
|
8824
|
+
/**
|
|
8825
|
+
* @file Config options
|
|
8826
|
+
*/
|
|
8827
|
+
|
|
8828
|
+
/**
|
|
8829
|
+
* Options for overrides `files`
|
|
8830
|
+
*/
|
|
8831
|
+
interface OptionsFiles {
|
|
8832
|
+
files?: string[];
|
|
8833
|
+
}
|
|
8834
|
+
/**
|
|
8835
|
+
* Options for overrides `rules`
|
|
8836
|
+
*/
|
|
8837
|
+
interface OptionsOverrides<Rules extends TypedConfigItem['rules'] = TypedConfigItem['rules']> {
|
|
8838
|
+
overrides?: Rules;
|
|
8839
|
+
}
|
|
8840
|
+
type ConfigIgnoresOptions = string[];
|
|
8841
|
+
interface ConfigJsdocOptions extends OptionsOverrides {
|
|
8842
|
+
}
|
|
8843
|
+
interface ConfigUnoCSSOptions extends OptionsOverrides {
|
|
8844
|
+
}
|
|
8845
|
+
interface ConfigUnicornOptions extends OptionsOverrides {
|
|
8846
|
+
}
|
|
8847
|
+
interface ConfigImportsOptions extends OptionsOverrides {
|
|
8848
|
+
}
|
|
8849
|
+
interface ConfigNodeOptions extends OptionsOverrides {
|
|
8850
|
+
}
|
|
8851
|
+
interface ConfigPrettierOptions extends OptionsOverrides {
|
|
8852
|
+
}
|
|
8853
|
+
interface ConfigPerfectionistOptions extends OptionsOverrides {
|
|
8854
|
+
}
|
|
8855
|
+
interface ConfigCommentsOptions extends OptionsOverrides {
|
|
8856
|
+
}
|
|
8857
|
+
interface ConfigRegexpOptions extends OptionsOverrides {
|
|
8858
|
+
}
|
|
8859
|
+
interface ConfigJavaScriptOptions extends OptionsOverrides {
|
|
8860
|
+
}
|
|
8861
|
+
interface ConfigTypeScriptOptions extends OptionsOverrides {
|
|
8862
|
+
}
|
|
8863
|
+
interface ConfigJsoncOptions extends OptionsOverrides {
|
|
8864
|
+
}
|
|
8865
|
+
interface ConfigYmlOptions extends OptionsOverrides {
|
|
8866
|
+
}
|
|
8867
|
+
interface ConfigMarkdownOptions extends OptionsOverrides {
|
|
8868
|
+
}
|
|
8869
|
+
interface ConfigTomlOptions extends OptionsOverrides {
|
|
8870
|
+
}
|
|
8871
|
+
interface ConfigVueOptions extends OptionsOverrides {
|
|
8872
|
+
}
|
|
8873
|
+
interface ConfigVitestOptions extends OptionsOverrides {
|
|
8874
|
+
}
|
|
8875
|
+
interface ConfigUnusedImportsOptions extends OptionsOverrides {
|
|
8876
|
+
}
|
|
8877
|
+
/**
|
|
8878
|
+
* Config factory options
|
|
8879
|
+
*/
|
|
8880
|
+
interface ConfigOptions {
|
|
8881
|
+
command?: boolean;
|
|
8882
|
+
sortTsConfig?: boolean;
|
|
8883
|
+
sortPackageJson?: boolean;
|
|
8884
|
+
ignores?: ConfigIgnoresOptions;
|
|
8885
|
+
imports?: ConfigImportsOptions;
|
|
8886
|
+
javascript?: ConfigJavaScriptOptions;
|
|
8887
|
+
typescript?: ConfigTypeScriptOptions;
|
|
8888
|
+
node?: ConfigNodeOptions;
|
|
8889
|
+
unicorn?: boolean | ConfigUnicornOptions;
|
|
8890
|
+
prettier?: boolean | ConfigPrettierOptions;
|
|
8891
|
+
/**
|
|
8892
|
+
* @internal
|
|
8893
|
+
*/
|
|
8894
|
+
perfectionist?: boolean | ConfigPerfectionistOptions;
|
|
8895
|
+
/**
|
|
8896
|
+
* @internal
|
|
8897
|
+
*/
|
|
8898
|
+
unusedImports?: boolean | ConfigUnusedImportsOptions;
|
|
8899
|
+
comments?: boolean | ConfigCommentsOptions;
|
|
8900
|
+
jsdoc?: boolean | ConfigJsdocOptions;
|
|
8901
|
+
unocss?: boolean | ConfigUnoCSSOptions;
|
|
8902
|
+
regexp?: boolean | ConfigRegexpOptions;
|
|
8903
|
+
jsonc?: boolean | ConfigJsoncOptions;
|
|
8904
|
+
yml?: boolean | ConfigYmlOptions;
|
|
8905
|
+
markdown?: boolean | ConfigMarkdownOptions;
|
|
8906
|
+
toml?: boolean | ConfigTomlOptions;
|
|
8907
|
+
vue?: boolean | ConfigVueOptions;
|
|
8908
|
+
vitest?: boolean | ConfigVitestOptions;
|
|
8909
|
+
}
|
|
8815
8910
|
|
|
8816
8911
|
/**
|
|
8817
8912
|
* @file presets
|
|
8818
8913
|
*/
|
|
8819
8914
|
|
|
8820
8915
|
/**
|
|
8821
|
-
*
|
|
8916
|
+
* Config factory
|
|
8822
8917
|
*/
|
|
8823
|
-
declare function ntnyq(
|
|
8824
|
-
vue?: boolean | undefined;
|
|
8825
|
-
unocss?: boolean | undefined;
|
|
8826
|
-
vitest?: boolean | undefined;
|
|
8827
|
-
prettier?: boolean | undefined;
|
|
8828
|
-
markdown?: boolean | undefined;
|
|
8829
|
-
command?: boolean | undefined;
|
|
8830
|
-
}): TypedConfigItem[];
|
|
8918
|
+
declare function ntnyq(options?: ConfigOptions, customConfig?: Arrayable<TypedConfigItem>): TypedConfigItem[];
|
|
8831
8919
|
|
|
8832
8920
|
declare const hasTypeScript: boolean;
|
|
8833
8921
|
declare const hasVitest: boolean;
|
|
8834
8922
|
declare const hasVue: boolean;
|
|
8835
8923
|
declare const hasUnoCSS: boolean;
|
|
8836
8924
|
|
|
8925
|
+
declare function toArray<T>(val?: Arrayable<T>): T[];
|
|
8926
|
+
|
|
8837
8927
|
/**
|
|
8838
8928
|
* Load an ESLint plugin by name.
|
|
8839
8929
|
* @param name - The name of the plugin
|
|
@@ -8841,10 +8931,7 @@ declare const hasUnoCSS: boolean;
|
|
|
8841
8931
|
*/
|
|
8842
8932
|
declare function loadPlugin<T = unknown>(name: string): Promise<T>;
|
|
8843
8933
|
|
|
8844
|
-
|
|
8845
|
-
* Define ESLint config
|
|
8846
|
-
*/
|
|
8847
|
-
declare function defineConfig(configs?: TypedConfigItem[]): TypedConfigItem[];
|
|
8934
|
+
declare function getOverrides<K extends keyof ConfigOptions>(options: ConfigOptions, key: K): Partial<RuleRecord & RuleOptions>;
|
|
8848
8935
|
|
|
8849
8936
|
/**
|
|
8850
8937
|
* Interop default export from a module
|
|
@@ -8853,6 +8940,8 @@ declare function defineConfig(configs?: TypedConfigItem[]): TypedConfigItem[];
|
|
|
8853
8940
|
*/
|
|
8854
8941
|
declare function interopDefault<T>(mod: Awaitable<T>): Promise<InteropModuleDefault<T>>;
|
|
8855
8942
|
|
|
8943
|
+
declare function resolveSubOptions<K extends keyof ConfigOptions>(options: ConfigOptions, key: K): ResolvedOptions<ConfigOptions[K]>;
|
|
8944
|
+
|
|
8856
8945
|
/**
|
|
8857
8946
|
* @file globs constants
|
|
8858
8947
|
*/
|
|
@@ -8885,50 +8974,50 @@ declare const GLOB_EXCLUDE: string[];
|
|
|
8885
8974
|
/**
|
|
8886
8975
|
* @see https://eslint.org/docs/latest/use/configure/configuration-files-new#globally-ignoring-files-with-ignores
|
|
8887
8976
|
*/
|
|
8888
|
-
declare const ignores:
|
|
8977
|
+
declare const ignores: (customIgnores?: ConfigIgnoresOptions) => LinterConfig[];
|
|
8889
8978
|
|
|
8890
|
-
declare const node:
|
|
8979
|
+
declare const node: (options?: ConfigNodeOptions) => LinterConfig[];
|
|
8891
8980
|
|
|
8892
|
-
declare const jsdoc:
|
|
8981
|
+
declare const jsdoc: (options?: ConfigJsdocOptions) => LinterConfig[];
|
|
8893
8982
|
|
|
8894
|
-
declare const imports:
|
|
8983
|
+
declare const imports: (options?: ConfigImportsOptions) => LinterConfig[];
|
|
8895
8984
|
|
|
8896
|
-
declare const unicorn:
|
|
8985
|
+
declare const unicorn: (options?: ConfigUnicornOptions) => LinterConfig[];
|
|
8897
8986
|
|
|
8898
|
-
declare const prettier:
|
|
8987
|
+
declare const prettier: (options?: ConfigPrettierOptions) => LinterConfig[];
|
|
8899
8988
|
|
|
8900
|
-
declare const comments:
|
|
8989
|
+
declare const comments: (options?: ConfigCommentsOptions) => LinterConfig[];
|
|
8901
8990
|
|
|
8902
|
-
declare const javascript:
|
|
8903
|
-
declare const jsx:
|
|
8991
|
+
declare const javascript: (option?: ConfigJavaScriptOptions) => LinterConfig[];
|
|
8992
|
+
declare const jsx: () => LinterConfig[];
|
|
8904
8993
|
|
|
8905
|
-
declare const typescriptCore: TypedConfigItem[];
|
|
8906
|
-
declare const typescript:
|
|
8994
|
+
declare const typescriptCore: (options?: ConfigTypeScriptOptions) => TypedConfigItem[];
|
|
8995
|
+
declare const typescript: (options?: ConfigTypeScriptOptions) => LinterConfig[];
|
|
8907
8996
|
|
|
8908
|
-
declare const unusedImports:
|
|
8997
|
+
declare const unusedImports: (options?: ConfigUnusedImportsOptions) => LinterConfig[];
|
|
8909
8998
|
|
|
8910
|
-
declare const perfectionist:
|
|
8999
|
+
declare const perfectionist: (options?: ConfigPerfectionistOptions) => LinterConfig[];
|
|
8911
9000
|
|
|
8912
|
-
declare const regexp:
|
|
9001
|
+
declare const regexp: (options?: ConfigRegexpOptions) => LinterConfig[];
|
|
8913
9002
|
|
|
8914
|
-
declare const unocss:
|
|
9003
|
+
declare const unocss: (options?: ConfigUnoCSSOptions) => LinterConfig[];
|
|
8915
9004
|
|
|
8916
|
-
declare const command:
|
|
9005
|
+
declare const command: () => LinterConfig[];
|
|
8917
9006
|
|
|
8918
|
-
declare const vitest:
|
|
9007
|
+
declare const vitest: (options?: ConfigVitestOptions) => LinterConfig[];
|
|
8919
9008
|
|
|
8920
9009
|
declare function getVueVersion(): number;
|
|
8921
|
-
declare const vue:
|
|
9010
|
+
declare const vue: (options?: ConfigVueOptions) => LinterConfig[];
|
|
8922
9011
|
|
|
8923
|
-
declare const yml:
|
|
9012
|
+
declare const yml: (options?: ConfigYmlOptions) => LinterConfig[];
|
|
8924
9013
|
|
|
8925
|
-
declare const toml:
|
|
9014
|
+
declare const toml: (options?: ConfigTomlOptions) => LinterConfig[];
|
|
8926
9015
|
|
|
8927
|
-
declare const sortPackageJson:
|
|
8928
|
-
declare const sortTsConfig:
|
|
9016
|
+
declare const sortPackageJson: () => LinterConfig[];
|
|
9017
|
+
declare const sortTsConfig: () => LinterConfig[];
|
|
8929
9018
|
|
|
8930
|
-
declare const jsonc:
|
|
9019
|
+
declare const jsonc: (options?: ConfigJsoncOptions) => LinterConfig[];
|
|
8931
9020
|
|
|
8932
|
-
declare const markdown:
|
|
9021
|
+
declare const markdown: (options?: ConfigMarkdownOptions) => LinterConfig[];
|
|
8933
9022
|
|
|
8934
|
-
export { type Arrayable, type Awaitable, type ConfigName, GLOB_ALL_SRC, GLOB_CSS, GLOB_DIST, GLOB_DTS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_LOCKFILE, GLOB_MARKDOWN, GLOB_NODE_MODULES, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TEST, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, type InteropModuleDefault, type OverridesOptions, type ParserOptions, type RuleOptions, type RuleRecord, type RuleRecordEntry, type Rules, type TypedConfigItem, command, comments,
|
|
9023
|
+
export { type Arrayable, type Awaitable, type ConfigCommentsOptions, type ConfigIgnoresOptions, type ConfigImportsOptions, type ConfigJavaScriptOptions, type ConfigJsdocOptions, type ConfigJsoncOptions, type ConfigMarkdownOptions, type ConfigName, type ConfigNodeOptions, type ConfigOptions, type ConfigPerfectionistOptions, type ConfigPrettierOptions, type ConfigRegexpOptions, type ConfigTomlOptions, type ConfigTypeScriptOptions, type ConfigUnicornOptions, type ConfigUnoCSSOptions, type ConfigUnusedImportsOptions, type ConfigVitestOptions, type ConfigVueOptions, type ConfigYmlOptions, GLOB_ALL_SRC, GLOB_CSS, GLOB_DIST, GLOB_DTS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_LOCKFILE, GLOB_MARKDOWN, GLOB_NODE_MODULES, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TEST, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, type InteropModuleDefault, type LinterConfig, type OptionsFiles, type OptionsOverrides, type OverridesOptions, type ParserOptions, type ResolvedOptions, type RuleOptions, type RuleRecord, type RuleRecordEntry, type Rules, type TypedConfigItem, command, comments, getOverrides, getVueVersion, hasTypeScript, hasUnoCSS, hasVitest, hasVue, ignores, imports, interopDefault, javascript, jsdoc, jsonc, jsx, loadPlugin, markdown, node, ntnyq, perfectionist, prettier, regexp, resolveSubOptions, sortPackageJson, sortTsConfig, toArray, toml, typescript, typescriptCore, unicorn, unocss, unusedImports, vitest, vue, yml };
|
package/dist/index.d.ts
CHANGED
|
@@ -441,7 +441,7 @@ interface RuleOptions {
|
|
|
441
441
|
*/
|
|
442
442
|
'@typescript-eslint/no-unnecessary-type-constraint'?: Linter.RuleEntry<[]>;
|
|
443
443
|
/**
|
|
444
|
-
* Disallow type parameters that
|
|
444
|
+
* Disallow type parameters that aren't used multiple times
|
|
445
445
|
* @see https://typescript-eslint.io/rules/no-unnecessary-type-parameters
|
|
446
446
|
*/
|
|
447
447
|
'@typescript-eslint/no-unnecessary-type-parameters'?: Linter.RuleEntry<[]>;
|
|
@@ -4922,6 +4922,7 @@ type TypescriptEslintNoMisusedPromises = [] | [
|
|
|
4922
4922
|
checksVoidReturn?: (boolean | {
|
|
4923
4923
|
arguments?: boolean;
|
|
4924
4924
|
attributes?: boolean;
|
|
4925
|
+
inheritedMethods?: boolean;
|
|
4925
4926
|
properties?: boolean;
|
|
4926
4927
|
returns?: boolean;
|
|
4927
4928
|
variables?: boolean;
|
|
@@ -6599,6 +6600,8 @@ type PerfectionistSortEnums = [] | [
|
|
|
6599
6600
|
type?: ("alphabetical" | "natural" | "line-length");
|
|
6600
6601
|
order?: ("asc" | "desc");
|
|
6601
6602
|
ignoreCase?: boolean;
|
|
6603
|
+
sortByValue?: boolean;
|
|
6604
|
+
forceNumericSort?: boolean;
|
|
6602
6605
|
partitionByComment?: (string[] | boolean | string);
|
|
6603
6606
|
}
|
|
6604
6607
|
];
|
|
@@ -8770,7 +8773,7 @@ type YmlSpacedComment = [] | [("always" | "never")] | [
|
|
|
8770
8773
|
markers?: string[];
|
|
8771
8774
|
}
|
|
8772
8775
|
];
|
|
8773
|
-
type ConfigName = 'command' | 'ntnyq/eslint-comments' | 'ntnyq/ignores' | 'ntnyq/imports' | 'ntnyq/js/recommended' | 'ntnyq/js/core' | 'ntnyq/js/script' | 'ntnyq/js/test' | 'ntnyq/jsdoc' | 'ntnyq/jsonc' | 'ntnyq/jsx' | 'markdown/recommended/plugin' | 'markdown/recommended/processor' | 'markdown/recommended/code-blocks' | 'ntnyq/markdown/extensions' | 'ntnyq/node' | 'ntnyq/prettier' | 'ntnyq/prettier/
|
|
8776
|
+
type ConfigName = 'ntnyq/command' | 'ntnyq/eslint-comments' | 'ntnyq/ignores' | 'ntnyq/imports' | 'ntnyq/js/recommended' | 'ntnyq/js/core' | 'ntnyq/js/script' | 'ntnyq/js/test' | 'ntnyq/jsdoc' | 'ntnyq/jsonc' | 'ntnyq/jsx' | 'markdown/recommended/plugin' | 'markdown/recommended/processor' | 'markdown/recommended/code-blocks' | 'ntnyq/markdown/extensions' | 'ntnyq/node' | 'ntnyq/prettier' | 'ntnyq/prettier/disabled' | 'ntnyq/regexp' | 'ntnyq/perfectionist' | 'ntnyq/sort/package-json' | 'ntnyq/sort/tsconfig' | 'typescript-eslint/base' | 'typescript-eslint/eslint-recommended' | 'typescript-eslint/recommended' | 'ntnyq/ts/core' | 'ntnyq/ts/dts' | 'ntnyq/ts/test' | 'ntnyq/ts/cjs' | 'ntnyq/unicorn' | 'ntnyq/unocss' | 'typescript-eslint/base' | 'typescript-eslint/eslint-recommended' | 'typescript-eslint/recommended' | 'ntnyq/ts/core' | 'ntnyq/vue/ts' | 'ntnyq/vue/core' | 'ntnyq/yaml' | 'ntnyq/toml';
|
|
8774
8777
|
|
|
8775
8778
|
/**
|
|
8776
8779
|
* Parser options
|
|
@@ -8789,6 +8792,10 @@ type TypedConfigItem = Omit<Linter.Config<Linter.RulesRecord & Rules>, 'plugins'
|
|
|
8789
8792
|
*/
|
|
8790
8793
|
plugins?: Record<string, any>;
|
|
8791
8794
|
};
|
|
8795
|
+
/**
|
|
8796
|
+
* Refined `Linter.Config` type
|
|
8797
|
+
*/
|
|
8798
|
+
type LinterConfig = TypedConfigItem;
|
|
8792
8799
|
/**
|
|
8793
8800
|
* ESLint rules
|
|
8794
8801
|
*/
|
|
@@ -8812,28 +8819,111 @@ interface OverridesOptions<Rules = TypedConfigItem['rules']> {
|
|
|
8812
8819
|
rules?: Rules;
|
|
8813
8820
|
parserOptions?: ParserOptions;
|
|
8814
8821
|
}
|
|
8822
|
+
type ResolvedOptions<T> = T extends boolean ? never : NonNullable<T>;
|
|
8823
|
+
|
|
8824
|
+
/**
|
|
8825
|
+
* @file Config options
|
|
8826
|
+
*/
|
|
8827
|
+
|
|
8828
|
+
/**
|
|
8829
|
+
* Options for overrides `files`
|
|
8830
|
+
*/
|
|
8831
|
+
interface OptionsFiles {
|
|
8832
|
+
files?: string[];
|
|
8833
|
+
}
|
|
8834
|
+
/**
|
|
8835
|
+
* Options for overrides `rules`
|
|
8836
|
+
*/
|
|
8837
|
+
interface OptionsOverrides<Rules extends TypedConfigItem['rules'] = TypedConfigItem['rules']> {
|
|
8838
|
+
overrides?: Rules;
|
|
8839
|
+
}
|
|
8840
|
+
type ConfigIgnoresOptions = string[];
|
|
8841
|
+
interface ConfigJsdocOptions extends OptionsOverrides {
|
|
8842
|
+
}
|
|
8843
|
+
interface ConfigUnoCSSOptions extends OptionsOverrides {
|
|
8844
|
+
}
|
|
8845
|
+
interface ConfigUnicornOptions extends OptionsOverrides {
|
|
8846
|
+
}
|
|
8847
|
+
interface ConfigImportsOptions extends OptionsOverrides {
|
|
8848
|
+
}
|
|
8849
|
+
interface ConfigNodeOptions extends OptionsOverrides {
|
|
8850
|
+
}
|
|
8851
|
+
interface ConfigPrettierOptions extends OptionsOverrides {
|
|
8852
|
+
}
|
|
8853
|
+
interface ConfigPerfectionistOptions extends OptionsOverrides {
|
|
8854
|
+
}
|
|
8855
|
+
interface ConfigCommentsOptions extends OptionsOverrides {
|
|
8856
|
+
}
|
|
8857
|
+
interface ConfigRegexpOptions extends OptionsOverrides {
|
|
8858
|
+
}
|
|
8859
|
+
interface ConfigJavaScriptOptions extends OptionsOverrides {
|
|
8860
|
+
}
|
|
8861
|
+
interface ConfigTypeScriptOptions extends OptionsOverrides {
|
|
8862
|
+
}
|
|
8863
|
+
interface ConfigJsoncOptions extends OptionsOverrides {
|
|
8864
|
+
}
|
|
8865
|
+
interface ConfigYmlOptions extends OptionsOverrides {
|
|
8866
|
+
}
|
|
8867
|
+
interface ConfigMarkdownOptions extends OptionsOverrides {
|
|
8868
|
+
}
|
|
8869
|
+
interface ConfigTomlOptions extends OptionsOverrides {
|
|
8870
|
+
}
|
|
8871
|
+
interface ConfigVueOptions extends OptionsOverrides {
|
|
8872
|
+
}
|
|
8873
|
+
interface ConfigVitestOptions extends OptionsOverrides {
|
|
8874
|
+
}
|
|
8875
|
+
interface ConfigUnusedImportsOptions extends OptionsOverrides {
|
|
8876
|
+
}
|
|
8877
|
+
/**
|
|
8878
|
+
* Config factory options
|
|
8879
|
+
*/
|
|
8880
|
+
interface ConfigOptions {
|
|
8881
|
+
command?: boolean;
|
|
8882
|
+
sortTsConfig?: boolean;
|
|
8883
|
+
sortPackageJson?: boolean;
|
|
8884
|
+
ignores?: ConfigIgnoresOptions;
|
|
8885
|
+
imports?: ConfigImportsOptions;
|
|
8886
|
+
javascript?: ConfigJavaScriptOptions;
|
|
8887
|
+
typescript?: ConfigTypeScriptOptions;
|
|
8888
|
+
node?: ConfigNodeOptions;
|
|
8889
|
+
unicorn?: boolean | ConfigUnicornOptions;
|
|
8890
|
+
prettier?: boolean | ConfigPrettierOptions;
|
|
8891
|
+
/**
|
|
8892
|
+
* @internal
|
|
8893
|
+
*/
|
|
8894
|
+
perfectionist?: boolean | ConfigPerfectionistOptions;
|
|
8895
|
+
/**
|
|
8896
|
+
* @internal
|
|
8897
|
+
*/
|
|
8898
|
+
unusedImports?: boolean | ConfigUnusedImportsOptions;
|
|
8899
|
+
comments?: boolean | ConfigCommentsOptions;
|
|
8900
|
+
jsdoc?: boolean | ConfigJsdocOptions;
|
|
8901
|
+
unocss?: boolean | ConfigUnoCSSOptions;
|
|
8902
|
+
regexp?: boolean | ConfigRegexpOptions;
|
|
8903
|
+
jsonc?: boolean | ConfigJsoncOptions;
|
|
8904
|
+
yml?: boolean | ConfigYmlOptions;
|
|
8905
|
+
markdown?: boolean | ConfigMarkdownOptions;
|
|
8906
|
+
toml?: boolean | ConfigTomlOptions;
|
|
8907
|
+
vue?: boolean | ConfigVueOptions;
|
|
8908
|
+
vitest?: boolean | ConfigVitestOptions;
|
|
8909
|
+
}
|
|
8815
8910
|
|
|
8816
8911
|
/**
|
|
8817
8912
|
* @file presets
|
|
8818
8913
|
*/
|
|
8819
8914
|
|
|
8820
8915
|
/**
|
|
8821
|
-
*
|
|
8916
|
+
* Config factory
|
|
8822
8917
|
*/
|
|
8823
|
-
declare function ntnyq(
|
|
8824
|
-
vue?: boolean | undefined;
|
|
8825
|
-
unocss?: boolean | undefined;
|
|
8826
|
-
vitest?: boolean | undefined;
|
|
8827
|
-
prettier?: boolean | undefined;
|
|
8828
|
-
markdown?: boolean | undefined;
|
|
8829
|
-
command?: boolean | undefined;
|
|
8830
|
-
}): TypedConfigItem[];
|
|
8918
|
+
declare function ntnyq(options?: ConfigOptions, customConfig?: Arrayable<TypedConfigItem>): TypedConfigItem[];
|
|
8831
8919
|
|
|
8832
8920
|
declare const hasTypeScript: boolean;
|
|
8833
8921
|
declare const hasVitest: boolean;
|
|
8834
8922
|
declare const hasVue: boolean;
|
|
8835
8923
|
declare const hasUnoCSS: boolean;
|
|
8836
8924
|
|
|
8925
|
+
declare function toArray<T>(val?: Arrayable<T>): T[];
|
|
8926
|
+
|
|
8837
8927
|
/**
|
|
8838
8928
|
* Load an ESLint plugin by name.
|
|
8839
8929
|
* @param name - The name of the plugin
|
|
@@ -8841,10 +8931,7 @@ declare const hasUnoCSS: boolean;
|
|
|
8841
8931
|
*/
|
|
8842
8932
|
declare function loadPlugin<T = unknown>(name: string): Promise<T>;
|
|
8843
8933
|
|
|
8844
|
-
|
|
8845
|
-
* Define ESLint config
|
|
8846
|
-
*/
|
|
8847
|
-
declare function defineConfig(configs?: TypedConfigItem[]): TypedConfigItem[];
|
|
8934
|
+
declare function getOverrides<K extends keyof ConfigOptions>(options: ConfigOptions, key: K): Partial<RuleRecord & RuleOptions>;
|
|
8848
8935
|
|
|
8849
8936
|
/**
|
|
8850
8937
|
* Interop default export from a module
|
|
@@ -8853,6 +8940,8 @@ declare function defineConfig(configs?: TypedConfigItem[]): TypedConfigItem[];
|
|
|
8853
8940
|
*/
|
|
8854
8941
|
declare function interopDefault<T>(mod: Awaitable<T>): Promise<InteropModuleDefault<T>>;
|
|
8855
8942
|
|
|
8943
|
+
declare function resolveSubOptions<K extends keyof ConfigOptions>(options: ConfigOptions, key: K): ResolvedOptions<ConfigOptions[K]>;
|
|
8944
|
+
|
|
8856
8945
|
/**
|
|
8857
8946
|
* @file globs constants
|
|
8858
8947
|
*/
|
|
@@ -8885,50 +8974,50 @@ declare const GLOB_EXCLUDE: string[];
|
|
|
8885
8974
|
/**
|
|
8886
8975
|
* @see https://eslint.org/docs/latest/use/configure/configuration-files-new#globally-ignoring-files-with-ignores
|
|
8887
8976
|
*/
|
|
8888
|
-
declare const ignores:
|
|
8977
|
+
declare const ignores: (customIgnores?: ConfigIgnoresOptions) => LinterConfig[];
|
|
8889
8978
|
|
|
8890
|
-
declare const node:
|
|
8979
|
+
declare const node: (options?: ConfigNodeOptions) => LinterConfig[];
|
|
8891
8980
|
|
|
8892
|
-
declare const jsdoc:
|
|
8981
|
+
declare const jsdoc: (options?: ConfigJsdocOptions) => LinterConfig[];
|
|
8893
8982
|
|
|
8894
|
-
declare const imports:
|
|
8983
|
+
declare const imports: (options?: ConfigImportsOptions) => LinterConfig[];
|
|
8895
8984
|
|
|
8896
|
-
declare const unicorn:
|
|
8985
|
+
declare const unicorn: (options?: ConfigUnicornOptions) => LinterConfig[];
|
|
8897
8986
|
|
|
8898
|
-
declare const prettier:
|
|
8987
|
+
declare const prettier: (options?: ConfigPrettierOptions) => LinterConfig[];
|
|
8899
8988
|
|
|
8900
|
-
declare const comments:
|
|
8989
|
+
declare const comments: (options?: ConfigCommentsOptions) => LinterConfig[];
|
|
8901
8990
|
|
|
8902
|
-
declare const javascript:
|
|
8903
|
-
declare const jsx:
|
|
8991
|
+
declare const javascript: (option?: ConfigJavaScriptOptions) => LinterConfig[];
|
|
8992
|
+
declare const jsx: () => LinterConfig[];
|
|
8904
8993
|
|
|
8905
|
-
declare const typescriptCore: TypedConfigItem[];
|
|
8906
|
-
declare const typescript:
|
|
8994
|
+
declare const typescriptCore: (options?: ConfigTypeScriptOptions) => TypedConfigItem[];
|
|
8995
|
+
declare const typescript: (options?: ConfigTypeScriptOptions) => LinterConfig[];
|
|
8907
8996
|
|
|
8908
|
-
declare const unusedImports:
|
|
8997
|
+
declare const unusedImports: (options?: ConfigUnusedImportsOptions) => LinterConfig[];
|
|
8909
8998
|
|
|
8910
|
-
declare const perfectionist:
|
|
8999
|
+
declare const perfectionist: (options?: ConfigPerfectionistOptions) => LinterConfig[];
|
|
8911
9000
|
|
|
8912
|
-
declare const regexp:
|
|
9001
|
+
declare const regexp: (options?: ConfigRegexpOptions) => LinterConfig[];
|
|
8913
9002
|
|
|
8914
|
-
declare const unocss:
|
|
9003
|
+
declare const unocss: (options?: ConfigUnoCSSOptions) => LinterConfig[];
|
|
8915
9004
|
|
|
8916
|
-
declare const command:
|
|
9005
|
+
declare const command: () => LinterConfig[];
|
|
8917
9006
|
|
|
8918
|
-
declare const vitest:
|
|
9007
|
+
declare const vitest: (options?: ConfigVitestOptions) => LinterConfig[];
|
|
8919
9008
|
|
|
8920
9009
|
declare function getVueVersion(): number;
|
|
8921
|
-
declare const vue:
|
|
9010
|
+
declare const vue: (options?: ConfigVueOptions) => LinterConfig[];
|
|
8922
9011
|
|
|
8923
|
-
declare const yml:
|
|
9012
|
+
declare const yml: (options?: ConfigYmlOptions) => LinterConfig[];
|
|
8924
9013
|
|
|
8925
|
-
declare const toml:
|
|
9014
|
+
declare const toml: (options?: ConfigTomlOptions) => LinterConfig[];
|
|
8926
9015
|
|
|
8927
|
-
declare const sortPackageJson:
|
|
8928
|
-
declare const sortTsConfig:
|
|
9016
|
+
declare const sortPackageJson: () => LinterConfig[];
|
|
9017
|
+
declare const sortTsConfig: () => LinterConfig[];
|
|
8929
9018
|
|
|
8930
|
-
declare const jsonc:
|
|
9019
|
+
declare const jsonc: (options?: ConfigJsoncOptions) => LinterConfig[];
|
|
8931
9020
|
|
|
8932
|
-
declare const markdown:
|
|
9021
|
+
declare const markdown: (options?: ConfigMarkdownOptions) => LinterConfig[];
|
|
8933
9022
|
|
|
8934
|
-
export { type Arrayable, type Awaitable, type ConfigName, GLOB_ALL_SRC, GLOB_CSS, GLOB_DIST, GLOB_DTS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_LOCKFILE, GLOB_MARKDOWN, GLOB_NODE_MODULES, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TEST, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, type InteropModuleDefault, type OverridesOptions, type ParserOptions, type RuleOptions, type RuleRecord, type RuleRecordEntry, type Rules, type TypedConfigItem, command, comments,
|
|
9023
|
+
export { type Arrayable, type Awaitable, type ConfigCommentsOptions, type ConfigIgnoresOptions, type ConfigImportsOptions, type ConfigJavaScriptOptions, type ConfigJsdocOptions, type ConfigJsoncOptions, type ConfigMarkdownOptions, type ConfigName, type ConfigNodeOptions, type ConfigOptions, type ConfigPerfectionistOptions, type ConfigPrettierOptions, type ConfigRegexpOptions, type ConfigTomlOptions, type ConfigTypeScriptOptions, type ConfigUnicornOptions, type ConfigUnoCSSOptions, type ConfigUnusedImportsOptions, type ConfigVitestOptions, type ConfigVueOptions, type ConfigYmlOptions, GLOB_ALL_SRC, GLOB_CSS, GLOB_DIST, GLOB_DTS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_LOCKFILE, GLOB_MARKDOWN, GLOB_NODE_MODULES, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TEST, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, type InteropModuleDefault, type LinterConfig, type OptionsFiles, type OptionsOverrides, type OverridesOptions, type ParserOptions, type ResolvedOptions, type RuleOptions, type RuleRecord, type RuleRecordEntry, type Rules, type TypedConfigItem, command, comments, getOverrides, getVueVersion, hasTypeScript, hasUnoCSS, hasVitest, hasVue, ignores, imports, interopDefault, javascript, jsdoc, jsonc, jsx, loadPlugin, markdown, node, ntnyq, perfectionist, prettier, regexp, resolveSubOptions, sortPackageJson, sortTsConfig, toArray, toml, typescript, typescriptCore, unicorn, unocss, unusedImports, vitest, vue, yml };
|