@frabbit/eslint-config 7.4.6 → 7.5.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.mts +7 -1
- package/dist/index.mjs +16 -3
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -14489,6 +14489,9 @@ declare const jsonc: () => Config[];
|
|
|
14489
14489
|
//#region src/configs/markdown.d.ts
|
|
14490
14490
|
declare const markdown: () => Config[];
|
|
14491
14491
|
//#endregion
|
|
14492
|
+
//#region src/configs/nestjs.d.ts
|
|
14493
|
+
declare const nestjs: () => Config[];
|
|
14494
|
+
//#endregion
|
|
14492
14495
|
//#region src/configs/node.d.ts
|
|
14493
14496
|
declare const node: () => Config[];
|
|
14494
14497
|
//#endregion
|
|
@@ -14537,6 +14540,7 @@ declare const yml: () => Config[];
|
|
|
14537
14540
|
declare const hasTypeScript: () => boolean;
|
|
14538
14541
|
declare const hasVue: () => boolean;
|
|
14539
14542
|
declare const hasUnocss: () => boolean;
|
|
14543
|
+
declare const hasNestjs: () => boolean;
|
|
14540
14544
|
declare function isInEditorEnv(): boolean;
|
|
14541
14545
|
declare function isInGitHooksOrLintStaged(): boolean;
|
|
14542
14546
|
//#endregion
|
|
@@ -14591,6 +14595,8 @@ interface Options {
|
|
|
14591
14595
|
command?: boolean;
|
|
14592
14596
|
/** markdown support. @default true */
|
|
14593
14597
|
markdown?: boolean;
|
|
14598
|
+
/** NestJS support. Auto-enable if detected. */
|
|
14599
|
+
nestjs?: boolean;
|
|
14594
14600
|
/** @default false */
|
|
14595
14601
|
pnpm?: boolean;
|
|
14596
14602
|
/** Prettier support. @default true */
|
|
@@ -14603,4 +14609,4 @@ interface Options {
|
|
|
14603
14609
|
/** `@frabbit`'s preset. */
|
|
14604
14610
|
declare function frabbit(options?: Options, ...userConfigs: Awaitable<Arrayable<Config> | FlatConfigComposer<any, any> | Linter.Config[]>[]): FlatConfigComposer<Config, ConfigNames>;
|
|
14605
14611
|
//#endregion
|
|
14606
|
-
export { BaselineOptions, Config, ConfigNames, GLOB_ALL_SRC, GLOB_CSS, GLOB_DIST, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_LOCKFILE, GLOB_MARKDOWN, GLOB_NODE_MODULES, GLOB_NUXT_LAYOUTS, GLOB_NUXT_PAGE, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, Options, Rules, baseline, command, comments, configCommand, configComments, configJs, deMorgan, frabbit, hasTypeScript, hasUnocss, hasVue, ignores, imports, isInEditorEnv, isInGitHooksOrLintStaged, javascript, jsdoc, jsonc, markdown, node, parserJsonc, parserVue, parserYml, pluginAntfu, pluginDeMorgan, pluginIgnore, pluginImport, pluginJsdoc, pluginJsonc, pluginMarkdown, pluginNode, pluginPerfectionist, pluginPnpm, pluginPrettier, pluginPrettierRecommended, pluginSecurity, pluginSonarJS, pluginSxzz, pluginUnicorn, pluginUnusedImports, pluginVue, pluginYml, pnpm, presetAll, presetBasic, presetJavaScript, presetJsonc, presetLangsExtensions, prettier, reactivityTransform, regexp, restrictedSyntaxJs, security, sonarjs, sortImports, sortPackageJson, sortPnpmWorkspace, sortTsconfig, specialCases, tseslint, typescript, typescriptCore, unicorn, unocss, vue, yml };
|
|
14612
|
+
export { BaselineOptions, Config, ConfigNames, GLOB_ALL_SRC, GLOB_CSS, GLOB_DIST, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_LOCKFILE, GLOB_MARKDOWN, GLOB_NODE_MODULES, GLOB_NUXT_LAYOUTS, GLOB_NUXT_PAGE, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, Options, Rules, baseline, command, comments, configCommand, configComments, configJs, deMorgan, frabbit, hasNestjs, hasTypeScript, hasUnocss, hasVue, ignores, imports, isInEditorEnv, isInGitHooksOrLintStaged, javascript, jsdoc, jsonc, markdown, nestjs, node, parserJsonc, parserVue, parserYml, pluginAntfu, pluginDeMorgan, pluginIgnore, pluginImport, pluginJsdoc, pluginJsonc, pluginMarkdown, pluginNode, pluginPerfectionist, pluginPnpm, pluginPrettier, pluginPrettierRecommended, pluginSecurity, pluginSonarJS, pluginSxzz, pluginUnicorn, pluginUnusedImports, pluginVue, pluginYml, pnpm, presetAll, presetBasic, presetJavaScript, presetJsonc, presetLangsExtensions, prettier, reactivityTransform, regexp, restrictedSyntaxJs, security, sonarjs, sortImports, sortPackageJson, sortPnpmWorkspace, sortTsconfig, specialCases, tseslint, typescript, typescriptCore, unicorn, unocss, vue, yml };
|
package/dist/index.mjs
CHANGED
|
@@ -262,7 +262,7 @@ const javascript = () => [{
|
|
|
262
262
|
"require-await": "error",
|
|
263
263
|
"sxzz/prefer-string-function": "warn",
|
|
264
264
|
"unicode-bom": ["error", "never"],
|
|
265
|
-
"unused-imports/no-unused-imports": "
|
|
265
|
+
"unused-imports/no-unused-imports": "error",
|
|
266
266
|
"unused-imports/no-unused-vars": ["error", {
|
|
267
267
|
args: "after-used",
|
|
268
268
|
ignoreRestSiblings: true
|
|
@@ -352,6 +352,17 @@ const markdown = () => [...pluginMarkdown.configs.processor.map((config) => ({
|
|
|
352
352
|
}
|
|
353
353
|
}];
|
|
354
354
|
|
|
355
|
+
//#endregion
|
|
356
|
+
//#region src/configs/nestjs.ts
|
|
357
|
+
const nestjs = () => [{
|
|
358
|
+
files: [GLOB_TS, GLOB_TSX],
|
|
359
|
+
languageOptions: { parserOptions: {
|
|
360
|
+
emitDecoratorMetadata: true,
|
|
361
|
+
experimentalDecorators: true
|
|
362
|
+
} },
|
|
363
|
+
name: "frabbit/nestjs"
|
|
364
|
+
}];
|
|
365
|
+
|
|
355
366
|
//#endregion
|
|
356
367
|
//#region src/configs/node.ts
|
|
357
368
|
const node = () => [{
|
|
@@ -1008,6 +1019,7 @@ const yml = () => [{
|
|
|
1008
1019
|
const hasTypeScript = () => isPackageExists("typescript");
|
|
1009
1020
|
const hasVue = () => isPackageExists("vue") || isPackageExists("nuxt") || isPackageExists("vitepress") || isPackageExists("@slidev/cli");
|
|
1010
1021
|
const hasUnocss = () => isPackageExists("unocss") || isPackageExists("@unocss/webpack") || isPackageExists("@unocss/nuxt") || isPackageExists("@unocss/eslint-plugin");
|
|
1022
|
+
const hasNestjs = () => isPackageExists("@nestjs/core") || isPackageExists("@nestjs/common");
|
|
1011
1023
|
function isInEditorEnv() {
|
|
1012
1024
|
if (process.env.CI) return false;
|
|
1013
1025
|
if (isInGitHooksOrLintStaged()) return false;
|
|
@@ -1073,7 +1085,7 @@ const presetAll = async () => [
|
|
|
1073
1085
|
];
|
|
1074
1086
|
/** `@frabbit`'s preset. */
|
|
1075
1087
|
function frabbit(options = {}, ...userConfigs) {
|
|
1076
|
-
const { baseline: enableBaseline = true, command: enableCommand = true, markdown: enableMarkdown = true, pnpm: enablePnpm = false, prettier: enablePrettier = true, unocss: enableUnocss = hasUnocss(), vue: enableVue = hasVue() } = options;
|
|
1088
|
+
const { baseline: enableBaseline = true, command: enableCommand = true, markdown: enableMarkdown = true, nestjs: enableNestjs = hasNestjs(), pnpm: enablePnpm = false, prettier: enablePrettier = true, unocss: enableUnocss = hasUnocss(), vue: enableVue = hasVue() } = options;
|
|
1077
1089
|
const configs$1 = [
|
|
1078
1090
|
presetBasic(),
|
|
1079
1091
|
yml(),
|
|
@@ -1081,6 +1093,7 @@ function frabbit(options = {}, ...userConfigs) {
|
|
|
1081
1093
|
];
|
|
1082
1094
|
if (enableBaseline) configs$1.push(baseline(typeof enableBaseline === "object" ? enableBaseline : {}));
|
|
1083
1095
|
if (enableVue) configs$1.push(vue());
|
|
1096
|
+
if (enableNestjs) configs$1.push(nestjs());
|
|
1084
1097
|
if (enableMarkdown) configs$1.push(markdown());
|
|
1085
1098
|
if (enableUnocss) configs$1.push(unocss());
|
|
1086
1099
|
if (enablePrettier) configs$1.push(prettier());
|
|
@@ -1091,4 +1104,4 @@ function frabbit(options = {}, ...userConfigs) {
|
|
|
1091
1104
|
}
|
|
1092
1105
|
|
|
1093
1106
|
//#endregion
|
|
1094
|
-
export { GLOB_ALL_SRC, GLOB_CSS, GLOB_DIST, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_LOCKFILE, GLOB_MARKDOWN, GLOB_NODE_MODULES, GLOB_NUXT_LAYOUTS, GLOB_NUXT_PAGE, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, baseline, command, comments, configCommand, configComments, configJs, deMorgan, frabbit, hasTypeScript, hasUnocss, hasVue, ignores, imports, isInEditorEnv, isInGitHooksOrLintStaged, javascript, jsdoc, jsonc, markdown, node, parserJsonc, parserVue, parserYml, pluginAntfu, pluginDeMorgan, pluginIgnore, pluginImport, pluginJsdoc, pluginJsonc, pluginMarkdown, pluginNode, pluginPerfectionist, pluginPnpm, pluginPrettier, pluginPrettierRecommended, pluginSecurity, pluginSonarJS, pluginSxzz, pluginUnicorn, pluginUnusedImports, pluginVue, pluginYml, pnpm, presetAll, presetBasic, presetJavaScript, presetJsonc, presetLangsExtensions, prettier, reactivityTransform, regexp, restrictedSyntaxJs, security, sonarjs, sortImports, sortPackageJson, sortPnpmWorkspace, sortTsconfig, specialCases, tseslint, typescript, typescriptCore, unicorn, unocss, vue, yml };
|
|
1107
|
+
export { GLOB_ALL_SRC, GLOB_CSS, GLOB_DIST, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_LOCKFILE, GLOB_MARKDOWN, GLOB_NODE_MODULES, GLOB_NUXT_LAYOUTS, GLOB_NUXT_PAGE, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, baseline, command, comments, configCommand, configComments, configJs, deMorgan, frabbit, hasNestjs, hasTypeScript, hasUnocss, hasVue, ignores, imports, isInEditorEnv, isInGitHooksOrLintStaged, javascript, jsdoc, jsonc, markdown, nestjs, node, parserJsonc, parserVue, parserYml, pluginAntfu, pluginDeMorgan, pluginIgnore, pluginImport, pluginJsdoc, pluginJsonc, pluginMarkdown, pluginNode, pluginPerfectionist, pluginPnpm, pluginPrettier, pluginPrettierRecommended, pluginSecurity, pluginSonarJS, pluginSxzz, pluginUnicorn, pluginUnusedImports, pluginVue, pluginYml, pnpm, presetAll, presetBasic, presetJavaScript, presetJsonc, presetLangsExtensions, prettier, reactivityTransform, regexp, restrictedSyntaxJs, security, sonarjs, sortImports, sortPackageJson, sortPnpmWorkspace, sortTsconfig, specialCases, tseslint, typescript, typescriptCore, unicorn, unocss, vue, yml };
|