@frabbit/eslint-config 7.5.0 → 7.6.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 +8 -4
- package/dist/index.mjs +71 -67
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -14530,8 +14530,12 @@ declare const unicorn: () => Config[];
|
|
|
14530
14530
|
declare const unocss: () => Promise<Config[]>;
|
|
14531
14531
|
//#endregion
|
|
14532
14532
|
//#region src/configs/vue.d.ts
|
|
14533
|
+
interface VueOptions {
|
|
14534
|
+
/** Vue version. @default 3 */
|
|
14535
|
+
version?: 2 | 3;
|
|
14536
|
+
}
|
|
14533
14537
|
declare const reactivityTransform: () => Config[];
|
|
14534
|
-
declare const vue: () => Config[];
|
|
14538
|
+
declare const vue: (options?: VueOptions) => Config[];
|
|
14535
14539
|
//#endregion
|
|
14536
14540
|
//#region src/configs/yml.d.ts
|
|
14537
14541
|
declare const yml: () => Config[];
|
|
@@ -14603,10 +14607,10 @@ interface Options {
|
|
|
14603
14607
|
prettier?: boolean;
|
|
14604
14608
|
/** UnoCSS support. Auto-enable if detected. */
|
|
14605
14609
|
unocss?: boolean;
|
|
14606
|
-
/** Vue support. Auto-enable if detected. */
|
|
14607
|
-
vue?: boolean;
|
|
14610
|
+
/** Vue support. Auto-enable if detected. Pass 2 for Vue 2 support. */
|
|
14611
|
+
vue?: boolean | 2;
|
|
14608
14612
|
}
|
|
14609
14613
|
/** `@frabbit`'s preset. */
|
|
14610
14614
|
declare function frabbit(options?: Options, ...userConfigs: Awaitable<Arrayable<Config> | FlatConfigComposer<any, any> | Linter.Config[]>[]): FlatConfigComposer<Config, ConfigNames>;
|
|
14611
14615
|
//#endregion
|
|
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 };
|
|
14616
|
+
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, VueOptions, 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
|
@@ -929,74 +929,78 @@ const vueTs = typescriptCore.filter((config) => config.name !== "typescript-esli
|
|
|
929
929
|
name: `frabbit/vue/${config.name?.replace("frabbit/", "") || "anonymous"}`
|
|
930
930
|
};
|
|
931
931
|
});
|
|
932
|
-
const
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
{
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
932
|
+
const vue = (options = {}) => {
|
|
933
|
+
const { version = 3 } = options;
|
|
934
|
+
const configKey = version === 2 ? "flat/vue2-recommended" : "flat/recommended";
|
|
935
|
+
const recommendedRules = pluginVue.configs[configKey].map((c) => c.rules).reduce((acc, c) => ({
|
|
936
|
+
...acc,
|
|
937
|
+
...c
|
|
938
|
+
}), {});
|
|
939
|
+
return [
|
|
940
|
+
...vueTs,
|
|
941
|
+
{
|
|
942
|
+
files: [GLOB_VUE],
|
|
943
|
+
languageOptions: {
|
|
944
|
+
parser: parserVue,
|
|
945
|
+
parserOptions: {
|
|
946
|
+
ecmaFeatures: { jsx: true },
|
|
947
|
+
extraFileExtensions: [".vue"],
|
|
948
|
+
parser: tseslint.parser,
|
|
949
|
+
sourceType: "module"
|
|
950
|
+
}
|
|
951
|
+
},
|
|
952
|
+
name: "frabbit/vue",
|
|
953
|
+
plugins: {
|
|
954
|
+
"@typescript-eslint": tseslint.plugin,
|
|
955
|
+
vue: pluginVue
|
|
956
|
+
},
|
|
957
|
+
processor: pluginVue.processors[".vue"],
|
|
958
|
+
rules: {
|
|
959
|
+
...recommendedRules,
|
|
960
|
+
"vue/block-order": ["error", { order: [
|
|
961
|
+
"script",
|
|
962
|
+
"template",
|
|
963
|
+
"style"
|
|
964
|
+
] }],
|
|
965
|
+
"vue/custom-event-name-casing": ["error", "camelCase"],
|
|
966
|
+
"vue/eqeqeq": ["error", "smart"],
|
|
967
|
+
"vue/html-self-closing": ["error", {
|
|
968
|
+
html: {
|
|
969
|
+
component: "always",
|
|
970
|
+
normal: "always",
|
|
971
|
+
void: "any"
|
|
972
|
+
},
|
|
973
|
+
math: "always",
|
|
974
|
+
svg: "always"
|
|
975
|
+
}],
|
|
976
|
+
"vue/max-attributes-per-line": "off",
|
|
977
|
+
"vue/multi-word-component-names": "off",
|
|
978
|
+
"vue/no-constant-condition": "warn",
|
|
979
|
+
"vue/no-empty-pattern": "error",
|
|
980
|
+
"vue/no-loss-of-precision": "error",
|
|
981
|
+
"vue/no-ref-as-operand": "off",
|
|
982
|
+
"vue/no-unused-refs": "error",
|
|
983
|
+
"vue/no-useless-v-bind": "error",
|
|
984
|
+
"vue/no-v-html": "off",
|
|
985
|
+
"vue/object-shorthand": [
|
|
986
|
+
"error",
|
|
987
|
+
"always",
|
|
988
|
+
{
|
|
989
|
+
avoidQuotes: true,
|
|
990
|
+
ignoreConstructors: false
|
|
991
|
+
}
|
|
992
|
+
],
|
|
993
|
+
"vue/one-component-per-file": "off",
|
|
994
|
+
"vue/padding-line-between-blocks": ["error", "always"],
|
|
995
|
+
"vue/prefer-template": "error",
|
|
996
|
+
"vue/require-default-prop": "off",
|
|
997
|
+
"vue/require-prop-types": "off",
|
|
998
|
+
"vue/return-in-computed-property": ["error", { treatUndefinedAsUnspecified: false }]
|
|
947
999
|
}
|
|
948
1000
|
},
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
vue: pluginVue
|
|
953
|
-
},
|
|
954
|
-
processor: pluginVue.processors[".vue"],
|
|
955
|
-
rules: {
|
|
956
|
-
...recommendedRules,
|
|
957
|
-
"vue/block-order": ["error", { order: [
|
|
958
|
-
"script",
|
|
959
|
-
"template",
|
|
960
|
-
"style"
|
|
961
|
-
] }],
|
|
962
|
-
"vue/custom-event-name-casing": ["error", "camelCase"],
|
|
963
|
-
"vue/eqeqeq": ["error", "smart"],
|
|
964
|
-
"vue/html-self-closing": ["error", {
|
|
965
|
-
html: {
|
|
966
|
-
component: "always",
|
|
967
|
-
normal: "always",
|
|
968
|
-
void: "any"
|
|
969
|
-
},
|
|
970
|
-
math: "always",
|
|
971
|
-
svg: "always"
|
|
972
|
-
}],
|
|
973
|
-
"vue/max-attributes-per-line": "off",
|
|
974
|
-
"vue/multi-word-component-names": "off",
|
|
975
|
-
"vue/no-constant-condition": "warn",
|
|
976
|
-
"vue/no-empty-pattern": "error",
|
|
977
|
-
"vue/no-loss-of-precision": "error",
|
|
978
|
-
"vue/no-ref-as-operand": "off",
|
|
979
|
-
"vue/no-unused-refs": "error",
|
|
980
|
-
"vue/no-useless-v-bind": "error",
|
|
981
|
-
"vue/no-v-html": "off",
|
|
982
|
-
"vue/object-shorthand": [
|
|
983
|
-
"error",
|
|
984
|
-
"always",
|
|
985
|
-
{
|
|
986
|
-
avoidQuotes: true,
|
|
987
|
-
ignoreConstructors: false
|
|
988
|
-
}
|
|
989
|
-
],
|
|
990
|
-
"vue/one-component-per-file": "off",
|
|
991
|
-
"vue/padding-line-between-blocks": ["error", "always"],
|
|
992
|
-
"vue/prefer-template": "error",
|
|
993
|
-
"vue/require-default-prop": "off",
|
|
994
|
-
"vue/require-prop-types": "off",
|
|
995
|
-
"vue/return-in-computed-property": ["error", { treatUndefinedAsUnspecified: false }]
|
|
996
|
-
}
|
|
997
|
-
},
|
|
998
|
-
...reactivityTransform()
|
|
999
|
-
];
|
|
1001
|
+
...version === 3 ? reactivityTransform() : []
|
|
1002
|
+
];
|
|
1003
|
+
};
|
|
1000
1004
|
|
|
1001
1005
|
//#endregion
|
|
1002
1006
|
//#region src/configs/yml.ts
|
|
@@ -1092,7 +1096,7 @@ function frabbit(options = {}, ...userConfigs) {
|
|
|
1092
1096
|
presetJsonc()
|
|
1093
1097
|
];
|
|
1094
1098
|
if (enableBaseline) configs$1.push(baseline(typeof enableBaseline === "object" ? enableBaseline : {}));
|
|
1095
|
-
if (enableVue) configs$1.push(vue());
|
|
1099
|
+
if (enableVue) configs$1.push(vue({ version: enableVue === 2 ? 2 : 3 }));
|
|
1096
1100
|
if (enableNestjs) configs$1.push(nestjs());
|
|
1097
1101
|
if (enableMarkdown) configs$1.push(markdown());
|
|
1098
1102
|
if (enableUnocss) configs$1.push(unocss());
|