From 7b7c525094a679e00c2116f32bd067b47059912b Mon Sep 17 00:00:00 2001 From: yosuke ota Date: Tue, 6 Jul 2021 00:27:05 +0900 Subject: [PATCH] update doc --- docs/user-guide/README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/docs/user-guide/README.md b/docs/user-guide/README.md index 90c7cdd60..cc8373d35 100644 --- a/docs/user-guide/README.md +++ b/docs/user-guide/README.md @@ -354,6 +354,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