eslint reports a no-undef error when defineProps is not explicitly imported, even though compiler-sfc warns against importing it.
Version
3.2.6
Reproduction link
Steps to reproduce
Method 1:
- Clone repo
- Run
npm run serve
Method 2
- Create new Vue 3 project using
vue create project_name
- Modify HelloWorld component to use
<script setup>
, and usedefineProps
without importing it.
What is expected?
defineProps
is a compiler macro and should not be reported by eslint as an undefined variable.
What is actually happening?
The following error is issued.
/home/chrisshroba/dev/projects/eslint-issue/src/components/HelloWorld.vue
34:1 error 'defineProps' is not defined no-undef
✖ 1 problem (1 error, 0 warnings)
I could import defineProps
, but then I sometimes get a warning against importing it, which is defined here in the Vue source.