@@ -60,50 +60,50 @@ All the `<script>` blocks in `.vue` files *MUST* be written in TypeScript (shoul
60
60
import pluginVue from ' eslint-plugin-vue'
61
61
import {
62
62
defineConfig ,
63
- configs ,
64
63
configureVueProject ,
64
+ configs ,
65
65
} from ' @vue/eslint-config-typescript'
66
66
67
- export default [
68
- ... pluginVue .configs [" flat/essential" ],
67
+ configureVueProject ({
68
+ // Optional: specify the script langs in `.vue` files
69
+ // Defaults to `{ ts: true, js: false, tsx: false, jsx: false }`
70
+ supportedScriptLangs: {
71
+ ts: true ,
72
+
73
+ // [!DISCOURAGED]
74
+ // Set to `true` to allow plain `<script>` or `<script setup>` blocks.
75
+ // This might result-in false positive or negatives in some rules for `.vue` files.
76
+ // Note you also need to configure `allowJs: true` and `checkJs: true`
77
+ // in corresponding `tsconfig.json` files.
78
+ js: false ,
79
+
80
+ // [!STRONGLY DISCOURAGED]
81
+ // Set to `true` to allow `<script lang="tsx">` blocks.
82
+ // This would be in conflict with all type-aware rules.
83
+ tsx: false ,
84
+
85
+ // [!STRONGLY DISCOURAGED]
86
+ // Set to `true` to allow `<script lang="jsx">` blocks.
87
+ // This would be in conflict with all type-aware rules and may result in false positives.
88
+ jsx: false ,
89
+ },
90
+
91
+ // <https://github.com/vuejs/eslint-plugin-vue/issues/1910#issuecomment-1819993961>
92
+ // Optional: the root directory to resolve the `.vue` files, defaults to `process.cwd()`.
93
+ // You may need to set this to the root directory of your project if you have a monorepo.
94
+ // This is useful when you allow any other languages than `ts` in `.vue` files.
95
+ // Our config helper would resolve and parse all the `.vue` files under `rootDir`,
96
+ // and only apply the loosened rules to the files that do need them.
97
+ rootDir: import .meta.dirname,
98
+ })
99
+
100
+ export default defineConfig (
101
+ pluginVue .configs [" flat/essential" ],
69
102
70
103
// We STRONGLY RECOMMEND you to start with `recommended` or `recommendedTypeChecked`.
71
104
// But if you are determined to configure all rules by yourself,
72
105
// you can start with `base`, and then turn on/off the rules you need.
73
106
configs .base ,
74
-
75
- configureVueProject ({
76
- // Optional: specify the script langs in `.vue` files
77
- // Defaults to `{ ts: true, js: false, tsx: false, jsx: false }`
78
- supportedScriptLangs: {
79
- ts: true ,
80
-
81
- // [!DISCOURAGED]
82
- // Set to `true` to allow plain `<script>` or `<script setup>` blocks.
83
- // This might result-in false positive or negatives in some rules for `.vue` files.
84
- // Note you also need to configure `allowJs: true` and `checkJs: true`
85
- // in corresponding `tsconfig.json` files.
86
- js: false ,
87
-
88
- // [!STRONGLY DISCOURAGED]
89
- // Set to `true` to allow `<script lang="tsx">` blocks.
90
- // This would be in conflict with all type-aware rules.
91
- tsx: false ,
92
-
93
- // [!STRONGLY DISCOURAGED]
94
- // Set to `true` to allow `<script lang="jsx">` blocks.
95
- // This would be in conflict with all type-aware rules and may result in false positives.
96
- jsx: false ,
97
- },
98
-
99
- // <https://github.com/vuejs/eslint-plugin-vue/issues/1910#issuecomment-1819993961>
100
- // Optional: the root directory to resolve the `.vue` files, defaults to `process.cwd()`.
101
- // You may need to set this to the root directory of your project if you have a monorepo.
102
- // This is useful when you allow any other languages than `ts` in `.vue` files.
103
- // Our config helper would resolve and parse all the `.vue` files under `rootDir`,
104
- // and only apply the loosened rules to the files that do need them.
105
- rootDir: import .meta.dirname,
106
- }),
107
107
)
108
108
```
109
109
0 commit comments