diff --git a/docs/user-guide/README.md b/docs/user-guide/README.md index 238ff6f78..f6dc47456 100644 --- a/docs/user-guide/README.md +++ b/docs/user-guide/README.md @@ -356,6 +356,26 @@ module.exports = { } ``` +#### Compiler macros such as `defineProps` and `defineEmits` are warned by `no-undef` rule + +You need to define [global variables](https://eslint.org/docs/user-guide/configuring/language-options#using-configuration-files-1) in your ESLint configuration file. +If you don't want to define global variables, use `import { defineProps, defineEmits } from 'vue'`. + +Example **.eslintrc.js**: + +```js +module.exports = { + globals: { + defineProps: "readonly", + defineEmits: "readonly", + defineExpose: "readonly", + withDefaults: "readonly" + } +} +``` + +See also [ESLint - Specifying Globals > Using configuration files](https://eslint.org/docs/user-guide/configuring/language-options#using-configuration-files-1). + #### Parsing error with Top Level `await` ##### Using ESLint <= v7.x