|
| 1 | +import pluginVue from "eslint-plugin-vue"; |
| 2 | +import vueTsEslintConfig from "@vue/eslint-config-typescript"; |
| 3 | +import pluginVitest from "@vitest/eslint-plugin"; |
| 4 | +import skipFormatting from "@vue/eslint-config-prettier/skip-formatting"; |
| 5 | + |
| 6 | +export default [ |
| 7 | + { |
| 8 | + name: "app/files-to-lint", |
| 9 | + files: ["**/*.{ts,mts,tsx,vue}"], |
| 10 | + }, |
| 11 | + |
| 12 | + { |
| 13 | + name: "app/files-to-ignore", |
| 14 | + ignores: ["**/dist/**", "**/dist-ssr/**", "**/coverage/**"], |
| 15 | + }, |
| 16 | + |
| 17 | + ...pluginVue.configs["flat/recommended"], |
| 18 | + ...vueTsEslintConfig(), |
| 19 | + |
| 20 | + { |
| 21 | + ...pluginVitest.configs.recommended, |
| 22 | + files: ["src/**/__tests__/*"], |
| 23 | + }, |
| 24 | + skipFormatting, |
| 25 | + |
| 26 | + { |
| 27 | + rules: { |
| 28 | + "no-console": "warn", |
| 29 | + "no-debugger": "warn", |
| 30 | + "no-var": "error", |
| 31 | + "prefer-const": "error", |
| 32 | + "no-new-object": "error", |
| 33 | + "object-shorthand": "error", |
| 34 | + "no-array-constructor": "error", |
| 35 | + "prefer-destructuring": "error", |
| 36 | + "prefer-template": "error", |
| 37 | + "func-style": "error", |
| 38 | + "no-loop-func": "error", |
| 39 | + "prefer-rest-params": "error", |
| 40 | + "default-param-last": "error", |
| 41 | + "no-param-reassign": "error", |
| 42 | + "prefer-spread": "error", |
| 43 | + "prefer-arrow-callback": "error", |
| 44 | + "no-duplicate-imports": "error", |
| 45 | + "dot-notation": "error", |
| 46 | + "no-unneeded-ternary": "error", |
| 47 | + "no-warning-comments": "warn", |
| 48 | + "no-unused-vars": "off", // Handled by "@typescript-eslint/no-unused-vars" |
| 49 | + }, |
| 50 | + }, |
| 51 | + { |
| 52 | + rules: { |
| 53 | + "@typescript-eslint/ban-ts-comment": "warn", |
| 54 | + "@typescript-eslint/no-explicit-any": "warn", |
| 55 | + "@typescript-eslint/no-non-null-assertion": "off", |
| 56 | + "@typescript-eslint/no-unused-vars": [ |
| 57 | + "error", |
| 58 | + { |
| 59 | + args: "all", |
| 60 | + argsIgnorePattern: "^_", |
| 61 | + caughtErrorsIgnorePattern: "^_", |
| 62 | + }, |
| 63 | + ], |
| 64 | + }, |
| 65 | + }, |
| 66 | +]; |
0 commit comments