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
+20
Original file line number
Diff line number
Diff line change
@@ -356,6 +356,26 @@ module.exports = {
356
356
}
357
357
```
358
358
359
+
#### Compiler macros such as `defineProps` and `defineEmits` are warned by `no-undef` rule
360
+
361
+
You need to define [global variables](https://eslint.org/docs/user-guide/configuring/language-options#using-configuration-files-1) in your ESLint configuration file.
362
+
If you don't want to define global variables, use `import { defineProps, defineEmits } from 'vue'`.
363
+
364
+
Example **.eslintrc.js**:
365
+
366
+
```js
367
+
module.exports= {
368
+
globals: {
369
+
defineProps:"readonly",
370
+
defineEmits:"readonly",
371
+
defineExpose:"readonly",
372
+
withDefaults:"readonly"
373
+
}
374
+
}
375
+
```
376
+
377
+
See also [ESLint - Specifying Globals > Using configuration files](https://eslint.org/docs/user-guide/configuring/language-options#using-configuration-files-1).
0 commit comments