Skip to content

Commit 7b7c525

Browse files
committed
update doc
1 parent 27677ad commit 7b7c525

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

docs/user-guide/README.md

+20
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,26 @@ module.exports = {
354354
}
355355
```
356356

357+
#### Compiler macros such as `defineProps` and `defineEmits` are warned by `no-undef` rule
358+
359+
You need to define [global variables](https://eslint.org/docs/user-guide/configuring/language-options#using-configuration-files-1) in your ESLint configuration file.
360+
If you don't want to define global variables, use `import { defineProps, defineEmits } from 'vue'`.
361+
362+
Example **.eslintrc.js**:
363+
364+
```js
365+
module.exports = {
366+
globals: {
367+
defineProps: "readonly",
368+
defineEmits: "readonly",
369+
defineExpose: "readonly",
370+
withDefaults: "readonly"
371+
}
372+
}
373+
```
374+
375+
See also [ESLint - Specifying Globals > Using configuration files](https://eslint.org/docs/user-guide/configuring/language-options#using-configuration-files-1).
376+
357377
#### Parsing error with Top Level `await`
358378

359379
##### Using ESLint <= v7.x

0 commit comments

Comments
 (0)