|
1 | | -import typescriptEslint from "typescript-eslint"; |
2 | | -import vueEslintParser from "vue-eslint-parser"; |
3 | | -import pluginVue from "eslint-plugin-vue"; |
4 | | -import eslintjs from "@eslint/js"; |
5 | | -import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended"; |
| 1 | +import { defaultConfig } from '@caido/eslint-config'; |
| 2 | +import markdownPlugin from '@eslint/markdown'; |
6 | 3 |
|
7 | 4 | /** @type {import('eslint').Linter.Config } */ |
8 | 5 | export default [ |
9 | 6 | { |
10 | | - ignores: [".vitepress/cache"], |
| 7 | + ignores: [".vitepress/cache", ".vitepress/dist", "./src/reference/sdks", "./src/reference/modules"], |
11 | 8 | }, |
12 | | - eslintjs.configs.recommended, |
13 | | - ...typescriptEslint.configs.recommendedTypeChecked, |
14 | | - eslintPluginPrettierRecommended, |
15 | | - ...pluginVue.configs["flat/recommended"], |
16 | | - { |
| 9 | + ...(markdownPlugin.configs.recommended.map(config => ({ |
| 10 | + ...config, |
17 | 11 | languageOptions: { |
18 | | - parser: vueEslintParser, |
19 | | - parserOptions: { |
20 | | - parser: typescriptEslint.parser, |
21 | | - project: "./tsconfig.json", |
22 | | - extraFileExtensions: [".vue"], |
23 | | - }, |
24 | | - }, |
25 | | - rules: { |
26 | | - // Disabled |
27 | | - "no-empty-pattern": "off", |
28 | | - "@typescript-eslint/ban-ts-ignore": "off", |
29 | | - "@typescript-eslint/explicit-function-return-type": "off", |
30 | | - "@typescript-eslint/no-non-null-assertion": "off", |
31 | | - "@typescript-eslint/no-unsafe-argument": "off", |
32 | | - "@typescript-eslint/no-unsafe-member-access": "off", |
33 | | - "@typescript-eslint/no-unsafe-call": "off", |
34 | | - "@typescript-eslint/no-floating-promises": "off", |
35 | | - "@typescript-eslint/no-unsafe-assignment": "off", |
36 | | - "@typescript-eslint/restrict-template-expressions": "off", |
37 | | - "@typescript-eslint/no-unsafe-return": "off", |
38 | | - "@typescript-eslint/no-implied-eval": "off", |
39 | | - "@typescript-eslint/unbound-method": "off", |
40 | | - "@typescript-eslint/no-unused-expressions": "off", |
41 | | - |
42 | | - // Disabled for performance issues |
43 | | - // Reference: https://typescript-eslint.io/linting/troubleshooting/performance-troubleshooting/#eslint-plugin-import |
44 | | - "import/namespace": "off", |
45 | | - |
46 | | - // Disable no-unused-vars and uses noUnusedLocals: true in tsconfig.json instead |
47 | | - // Reference: https://github.com/johnsoncodehk/volar/issues/47 |
48 | | - "@typescript-eslint/no-unused-vars": "off", |
49 | | - |
50 | | - // Enabled |
51 | | - "sort-imports": [ |
52 | | - "warn", |
53 | | - { |
54 | | - ignoreCase: true, |
55 | | - ignoreDeclarationSort: true, |
56 | | - }, |
57 | | - ], |
58 | | - |
59 | | - "@typescript-eslint/consistent-type-imports": "error", |
60 | | - "@typescript-eslint/switch-exhaustiveness-check": "error", |
61 | | - |
62 | | - "vue/singleline-html-element-content-newline": "off", |
63 | | - "vue/multi-word-component-names": "off", |
64 | | - }, |
65 | | - }, |
| 12 | + frontmatter: "yaml" |
| 13 | + } |
| 14 | + }))), |
| 15 | + ...(defaultConfig().map(config => ({ |
| 16 | + ...config, |
| 17 | + files: ["**/*.ts", "**/*.vue"], |
| 18 | + }))), |
66 | 19 | ]; |
0 commit comments