|
| 1 | +import pluginVue from 'eslint-plugin-vue' |
| 2 | +import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended' |
| 3 | +import markdown from 'eslint-plugin-markdown' |
| 4 | +import tseslint from 'typescript-eslint' |
| 5 | + |
| 6 | +export default [ |
| 7 | + ...pluginVue.configs['flat/recommended'], |
| 8 | + eslintPluginPrettierRecommended, |
| 9 | + ...markdown.configs.recommended, |
| 10 | + { |
| 11 | + rules: { |
| 12 | + 'object-shorthand': 'error', |
| 13 | + 'no-debugger': 'error', |
| 14 | + 'vue/multi-word-component-names': 'off', |
| 15 | + 'prefer-template': 'error', |
| 16 | + 'no-restricted-properties': [ |
| 17 | + 'error', |
| 18 | + { |
| 19 | + object: 'context', |
| 20 | + property: 'getSourceCode', |
| 21 | + message: 'Use lib/utils/compat.ts' |
| 22 | + }, |
| 23 | + { |
| 24 | + object: 'context', |
| 25 | + property: 'getFilename', |
| 26 | + message: 'Use lib/utils/compat.ts' |
| 27 | + }, |
| 28 | + { |
| 29 | + object: 'context', |
| 30 | + property: 'getPhysicalFilename', |
| 31 | + message: 'Use lib/utils/compat.ts' |
| 32 | + }, |
| 33 | + { |
| 34 | + object: 'context', |
| 35 | + property: 'getCwd', |
| 36 | + message: 'Use lib/utils/compat.ts' |
| 37 | + }, |
| 38 | + { |
| 39 | + object: 'context', |
| 40 | + property: 'getScope', |
| 41 | + message: 'Use lib/utils/compat.ts' |
| 42 | + }, |
| 43 | + { |
| 44 | + object: 'context', |
| 45 | + property: 'parserServices', |
| 46 | + message: 'Use lib/utils/compat.ts' |
| 47 | + } |
| 48 | + ] |
| 49 | + } |
| 50 | + }, |
| 51 | + ...tseslint.config({ |
| 52 | + files: ['*.ts', '**/*.ts', '*.mts', '**/*.mts'], |
| 53 | + extends: [...tseslint.configs.recommended], |
| 54 | + rules: { |
| 55 | + '@typescript-eslint/no-non-null-assertion': 'off', |
| 56 | + '@typescript-eslint/consistent-type-imports': 'error' |
| 57 | + } |
| 58 | + }), |
| 59 | + { |
| 60 | + files: ['*.vue', '**/*.vue'], |
| 61 | + languageOptions: { |
| 62 | + parserOptions: { |
| 63 | + parser: tseslint.parser |
| 64 | + } |
| 65 | + } |
| 66 | + }, |
| 67 | + { |
| 68 | + files: ['js', 'mjs', 'cjs', 'ts', 'mts', 'cts', 'vue'].map(ext => [ |
| 69 | + `**/*.md/*.${ext}` |
| 70 | + ]), |
| 71 | + rules: { |
| 72 | + 'prettier/prettier': 'off', |
| 73 | + 'vue/no-v-html': 'off' |
| 74 | + } |
| 75 | + }, |
| 76 | + { |
| 77 | + ignores: [ |
| 78 | + '!docs/.vitepress/', |
| 79 | + '!.github/', |
| 80 | + '!.vscode/', |
| 81 | + '.nyc_output/', |
| 82 | + 'assets/', |
| 83 | + 'coverage/', |
| 84 | + 'dist/', |
| 85 | + 'docs/.vitepress/cache/', |
| 86 | + 'docs/.vitepress/dist/', |
| 87 | + 'lib/configs/**/*.ts', |
| 88 | + 'node_modules/', |
| 89 | + 'tests/integrations/' |
| 90 | + // 'tests/fixtures/' // Do not specify it here for the test to work. |
| 91 | + ] |
| 92 | + } |
| 93 | +] |
0 commit comments