@ntnyq/eslint-config 6.1.0 → 6.1.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/dist/index.d.mts +11 -12
- package/dist/index.mjs +14 -7
- package/package.json +7 -7
package/dist/index.d.mts
CHANGED
|
@@ -17978,13 +17978,10 @@ interface ConfigOptions {
|
|
|
17978
17978
|
* @pg
|
|
17979
17979
|
*/
|
|
17980
17980
|
antfu?: boolean | ConfigAntfuOptions;
|
|
17981
|
-
astro?: boolean | ConfigAstroOptions;
|
|
17982
17981
|
deMorgan?: boolean | ConfigDeMorganOptions;
|
|
17983
17982
|
depend?: boolean | ConfigDependOptions;
|
|
17984
|
-
eslintPlugin?: boolean | ConfigESLintPluginOptions;
|
|
17985
17983
|
githubAction?: boolean | ConfigGitHubActionOptions;
|
|
17986
17984
|
gitignore?: boolean | ConfigGitIgnoreOptions;
|
|
17987
|
-
html?: boolean | ConfigHtmlOptions;
|
|
17988
17985
|
importX?: boolean | ConfigImportXOptions;
|
|
17989
17986
|
jsdoc?: boolean | ConfigJsdocOptions;
|
|
17990
17987
|
jsonc?: boolean | ConfigJsoncOptions;
|
|
@@ -17993,13 +17990,10 @@ interface ConfigOptions {
|
|
|
17993
17990
|
oxfmt?: boolean | ConfigOxfmtOptions;
|
|
17994
17991
|
perfectionist?: boolean | ConfigPerfectionistOptions;
|
|
17995
17992
|
pinia?: boolean | ConfigPiniaOptions;
|
|
17996
|
-
pnpm?: boolean | ConfigPnpmOptions;
|
|
17997
17993
|
prettier?: boolean | ConfigPrettierOptions;
|
|
17998
17994
|
regexp?: boolean | ConfigRegexpOptions;
|
|
17999
17995
|
sort?: boolean | ConfigSortOptions;
|
|
18000
17996
|
specials?: boolean | ConfigSpecialsOptions;
|
|
18001
|
-
svelte?: boolean | ConfigSvelteOptions;
|
|
18002
|
-
svgo?: boolean | ConfigSVGOOptions;
|
|
18003
17997
|
test?: boolean | ConfigTestOptions;
|
|
18004
17998
|
toml?: boolean | ConfigTomlOptions;
|
|
18005
17999
|
typescript?: boolean | ConfigTypeScriptOptions;
|
|
@@ -18007,11 +18001,16 @@ interface ConfigOptions {
|
|
|
18007
18001
|
unocss?: boolean | ConfigUnoCSSOptions;
|
|
18008
18002
|
vue?: boolean | ConfigVueOptions;
|
|
18009
18003
|
yml?: boolean | ConfigYmlOptions;
|
|
18010
|
-
|
|
18011
|
-
|
|
18012
|
-
|
|
18013
|
-
|
|
18014
|
-
|
|
18004
|
+
/**
|
|
18005
|
+
* Configs below are disabled by default
|
|
18006
|
+
* @pg
|
|
18007
|
+
*/
|
|
18008
|
+
astro?: boolean | ConfigAstroOptions;
|
|
18009
|
+
eslintPlugin?: boolean | ConfigESLintPluginOptions;
|
|
18010
|
+
html?: boolean | ConfigHtmlOptions;
|
|
18011
|
+
pnpm?: boolean | ConfigPnpmOptions;
|
|
18012
|
+
svelte?: boolean | ConfigSvelteOptions;
|
|
18013
|
+
svgo?: boolean | ConfigSVGOOptions;
|
|
18015
18014
|
unusedImports?: boolean | ConfigUnusedImportsOptions;
|
|
18016
18015
|
}
|
|
18017
18016
|
//#endregion
|
|
@@ -18147,4 +18146,4 @@ declare const PERFECTIONIST: Readonly<{
|
|
|
18147
18146
|
sortObjectsGroups: string[];
|
|
18148
18147
|
}>;
|
|
18149
18148
|
//#endregion
|
|
18150
|
-
export { Arrayable, Awaitable, ConfigAntfuOptions, ConfigAstroOptions, ConfigCommandOptions, ConfigDeMorganOptions, ConfigDependOptions, ConfigESLintCommentsOptions, ConfigESLintPluginOptions, ConfigGitHubActionOptions, ConfigGitIgnoreOptions, ConfigHtmlOptions, ConfigIgnoresOptions, ConfigImportXOptions, ConfigJavaScriptOptions, ConfigJsdocOptions, ConfigJsoncOptions, ConfigMarkdownOptions, ConfigNames, ConfigNodeOptions, ConfigNtnyqOptions, ConfigOptions,
|
|
18149
|
+
export { Arrayable, Awaitable, ConfigAntfuOptions, ConfigAstroOptions, ConfigCommandOptions, ConfigDeMorganOptions, ConfigDependOptions, ConfigESLintCommentsOptions, ConfigESLintPluginOptions, ConfigGitHubActionOptions, ConfigGitIgnoreOptions, ConfigHtmlOptions, ConfigIgnoresOptions, ConfigImportXOptions, ConfigJavaScriptOptions, ConfigJsdocOptions, ConfigJsoncOptions, ConfigMarkdownOptions, ConfigNames, ConfigNodeOptions, ConfigNtnyqOptions, ConfigOptions, ConfigOxfmtOptions, ConfigPerfectionistOptions, ConfigPiniaOptions, ConfigPnpmOptions, ConfigPrettierOptions, ConfigRegexpOptions, ConfigSVGOOptions, ConfigSortOptions, ConfigSpecialsOptions, ConfigSvelteOptions, ConfigTestOptions, ConfigTomlOptions, ConfigTypeScriptOptions, ConfigUnicornOptions, ConfigUnoCSSOptions, ConfigUnusedImportsOptions, ConfigVueOptions, ConfigYmlOptions, ESLintConfig, ESLintParser, ESLintParserOptions, ESLintProcessor, ESLintRuleSeverity, ESLintRulesRecord, GLOB_ALL_SRC, GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_CSS, GLOB_DIST, GLOB_DTS, GLOB_EXCLUDE, GLOB_GITHUB_ACTION, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSON_SCHEMA, GLOB_JSX, GLOB_JSX_ONLY, GLOB_LESS, GLOB_LOCKFILE, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_NESTED, GLOB_NODE_MODULES, GLOB_PACKAGE_JSON, GLOB_PINIA_STORE, GLOB_PNPM_WORKSPACE_YAML, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_SRC_EXTENSIONS, GLOB_STYLE, GLOB_SVELTE, GLOB_SVG, GLOB_TEST, GLOB_TOML, GLOB_TS, GLOB_TSCONFIG_JSON, GLOB_TSX, GLOB_TSX_ONLY, GLOB_TYPES, GLOB_TYPE_TEST, GLOB_VUE, GLOB_YAML, InteropModuleDefault, NonEmptyArray, OptionsFiles, OptionsFormatter, OptionsIgnores, OptionsOverrides, OptionsShareable, PERFECTIONIST, PerfectionistPartitionByComment, PrettierOptions, Pretty, ResolvedOptions, RuleOptions, TSESLintParserOptions, TypedConfigItem, configAntfu, configAstro, configCommand, configDeMorgan, configDepend, configESLintComments, configESLintPlugin, configGitHubAction, configGitIgnore, configHtml, configIgnores, configImportX, configJSX, configJavaScript, configJsdoc, configJsonc, configMarkdown, configNode, configNtnyq, configOxfmt, configPerfectionist, configPinia, configPnpm, configPrettier, configRegexp, configSVGO, configSort, configSpecials, configSvelte, configTest, configToml, configTypeScript, configUnicorn, configUnoCSS, configUnusedImports, configVue, configYml, configsTypeScript, defineESLintConfig, ensurePackages, getOverrides, hasOxfmt, hasPinia, hasPrettier, hasShadcnVue, hasTypeScript, hasUnoCSS, hasVitest, hasVue, interopDefault, isInGitHooksOrRunBySpecifyPackages, mergeProcessors, parserJsonc, parserPlain, parserToml, parserTypeScript, parserVue, parserYaml, pluginAntfu, pluginDeMorgan, pluginDepend, pluginESLintComments, pluginGitHubAction, pluginImportX, pluginJsdoc, pluginJsonc, pluginMarkdown, pluginNoOnlyTests, pluginNode, pluginNtnyq, pluginOxfmt, pluginPerfectionist, pluginPinia, pluginPrettier, pluginRegexp, pluginSvgo, pluginToml, pluginTypeScript, pluginUnicorn, pluginUnoCSS, pluginVitest, pluginVue, pluginYml, processorPassThrough, processorVueBlocks, resolveSubOptions };
|
package/dist/index.mjs
CHANGED
|
@@ -619,12 +619,14 @@ async function ensurePackages(packages) {
|
|
|
619
619
|
if (process.env.CI || !process.stdout.isTTY || isInGitHooksOrRunBySpecifyPackages() || !isCwdInScope) return;
|
|
620
620
|
const nonExistingPackages = packages.filter((pkg) => !!pkg && !isPackageInScope(pkg));
|
|
621
621
|
if (nonExistingPackages.length === 0) return;
|
|
622
|
-
const { confirm } = await import("@clack/prompts");
|
|
623
|
-
|
|
622
|
+
const { confirm, isCancel } = await import("@clack/prompts");
|
|
623
|
+
const confirmInstall = await confirm({ message: `${nonExistingPackages.length === 1 ? "Package is" : "Packages are"} required for this config: ${nonExistingPackages.join(", ")}. Do you want to install them?` });
|
|
624
|
+
if (isCancel(confirmInstall) || confirmInstall !== true) return;
|
|
625
|
+
try {
|
|
624
626
|
const { installPackage } = await import("@antfu/install-pkg");
|
|
625
627
|
await installPackage(nonExistingPackages, { dev: true });
|
|
626
628
|
} catch (err) {
|
|
627
|
-
|
|
629
|
+
throw new Error(`Failed to install required packages: ${nonExistingPackages.join(", ")}`, { cause: err });
|
|
628
630
|
}
|
|
629
631
|
}
|
|
630
632
|
//#endregion
|
|
@@ -2989,7 +2991,7 @@ const configPerfectionist = (options = {}) => {
|
|
|
2989
2991
|
const extraRules = {
|
|
2990
2992
|
"perfectionist/sort-array-includes": ["error", {
|
|
2991
2993
|
...sharedOptionsWithNewlinesBetween,
|
|
2992
|
-
groups: ["literal"
|
|
2994
|
+
groups: ["literal"]
|
|
2993
2995
|
}],
|
|
2994
2996
|
"perfectionist/sort-classes": ["error", {
|
|
2995
2997
|
...sharedOptionsWithNewlinesBetween,
|
|
@@ -3002,7 +3004,10 @@ const configPerfectionist = (options = {}) => {
|
|
|
3002
3004
|
"unknown"
|
|
3003
3005
|
] }],
|
|
3004
3006
|
"perfectionist/sort-switch-case": "error",
|
|
3005
|
-
"perfectionist/sort-variable-declarations": ["error", {
|
|
3007
|
+
"perfectionist/sort-variable-declarations": ["error", {
|
|
3008
|
+
groups: ["initialized", "uninitialized"],
|
|
3009
|
+
partitionByComment
|
|
3010
|
+
}]
|
|
3006
3011
|
};
|
|
3007
3012
|
const sharedConfig = {
|
|
3008
3013
|
plugins: { perfectionist: pluginPerfectionist },
|
|
@@ -3116,9 +3121,10 @@ const configESLintComments = (options = {}) => [{
|
|
|
3116
3121
|
* Config factory
|
|
3117
3122
|
*/
|
|
3118
3123
|
function defineESLintConfig(options = {}, ...userConfigs) {
|
|
3119
|
-
const { shareable = {}, ignores: userIgnores = [], vue: enableVue = hasVue(), pinia: enablePinia = hasPinia(), test: enableTest = hasVitest(), unocss: enableUnoCSS = hasUnoCSS(), typescript: enableTypeScript = hasTypeScript(), oxfmt: enableOxfmt = hasOxfmt(), prettier: enablePrettier = hasPrettier(), yml: enableYML = true, sort: enableSort = true, toml: enableTOML = true, jsonc: enableJSONC = true, antfu: enableAntfu = true, ntnyq: enableNtnyq = true, depend: enableDepend = true, regexp: enableRegexp = true, unicorn: enableUnicorn = true, deMorgan: enableDeMorgan = true, markdown: enableMarkdown = true, gitignore: enableGitIgnore = true, jsdoc: enableJsdoc = true, importX: enableImportX = true, specials: enableSpecials = true, githubAction: enableGitHubAction = true, perfectionist: enablePerfectionist = true, pnpm: enablePnpm = false, svgo: enableSVGO = false, html: enableHTML = false, astro: enableAstro = false, svelte: enableSvelte = false, eslintPlugin: enableESLintPlugin = false } = options;
|
|
3124
|
+
const { shareable = {}, ignores: userIgnores = [], vue: enableVue = hasVue(), pinia: enablePinia = hasPinia(), test: enableTest = hasVitest(), unocss: enableUnoCSS = hasUnoCSS(), typescript: enableTypeScript = hasTypeScript(), oxfmt: enableOxfmt = hasOxfmt(), prettier: enablePrettier = hasPrettier(), yml: enableYML = true, sort: enableSort = true, toml: enableTOML = true, jsonc: enableJSONC = true, antfu: enableAntfu = true, ntnyq: enableNtnyq = true, depend: enableDepend = true, regexp: enableRegexp = true, unicorn: enableUnicorn = true, deMorgan: enableDeMorgan = true, markdown: enableMarkdown = true, gitignore: enableGitIgnore = true, jsdoc: enableJsdoc = true, importX: enableImportX = true, specials: enableSpecials = true, githubAction: enableGitHubAction = true, perfectionist: enablePerfectionist = true, pnpm: enablePnpm = false, svgo: enableSVGO = false, html: enableHTML = false, astro: enableAstro = false, svelte: enableSvelte = false, eslintPlugin: enableESLintPlugin = false, unusedImports: enableUnusedImports = false } = options;
|
|
3120
3125
|
const configs = [];
|
|
3121
|
-
const { ecmaVersion = "latest", extraFileExtensions = [] } = shareable;
|
|
3126
|
+
const { ecmaVersion = "latest", extraFileExtensions: shareableExtraFileExtensions = [] } = shareable;
|
|
3127
|
+
const extraFileExtensions = [...shareableExtraFileExtensions];
|
|
3122
3128
|
const usingFormatter = enablePrettier || enableOxfmt;
|
|
3123
3129
|
if (enableVue) extraFileExtensions.push(".vue");
|
|
3124
3130
|
if (enableAstro) extraFileExtensions.push(".astro");
|
|
@@ -3214,6 +3220,7 @@ function defineESLintConfig(options = {}, ...userConfigs) {
|
|
|
3214
3220
|
if (enableESLintPlugin) configs.push(configESLintPlugin({ overrides: getOverrides(options, "eslintPlugin") }));
|
|
3215
3221
|
if (enablePnpm) configs.push(configPnpm(resolveSubOptions(options, "pnpm")));
|
|
3216
3222
|
if (enableSVGO) configs.push(configSVGO(resolveSubOptions(options, "svgo")));
|
|
3223
|
+
if (enableUnusedImports) configs.push(configUnusedImports({ overrides: getOverrides(options, "unusedImports") }));
|
|
3217
3224
|
if (enableHTML) configs.push(configHtml({
|
|
3218
3225
|
...resolveSubOptions(options, "html"),
|
|
3219
3226
|
overrides: getOverrides(options, "html")
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ntnyq/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "6.1.
|
|
4
|
+
"version": "6.1.1",
|
|
5
5
|
"description": "An opinionated ESLint config preset of ntnyq",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"eslint",
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
"eslint-plugin-n": "^17.24.0",
|
|
105
105
|
"eslint-plugin-no-only-tests": "^3.3.0",
|
|
106
106
|
"eslint-plugin-ntnyq": "^0.14.0",
|
|
107
|
-
"eslint-plugin-oxfmt": "^0.4.
|
|
107
|
+
"eslint-plugin-oxfmt": "^0.4.1",
|
|
108
108
|
"eslint-plugin-perfectionist": "^5.9.0",
|
|
109
109
|
"eslint-plugin-pinia": "^0.4.2",
|
|
110
110
|
"eslint-plugin-prettier": "^5.5.5",
|
|
@@ -119,15 +119,15 @@
|
|
|
119
119
|
"jsonc-eslint-parser": "^3.1.0",
|
|
120
120
|
"local-pkg": "^1.1.2",
|
|
121
121
|
"toml-eslint-parser": "^1.0.3",
|
|
122
|
-
"typescript-eslint": "^8.59.
|
|
122
|
+
"typescript-eslint": "^8.59.1",
|
|
123
123
|
"vue-eslint-parser": "^10.4.0",
|
|
124
124
|
"yaml-eslint-parser": "^2.0.0"
|
|
125
125
|
},
|
|
126
126
|
"devDependencies": {
|
|
127
127
|
"@types/node": "^25.6.0",
|
|
128
|
-
"@typescript-eslint/types": "^8.59.
|
|
129
|
-
"@typescript-eslint/utils": "^8.59.
|
|
130
|
-
"@typescript/native-preview": "^7.0.0-dev.
|
|
128
|
+
"@typescript-eslint/types": "^8.59.1",
|
|
129
|
+
"@typescript-eslint/utils": "^8.59.1",
|
|
130
|
+
"@typescript/native-preview": "^7.0.0-dev.20260427.1",
|
|
131
131
|
"bumpp": "^11.0.1",
|
|
132
132
|
"consola": "^3.4.2",
|
|
133
133
|
"eslint": "^10.2.1",
|
|
@@ -136,7 +136,7 @@
|
|
|
136
136
|
"jiti": "^2.6.1",
|
|
137
137
|
"nano-staged": "^1.0.2",
|
|
138
138
|
"npm-run-all2": "^8.0.4",
|
|
139
|
-
"oxfmt": "^0.
|
|
139
|
+
"oxfmt": "^0.47.0",
|
|
140
140
|
"prettier": "^3.8.3",
|
|
141
141
|
"tinyglobby": "^0.2.16",
|
|
142
142
|
"tsdown": "^0.21.10",
|