diff --git a/docs/user-guide/README.md b/docs/user-guide/README.md index b083a6bd3..ddb36d896 100644 --- a/docs/user-guide/README.md +++ b/docs/user-guide/README.md @@ -358,10 +358,10 @@ module.exports = { } ``` -#### Compiler macros such as `defineProps` and `defineEmits` generate `no-undef` warnings +#### Compiler macros such as `defineProps` and `$ref` generate `no-undef` warnings You need to enable the compiler macros environment in your ESLint configuration file. -If you don't want to expose these variables globally, you can use `/* global defineProps, defineEmits */` instead. +If you don't want to expose these variables globally, you can use `/* global defineProps, $ref */` instead. Example **.eslintrc.js**: diff --git a/lib/index.js b/lib/index.js index 941de0b56..34d675708 100644 --- a/lib/index.js +++ b/lib/index.js @@ -233,9 +233,16 @@ module.exports = { environments: { 'setup-compiler-macros': { globals: { - defineProps: 'readonly', + $$: 'readonly', + $: 'readonly', + $computed: 'readonly', + $customRef: 'readonly', + $ref: 'readonly', + $shallowRef: 'readonly', + $toRef: 'readonly', defineEmits: 'readonly', defineExpose: 'readonly', + defineProps: 'readonly', withDefaults: 'readonly' } } diff --git a/tools/update-lib-index.js b/tools/update-lib-index.js index b9a5dcbd9..251d5c172 100644 --- a/tools/update-lib-index.js +++ b/tools/update-lib-index.js @@ -41,9 +41,16 @@ module.exports = { environments: { 'setup-compiler-macros': { globals: { - defineProps: 'readonly', + $$: 'readonly', + $: 'readonly', + $computed: 'readonly', + $customRef: 'readonly', + $ref: 'readonly', + $shallowRef: 'readonly', + $toRef: 'readonly', defineEmits: 'readonly', defineExpose: 'readonly', + defineProps: 'readonly', withDefaults: 'readonly' } }