12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- import pluginVue from "eslint-plugin-vue"
- import vueTsEslintConfig from "@vue/eslint-config-typescript"
- import skipFormatting from "@vue/eslint-config-prettier/skip-formatting"
- export default [
- {
- name: "app/files-to-lint",
- files: ["**/*.{ts,mts,tsx,vue}"]
- },
- {
- name: "app/files-to-ignore",
- ignores: ["**/dist/**", "**/dist-ssr/**", "**/coverage/**"]
- },
- ...pluginVue.configs["flat/essential"],
- ...vueTsEslintConfig(),
- skipFormatting,
- {
- name: "app/custom-rules",
- rules: {
- "no-debugger": process.env.NODE_ENV == "production" ? 2 : 1,
- "no-unreachable": process.env.NODE_ENV == "production" ? 2 : 1, //return 警告不报错
- "no-undef": "off", // 没有声明的变量
- "vue/no-v-html": "off",
- "no-irregular-whitespace": "off",
- "vue/html-self-closing": [
- "error",
- {
- html: {
- void: "always",
- normal: "never",
- component: "always"
- },
- svg: "always",
- math: "always"
- }
- ],
- "vue/multi-word-component-names": "off", // 关闭驼峰命名
- "@typescript-eslint/no-unused-expressions": "off", // 关闭规则提示
- /* ts相关 */
- "@typescript-eslint/no-empty-function": "off", // 可以为空函数
- "@typescript-eslint/explicit-module-boundary-types": "off", //函数不需要返回类型也可以
- "@typescript-eslint/no-explicit-any": "off", //可以为any
- "@typescript-eslint/no-non-null-assertion": "off", //! 非空断言
- "@typescript-eslint/no-this-alias": "off" //忽略this关键字
- }
- }
- ]
|