From f87f9a234a05e0d6b893c611a4c663a6601aa388 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 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