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
+43-27
Original file line number
Diff line number
Diff line change
@@ -27,40 +27,51 @@ 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:
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).
The above configuration enables [the essential rules for Vue 3](https://eslint.vuejs.org/rules/#priority-a-essential-error-prevention) and [the recommended rules for TypeScript](https://typescript-eslint.io/rules/?=recommended).
44
52
45
-
All the `<script>` blocks in `.vue` files *MUST* be written in TypeScript (should be either `<script setup lang="ts">` or `<script lang="ts">`).
53
+
All the `<script>` blocks in `.vue` files _MUST_ be written in TypeScript (should be either `<script setup lang="ts">` or `<script lang="ts">`).
// By default, only the recommended rules are enabled.
63
-
"recommended",
74
+
'recommended',
64
75
// You can also manually enable the stylistic rules.
65
76
// "stylistic",
66
77
@@ -98,8 +109,8 @@ export default [
98
109
// Our config helper would resolve and parse all the `.vue` files under `rootDir`,
99
110
// and only apply the loosened rules to the files that do need them.
100
111
rootDir:import.meta.dirname,
101
-
})
102
-
]
112
+
}),
113
+
)
103
114
```
104
115
105
116
### Linting with Type Information
@@ -111,32 +122,37 @@ It is not always easy to set up the type-checking environment for ESLint without
111
122
So we don't recommend you to configure individual type-aware rules and the corresponding language options all by yourself.
112
123
Instead, you can start by extending from the `recommendedTypeChecked` configuration and then turn on/off the rules you need.
113
124
114
-
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.
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