@ntnyq/eslint-config 2.8.1 → 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 +2 -1
- package/dist/index.cjs +702 -513
- package/dist/index.d.cts +136 -41
- package/dist/index.d.ts +136 -41
- package/dist/index.js +717 -534
- package/package.json +13 -13
package/dist/index.d.cts
CHANGED
|
@@ -9,12 +9,13 @@ export { default as pluginToml } from 'eslint-plugin-toml';
|
|
|
9
9
|
export { default as pluginJsonc } from 'eslint-plugin-jsonc';
|
|
10
10
|
export { default as pluginJsdoc } from 'eslint-plugin-jsdoc';
|
|
11
11
|
export { default as pluginUnoCSS } from '@unocss/eslint-plugin';
|
|
12
|
+
export { default as pluginVitest } from '@vitest/eslint-plugin';
|
|
12
13
|
export { default as pluginUnicorn } from 'eslint-plugin-unicorn';
|
|
13
14
|
export { default as pluginImport } from 'eslint-plugin-import-x';
|
|
14
15
|
export { default as pluginPrettier } from 'eslint-plugin-prettier';
|
|
15
16
|
export { default as pluginMarkdown } from 'eslint-plugin-markdown';
|
|
16
17
|
export { default as pluginPerfectionist } from 'eslint-plugin-perfectionist';
|
|
17
|
-
export { default as pluginUnusedImports } from '
|
|
18
|
+
export { default as pluginUnusedImports } from 'eslint-plugin-unused-imports';
|
|
18
19
|
export { default as pluginComments } from '@eslint-community/eslint-plugin-eslint-comments';
|
|
19
20
|
import * as tomlEslintParser from 'toml-eslint-parser';
|
|
20
21
|
export { tomlEslintParser as parserToml };
|
|
@@ -440,7 +441,7 @@ interface RuleOptions {
|
|
|
440
441
|
*/
|
|
441
442
|
'@typescript-eslint/no-unnecessary-type-constraint'?: Linter.RuleEntry<[]>;
|
|
442
443
|
/**
|
|
443
|
-
* Disallow type parameters that
|
|
444
|
+
* Disallow type parameters that aren't used multiple times
|
|
444
445
|
* @see https://typescript-eslint.io/rules/no-unnecessary-type-parameters
|
|
445
446
|
*/
|
|
446
447
|
'@typescript-eslint/no-unnecessary-type-parameters'?: Linter.RuleEntry<[]>;
|
|
@@ -496,7 +497,7 @@ interface RuleOptions {
|
|
|
496
497
|
'@typescript-eslint/no-unused-expressions'?: Linter.RuleEntry<TypescriptEslintNoUnusedExpressions>;
|
|
497
498
|
/**
|
|
498
499
|
* Disallow unused variables
|
|
499
|
-
* @see https://
|
|
500
|
+
* @see https://typescript-eslint.io/rules/no-unused-vars
|
|
500
501
|
*/
|
|
501
502
|
'@typescript-eslint/no-unused-vars'?: Linter.RuleEntry<TypescriptEslintNoUnusedVars>;
|
|
502
503
|
/**
|
|
@@ -4921,6 +4922,7 @@ type TypescriptEslintNoMisusedPromises = [] | [
|
|
|
4921
4922
|
checksVoidReturn?: (boolean | {
|
|
4922
4923
|
arguments?: boolean;
|
|
4923
4924
|
attributes?: boolean;
|
|
4925
|
+
inheritedMethods?: boolean;
|
|
4924
4926
|
properties?: boolean;
|
|
4925
4927
|
returns?: boolean;
|
|
4926
4928
|
variables?: boolean;
|
|
@@ -6598,6 +6600,8 @@ type PerfectionistSortEnums = [] | [
|
|
|
6598
6600
|
type?: ("alphabetical" | "natural" | "line-length");
|
|
6599
6601
|
order?: ("asc" | "desc");
|
|
6600
6602
|
ignoreCase?: boolean;
|
|
6603
|
+
sortByValue?: boolean;
|
|
6604
|
+
forceNumericSort?: boolean;
|
|
6601
6605
|
partitionByComment?: (string[] | boolean | string);
|
|
6602
6606
|
}
|
|
6603
6607
|
];
|
|
@@ -8769,7 +8773,7 @@ type YmlSpacedComment = [] | [("always" | "never")] | [
|
|
|
8769
8773
|
markers?: string[];
|
|
8770
8774
|
}
|
|
8771
8775
|
];
|
|
8772
|
-
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';
|
|
8773
8777
|
|
|
8774
8778
|
/**
|
|
8775
8779
|
* Parser options
|
|
@@ -8788,6 +8792,10 @@ type TypedConfigItem = Omit<Linter.Config<Linter.RulesRecord & Rules>, 'plugins'
|
|
|
8788
8792
|
*/
|
|
8789
8793
|
plugins?: Record<string, any>;
|
|
8790
8794
|
};
|
|
8795
|
+
/**
|
|
8796
|
+
* Refined `Linter.Config` type
|
|
8797
|
+
*/
|
|
8798
|
+
type LinterConfig = TypedConfigItem;
|
|
8791
8799
|
/**
|
|
8792
8800
|
* ESLint rules
|
|
8793
8801
|
*/
|
|
@@ -8811,26 +8819,111 @@ interface OverridesOptions<Rules = TypedConfigItem['rules']> {
|
|
|
8811
8819
|
rules?: Rules;
|
|
8812
8820
|
parserOptions?: ParserOptions;
|
|
8813
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
|
+
}
|
|
8814
8910
|
|
|
8815
8911
|
/**
|
|
8816
8912
|
* @file presets
|
|
8817
8913
|
*/
|
|
8818
8914
|
|
|
8819
8915
|
/**
|
|
8820
|
-
*
|
|
8916
|
+
* Config factory
|
|
8821
8917
|
*/
|
|
8822
|
-
declare function ntnyq(
|
|
8823
|
-
vue?: boolean | undefined;
|
|
8824
|
-
unocss?: boolean | undefined;
|
|
8825
|
-
prettier?: boolean | undefined;
|
|
8826
|
-
markdown?: boolean | undefined;
|
|
8827
|
-
command?: boolean | undefined;
|
|
8828
|
-
}): TypedConfigItem[];
|
|
8918
|
+
declare function ntnyq(options?: ConfigOptions, customConfig?: Arrayable<TypedConfigItem>): TypedConfigItem[];
|
|
8829
8919
|
|
|
8830
8920
|
declare const hasTypeScript: boolean;
|
|
8921
|
+
declare const hasVitest: boolean;
|
|
8831
8922
|
declare const hasVue: boolean;
|
|
8832
8923
|
declare const hasUnoCSS: boolean;
|
|
8833
8924
|
|
|
8925
|
+
declare function toArray<T>(val?: Arrayable<T>): T[];
|
|
8926
|
+
|
|
8834
8927
|
/**
|
|
8835
8928
|
* Load an ESLint plugin by name.
|
|
8836
8929
|
* @param name - The name of the plugin
|
|
@@ -8838,10 +8931,7 @@ declare const hasUnoCSS: boolean;
|
|
|
8838
8931
|
*/
|
|
8839
8932
|
declare function loadPlugin<T = unknown>(name: string): Promise<T>;
|
|
8840
8933
|
|
|
8841
|
-
|
|
8842
|
-
* Define ESLint config
|
|
8843
|
-
*/
|
|
8844
|
-
declare function defineConfig(configs?: TypedConfigItem[]): TypedConfigItem[];
|
|
8934
|
+
declare function getOverrides<K extends keyof ConfigOptions>(options: ConfigOptions, key: K): Partial<RuleRecord & RuleOptions>;
|
|
8845
8935
|
|
|
8846
8936
|
/**
|
|
8847
8937
|
* Interop default export from a module
|
|
@@ -8850,6 +8940,8 @@ declare function defineConfig(configs?: TypedConfigItem[]): TypedConfigItem[];
|
|
|
8850
8940
|
*/
|
|
8851
8941
|
declare function interopDefault<T>(mod: Awaitable<T>): Promise<InteropModuleDefault<T>>;
|
|
8852
8942
|
|
|
8943
|
+
declare function resolveSubOptions<K extends keyof ConfigOptions>(options: ConfigOptions, key: K): ResolvedOptions<ConfigOptions[K]>;
|
|
8944
|
+
|
|
8853
8945
|
/**
|
|
8854
8946
|
* @file globs constants
|
|
8855
8947
|
*/
|
|
@@ -8860,6 +8952,7 @@ declare const GLOB_JSX = "**/*.?([cm])jsx";
|
|
|
8860
8952
|
declare const GLOB_TS = "**/*.?([cm])ts";
|
|
8861
8953
|
declare const GLOB_TSX = "**/*.?([cm])tsx";
|
|
8862
8954
|
declare const GLOB_DTS = "**/*.d.?([cm])ts";
|
|
8955
|
+
declare const GLOB_TEST = "**/*.{test,spec}.?([cm])[jt]s?(x)";
|
|
8863
8956
|
declare const GLOB_STYLE = "**/*.{c,le,sc}ss";
|
|
8864
8957
|
declare const GLOB_CSS = "**/*.css";
|
|
8865
8958
|
declare const GLOB_LESS = "**/*.less";
|
|
@@ -8881,48 +8974,50 @@ declare const GLOB_EXCLUDE: string[];
|
|
|
8881
8974
|
/**
|
|
8882
8975
|
* @see https://eslint.org/docs/latest/use/configure/configuration-files-new#globally-ignoring-files-with-ignores
|
|
8883
8976
|
*/
|
|
8884
|
-
declare const ignores:
|
|
8977
|
+
declare const ignores: (customIgnores?: ConfigIgnoresOptions) => LinterConfig[];
|
|
8885
8978
|
|
|
8886
|
-
declare const node:
|
|
8979
|
+
declare const node: (options?: ConfigNodeOptions) => LinterConfig[];
|
|
8887
8980
|
|
|
8888
|
-
declare const jsdoc:
|
|
8981
|
+
declare const jsdoc: (options?: ConfigJsdocOptions) => LinterConfig[];
|
|
8889
8982
|
|
|
8890
|
-
declare const imports:
|
|
8983
|
+
declare const imports: (options?: ConfigImportsOptions) => LinterConfig[];
|
|
8891
8984
|
|
|
8892
|
-
declare const unicorn:
|
|
8985
|
+
declare const unicorn: (options?: ConfigUnicornOptions) => LinterConfig[];
|
|
8893
8986
|
|
|
8894
|
-
declare const prettier:
|
|
8987
|
+
declare const prettier: (options?: ConfigPrettierOptions) => LinterConfig[];
|
|
8895
8988
|
|
|
8896
|
-
declare const comments:
|
|
8989
|
+
declare const comments: (options?: ConfigCommentsOptions) => LinterConfig[];
|
|
8897
8990
|
|
|
8898
|
-
declare const javascript:
|
|
8899
|
-
declare const jsx:
|
|
8991
|
+
declare const javascript: (option?: ConfigJavaScriptOptions) => LinterConfig[];
|
|
8992
|
+
declare const jsx: () => LinterConfig[];
|
|
8900
8993
|
|
|
8901
|
-
declare const typescriptCore: TypedConfigItem[];
|
|
8902
|
-
declare const typescript:
|
|
8994
|
+
declare const typescriptCore: (options?: ConfigTypeScriptOptions) => TypedConfigItem[];
|
|
8995
|
+
declare const typescript: (options?: ConfigTypeScriptOptions) => LinterConfig[];
|
|
8903
8996
|
|
|
8904
|
-
declare const unusedImports:
|
|
8997
|
+
declare const unusedImports: (options?: ConfigUnusedImportsOptions) => LinterConfig[];
|
|
8905
8998
|
|
|
8906
|
-
declare const perfectionist:
|
|
8999
|
+
declare const perfectionist: (options?: ConfigPerfectionistOptions) => LinterConfig[];
|
|
8907
9000
|
|
|
8908
|
-
declare const regexp:
|
|
9001
|
+
declare const regexp: (options?: ConfigRegexpOptions) => LinterConfig[];
|
|
8909
9002
|
|
|
8910
|
-
declare const unocss:
|
|
9003
|
+
declare const unocss: (options?: ConfigUnoCSSOptions) => LinterConfig[];
|
|
8911
9004
|
|
|
8912
|
-
declare const command:
|
|
9005
|
+
declare const command: () => LinterConfig[];
|
|
8913
9006
|
|
|
8914
|
-
declare const
|
|
9007
|
+
declare const vitest: (options?: ConfigVitestOptions) => LinterConfig[];
|
|
8915
9008
|
|
|
8916
|
-
declare
|
|
9009
|
+
declare function getVueVersion(): number;
|
|
9010
|
+
declare const vue: (options?: ConfigVueOptions) => LinterConfig[];
|
|
8917
9011
|
|
|
8918
|
-
declare const
|
|
8919
|
-
declare const sortTsConfig: TypedConfigItem[];
|
|
9012
|
+
declare const yml: (options?: ConfigYmlOptions) => LinterConfig[];
|
|
8920
9013
|
|
|
8921
|
-
declare const
|
|
9014
|
+
declare const toml: (options?: ConfigTomlOptions) => LinterConfig[];
|
|
8922
9015
|
|
|
8923
|
-
declare const
|
|
9016
|
+
declare const sortPackageJson: () => LinterConfig[];
|
|
9017
|
+
declare const sortTsConfig: () => LinterConfig[];
|
|
8924
9018
|
|
|
8925
|
-
declare
|
|
8926
|
-
|
|
9019
|
+
declare const jsonc: (options?: ConfigJsoncOptions) => LinterConfig[];
|
|
9020
|
+
|
|
9021
|
+
declare const markdown: (options?: ConfigMarkdownOptions) => LinterConfig[];
|
|
8927
9022
|
|
|
8928
|
-
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_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
|
@@ -9,12 +9,13 @@ export { default as pluginToml } from 'eslint-plugin-toml';
|
|
|
9
9
|
export { default as pluginJsonc } from 'eslint-plugin-jsonc';
|
|
10
10
|
export { default as pluginJsdoc } from 'eslint-plugin-jsdoc';
|
|
11
11
|
export { default as pluginUnoCSS } from '@unocss/eslint-plugin';
|
|
12
|
+
export { default as pluginVitest } from '@vitest/eslint-plugin';
|
|
12
13
|
export { default as pluginUnicorn } from 'eslint-plugin-unicorn';
|
|
13
14
|
export { default as pluginImport } from 'eslint-plugin-import-x';
|
|
14
15
|
export { default as pluginPrettier } from 'eslint-plugin-prettier';
|
|
15
16
|
export { default as pluginMarkdown } from 'eslint-plugin-markdown';
|
|
16
17
|
export { default as pluginPerfectionist } from 'eslint-plugin-perfectionist';
|
|
17
|
-
export { default as pluginUnusedImports } from '
|
|
18
|
+
export { default as pluginUnusedImports } from 'eslint-plugin-unused-imports';
|
|
18
19
|
export { default as pluginComments } from '@eslint-community/eslint-plugin-eslint-comments';
|
|
19
20
|
import * as tomlEslintParser from 'toml-eslint-parser';
|
|
20
21
|
export { tomlEslintParser as parserToml };
|
|
@@ -440,7 +441,7 @@ interface RuleOptions {
|
|
|
440
441
|
*/
|
|
441
442
|
'@typescript-eslint/no-unnecessary-type-constraint'?: Linter.RuleEntry<[]>;
|
|
442
443
|
/**
|
|
443
|
-
* Disallow type parameters that
|
|
444
|
+
* Disallow type parameters that aren't used multiple times
|
|
444
445
|
* @see https://typescript-eslint.io/rules/no-unnecessary-type-parameters
|
|
445
446
|
*/
|
|
446
447
|
'@typescript-eslint/no-unnecessary-type-parameters'?: Linter.RuleEntry<[]>;
|
|
@@ -496,7 +497,7 @@ interface RuleOptions {
|
|
|
496
497
|
'@typescript-eslint/no-unused-expressions'?: Linter.RuleEntry<TypescriptEslintNoUnusedExpressions>;
|
|
497
498
|
/**
|
|
498
499
|
* Disallow unused variables
|
|
499
|
-
* @see https://
|
|
500
|
+
* @see https://typescript-eslint.io/rules/no-unused-vars
|
|
500
501
|
*/
|
|
501
502
|
'@typescript-eslint/no-unused-vars'?: Linter.RuleEntry<TypescriptEslintNoUnusedVars>;
|
|
502
503
|
/**
|
|
@@ -4921,6 +4922,7 @@ type TypescriptEslintNoMisusedPromises = [] | [
|
|
|
4921
4922
|
checksVoidReturn?: (boolean | {
|
|
4922
4923
|
arguments?: boolean;
|
|
4923
4924
|
attributes?: boolean;
|
|
4925
|
+
inheritedMethods?: boolean;
|
|
4924
4926
|
properties?: boolean;
|
|
4925
4927
|
returns?: boolean;
|
|
4926
4928
|
variables?: boolean;
|
|
@@ -6598,6 +6600,8 @@ type PerfectionistSortEnums = [] | [
|
|
|
6598
6600
|
type?: ("alphabetical" | "natural" | "line-length");
|
|
6599
6601
|
order?: ("asc" | "desc");
|
|
6600
6602
|
ignoreCase?: boolean;
|
|
6603
|
+
sortByValue?: boolean;
|
|
6604
|
+
forceNumericSort?: boolean;
|
|
6601
6605
|
partitionByComment?: (string[] | boolean | string);
|
|
6602
6606
|
}
|
|
6603
6607
|
];
|
|
@@ -8769,7 +8773,7 @@ type YmlSpacedComment = [] | [("always" | "never")] | [
|
|
|
8769
8773
|
markers?: string[];
|
|
8770
8774
|
}
|
|
8771
8775
|
];
|
|
8772
|
-
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';
|
|
8773
8777
|
|
|
8774
8778
|
/**
|
|
8775
8779
|
* Parser options
|
|
@@ -8788,6 +8792,10 @@ type TypedConfigItem = Omit<Linter.Config<Linter.RulesRecord & Rules>, 'plugins'
|
|
|
8788
8792
|
*/
|
|
8789
8793
|
plugins?: Record<string, any>;
|
|
8790
8794
|
};
|
|
8795
|
+
/**
|
|
8796
|
+
* Refined `Linter.Config` type
|
|
8797
|
+
*/
|
|
8798
|
+
type LinterConfig = TypedConfigItem;
|
|
8791
8799
|
/**
|
|
8792
8800
|
* ESLint rules
|
|
8793
8801
|
*/
|
|
@@ -8811,26 +8819,111 @@ interface OverridesOptions<Rules = TypedConfigItem['rules']> {
|
|
|
8811
8819
|
rules?: Rules;
|
|
8812
8820
|
parserOptions?: ParserOptions;
|
|
8813
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
|
+
}
|
|
8814
8910
|
|
|
8815
8911
|
/**
|
|
8816
8912
|
* @file presets
|
|
8817
8913
|
*/
|
|
8818
8914
|
|
|
8819
8915
|
/**
|
|
8820
|
-
*
|
|
8916
|
+
* Config factory
|
|
8821
8917
|
*/
|
|
8822
|
-
declare function ntnyq(
|
|
8823
|
-
vue?: boolean | undefined;
|
|
8824
|
-
unocss?: boolean | undefined;
|
|
8825
|
-
prettier?: boolean | undefined;
|
|
8826
|
-
markdown?: boolean | undefined;
|
|
8827
|
-
command?: boolean | undefined;
|
|
8828
|
-
}): TypedConfigItem[];
|
|
8918
|
+
declare function ntnyq(options?: ConfigOptions, customConfig?: Arrayable<TypedConfigItem>): TypedConfigItem[];
|
|
8829
8919
|
|
|
8830
8920
|
declare const hasTypeScript: boolean;
|
|
8921
|
+
declare const hasVitest: boolean;
|
|
8831
8922
|
declare const hasVue: boolean;
|
|
8832
8923
|
declare const hasUnoCSS: boolean;
|
|
8833
8924
|
|
|
8925
|
+
declare function toArray<T>(val?: Arrayable<T>): T[];
|
|
8926
|
+
|
|
8834
8927
|
/**
|
|
8835
8928
|
* Load an ESLint plugin by name.
|
|
8836
8929
|
* @param name - The name of the plugin
|
|
@@ -8838,10 +8931,7 @@ declare const hasUnoCSS: boolean;
|
|
|
8838
8931
|
*/
|
|
8839
8932
|
declare function loadPlugin<T = unknown>(name: string): Promise<T>;
|
|
8840
8933
|
|
|
8841
|
-
|
|
8842
|
-
* Define ESLint config
|
|
8843
|
-
*/
|
|
8844
|
-
declare function defineConfig(configs?: TypedConfigItem[]): TypedConfigItem[];
|
|
8934
|
+
declare function getOverrides<K extends keyof ConfigOptions>(options: ConfigOptions, key: K): Partial<RuleRecord & RuleOptions>;
|
|
8845
8935
|
|
|
8846
8936
|
/**
|
|
8847
8937
|
* Interop default export from a module
|
|
@@ -8850,6 +8940,8 @@ declare function defineConfig(configs?: TypedConfigItem[]): TypedConfigItem[];
|
|
|
8850
8940
|
*/
|
|
8851
8941
|
declare function interopDefault<T>(mod: Awaitable<T>): Promise<InteropModuleDefault<T>>;
|
|
8852
8942
|
|
|
8943
|
+
declare function resolveSubOptions<K extends keyof ConfigOptions>(options: ConfigOptions, key: K): ResolvedOptions<ConfigOptions[K]>;
|
|
8944
|
+
|
|
8853
8945
|
/**
|
|
8854
8946
|
* @file globs constants
|
|
8855
8947
|
*/
|
|
@@ -8860,6 +8952,7 @@ declare const GLOB_JSX = "**/*.?([cm])jsx";
|
|
|
8860
8952
|
declare const GLOB_TS = "**/*.?([cm])ts";
|
|
8861
8953
|
declare const GLOB_TSX = "**/*.?([cm])tsx";
|
|
8862
8954
|
declare const GLOB_DTS = "**/*.d.?([cm])ts";
|
|
8955
|
+
declare const GLOB_TEST = "**/*.{test,spec}.?([cm])[jt]s?(x)";
|
|
8863
8956
|
declare const GLOB_STYLE = "**/*.{c,le,sc}ss";
|
|
8864
8957
|
declare const GLOB_CSS = "**/*.css";
|
|
8865
8958
|
declare const GLOB_LESS = "**/*.less";
|
|
@@ -8881,48 +8974,50 @@ declare const GLOB_EXCLUDE: string[];
|
|
|
8881
8974
|
/**
|
|
8882
8975
|
* @see https://eslint.org/docs/latest/use/configure/configuration-files-new#globally-ignoring-files-with-ignores
|
|
8883
8976
|
*/
|
|
8884
|
-
declare const ignores:
|
|
8977
|
+
declare const ignores: (customIgnores?: ConfigIgnoresOptions) => LinterConfig[];
|
|
8885
8978
|
|
|
8886
|
-
declare const node:
|
|
8979
|
+
declare const node: (options?: ConfigNodeOptions) => LinterConfig[];
|
|
8887
8980
|
|
|
8888
|
-
declare const jsdoc:
|
|
8981
|
+
declare const jsdoc: (options?: ConfigJsdocOptions) => LinterConfig[];
|
|
8889
8982
|
|
|
8890
|
-
declare const imports:
|
|
8983
|
+
declare const imports: (options?: ConfigImportsOptions) => LinterConfig[];
|
|
8891
8984
|
|
|
8892
|
-
declare const unicorn:
|
|
8985
|
+
declare const unicorn: (options?: ConfigUnicornOptions) => LinterConfig[];
|
|
8893
8986
|
|
|
8894
|
-
declare const prettier:
|
|
8987
|
+
declare const prettier: (options?: ConfigPrettierOptions) => LinterConfig[];
|
|
8895
8988
|
|
|
8896
|
-
declare const comments:
|
|
8989
|
+
declare const comments: (options?: ConfigCommentsOptions) => LinterConfig[];
|
|
8897
8990
|
|
|
8898
|
-
declare const javascript:
|
|
8899
|
-
declare const jsx:
|
|
8991
|
+
declare const javascript: (option?: ConfigJavaScriptOptions) => LinterConfig[];
|
|
8992
|
+
declare const jsx: () => LinterConfig[];
|
|
8900
8993
|
|
|
8901
|
-
declare const typescriptCore: TypedConfigItem[];
|
|
8902
|
-
declare const typescript:
|
|
8994
|
+
declare const typescriptCore: (options?: ConfigTypeScriptOptions) => TypedConfigItem[];
|
|
8995
|
+
declare const typescript: (options?: ConfigTypeScriptOptions) => LinterConfig[];
|
|
8903
8996
|
|
|
8904
|
-
declare const unusedImports:
|
|
8997
|
+
declare const unusedImports: (options?: ConfigUnusedImportsOptions) => LinterConfig[];
|
|
8905
8998
|
|
|
8906
|
-
declare const perfectionist:
|
|
8999
|
+
declare const perfectionist: (options?: ConfigPerfectionistOptions) => LinterConfig[];
|
|
8907
9000
|
|
|
8908
|
-
declare const regexp:
|
|
9001
|
+
declare const regexp: (options?: ConfigRegexpOptions) => LinterConfig[];
|
|
8909
9002
|
|
|
8910
|
-
declare const unocss:
|
|
9003
|
+
declare const unocss: (options?: ConfigUnoCSSOptions) => LinterConfig[];
|
|
8911
9004
|
|
|
8912
|
-
declare const command:
|
|
9005
|
+
declare const command: () => LinterConfig[];
|
|
8913
9006
|
|
|
8914
|
-
declare const
|
|
9007
|
+
declare const vitest: (options?: ConfigVitestOptions) => LinterConfig[];
|
|
8915
9008
|
|
|
8916
|
-
declare
|
|
9009
|
+
declare function getVueVersion(): number;
|
|
9010
|
+
declare const vue: (options?: ConfigVueOptions) => LinterConfig[];
|
|
8917
9011
|
|
|
8918
|
-
declare const
|
|
8919
|
-
declare const sortTsConfig: TypedConfigItem[];
|
|
9012
|
+
declare const yml: (options?: ConfigYmlOptions) => LinterConfig[];
|
|
8920
9013
|
|
|
8921
|
-
declare const
|
|
9014
|
+
declare const toml: (options?: ConfigTomlOptions) => LinterConfig[];
|
|
8922
9015
|
|
|
8923
|
-
declare const
|
|
9016
|
+
declare const sortPackageJson: () => LinterConfig[];
|
|
9017
|
+
declare const sortTsConfig: () => LinterConfig[];
|
|
8924
9018
|
|
|
8925
|
-
declare
|
|
8926
|
-
|
|
9019
|
+
declare const jsonc: (options?: ConfigJsoncOptions) => LinterConfig[];
|
|
9020
|
+
|
|
9021
|
+
declare const markdown: (options?: ConfigMarkdownOptions) => LinterConfig[];
|
|
8927
9022
|
|
|
8928
|
-
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_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 };
|