You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+13-41
Original file line number
Diff line number
Diff line change
@@ -27,10 +27,11 @@ Please also make sure that you have `typescript` and `eslint` installed.
27
27
28
28
Because of the complexity of this config, it is exported as a factory function that takes an options object and returns an ESLint configuration object.
29
29
30
-
This package exports 2 utility functions:
30
+
This package exports:
31
31
32
-
-`defineConfig`, as a re-export of the [`config` function from `typescript-eslint`](https://typescript-eslint.io/packages/typescript-eslint#config).
33
-
-`createConfig`, used for creating an ESLint configuration array that extends from the [`typescript-eslint` shared configs](https://typescript-eslint.io/users/configs).
32
+
- a utility function: `defineConfig`, as a re-export of the [`config` function from `typescript-eslint`](https://typescript-eslint.io/packages/typescript-eslint#config).
33
+
- all the [shared configruations from `typescript-eslint`](https://typescript-eslint.io/users/configs), available as named exports (in camelCase, e.g. `recommendedTypeChecked`).
34
+
- a Vue-specific config factory: `configureVueProject({ supportedScriptLangs, rootDir })`. More info below.
34
35
35
36
### Minimal Setup
36
37
@@ -39,12 +40,12 @@ This package exports 2 utility functions:
39
40
importpluginVuefrom'eslint-plugin-vue'
40
41
import {
41
42
defineConfig,
42
-
createConfigasvueTsEslintConfig,
43
+
recommended,
43
44
} from'@vue/eslint-config-typescript'
44
45
45
46
exportdefaultdefineConfig(
46
47
pluginVue.configs['flat/essential'],
47
-
vueTsEslintConfig(),
48
+
recommended,
48
49
)
49
50
```
50
51
@@ -59,26 +60,14 @@ All the `<script>` blocks in `.vue` files _MUST_ be written in TypeScript (shoul
59
60
importpluginVuefrom'eslint-plugin-vue'
60
61
import {
61
62
defineConfig,
62
-
createConfigasvueTsEslintConfig,
63
+
configureVueProject,
64
+
recommended,
63
65
} from'@vue/eslint-config-typescript'
64
66
65
67
exportdefaultdefineConfig(
66
68
pluginVue.configs['flat/essential'],
67
69
68
-
vueTsEslintConfig({
69
-
// Optional: extend additional configurations from `typescript-eslint`.
// and only apply the loosened rules to the files that do need them.
111
100
rootDir:import.meta.dirname,
112
101
}),
102
+
103
+
recommended,
113
104
)
114
105
```
115
106
@@ -122,36 +113,17 @@ It is not always easy to set up the type-checking environment for ESLint without
122
113
So we don't recommend you to configure individual type-aware rules and the corresponding language options all by yourself.
123
114
Instead, you can start by extending from the `recommendedTypeChecked` configuration and then turn on/off the rules you need.
124
115
125
-
As of now, all the rules you need to turn on must appear _before_ calling `vueTsEslintConfig({ extends: ['recommendedTypeChecked'] })`, and all the rules you need to turn off must appear _after_ calling it.
0 commit comments