Skip to content

Commit f87f9a2

Browse files
committed
update doc
1 parent 27fbad6 commit f87f9a2

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
@@ -356,6 +356,26 @@ module.exports = {
356356
}
357357
```
358358

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

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

0 commit comments

Comments
 (0)