You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/user-guide/README.md
+4-10Lines changed: 4 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -358,26 +358,20 @@ module.exports = {
358
358
}
359
359
```
360
360
361
-
#### Compiler macros such as `defineProps` and `defineEmits`are warned by `no-undef`rule
361
+
#### Compiler macros such as `defineProps` and `defineEmits`generate `no-undef`warnings
362
362
363
-
You need to define [global variables](https://eslint.org/docs/user-guide/configuring/language-options#using-configuration-files-1) in your ESLint configuration file.
364
-
If you don't want to define global variables, use `import { defineProps, defineEmits } from 'vue'`.
363
+
You need to enable the compiler macros environment in your ESLint configuration file.
365
364
366
365
Example **.eslintrc.js**:
367
366
368
367
```js
369
368
module.exports= {
370
-
globals: {
371
-
defineProps:"readonly",
372
-
defineEmits:"readonly",
373
-
defineExpose:"readonly",
374
-
withDefaults:"readonly"
369
+
env: {
370
+
'vue/setup-compiler-macros':true
375
371
}
376
372
}
377
373
```
378
374
379
-
See also [ESLint - Specifying Globals > Using configuration files](https://eslint.org/docs/user-guide/configuring/language-options#using-configuration-files-1).
0 commit comments