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
Please describe what the rule should do:
It should warn if defineProps, defineEmits and similar are imported from vue (autofixable)
What category should the rule belong to?
[x] Enforces code style (layout)
[ ] Warns about a potential error (problem)
[ ] Suggests an alternate way of doing something (suggestion)
[ ] Other (please specify:)
Provide 2-3 code examples that this rule should warn about:
Additional context
Useful when define* are added to eslint globals, there's no need to import them manually. If project was using imports and then dev switched to globals then autofix would just automatically remove unnecessary imports
The text was updated successfully, but these errors were encountered:
'no-restricted-imports': ['error',{patterns: [{group: ['@vue/*','vue'],importNames: ['defineProps','defineEmits'],message: "'defineProps' and 'defineEmits' can be used within <script setup> without importing.",},],},]
Also, we now have the vue/prefer-import-from-vue rule, which would also warn about the import. So I think the rule suggested in this issue is not required anymore.
Please describe what the rule should do:
It should warn if defineProps, defineEmits and similar are imported from vue (autofixable)
What category should the rule belong to?
[x] Enforces code style (layout)
[ ] Warns about a potential error (problem)
[ ] Suggests an alternate way of doing something (suggestion)
[ ] Other (please specify:)
Provide 2-3 code examples that this rule should warn about:
bad:
good:
good:
Additional context
Useful when
define*
are added to eslint globals, there's no need to import them manually. If project was using imports and then dev switched to globals then autofix would just automatically remove unnecessary importsThe text was updated successfully, but these errors were encountered: