Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add vue/prefer-import-from-vue rule #1804

Merged
merged 1 commit into from Feb 22, 2022
Merged

Conversation

ota-meshi
Copy link
Member

This PR adds vue/prefer-import-from-vue rule.
This rule aims to use imports from 'vue' instead of imports from '@vue/*'.

close #1780
close #1792

Copy link
Member

@FloEdelmann FloEdelmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! :)
Is there any good way to add tests for the update script?

@ota-meshi
Copy link
Member Author

Thank you for your review!

Is there any good way to add tests for the update script?

I don't know another way to get Vue3's export name list, so I find it difficult to add a test 😅

@FloEdelmann
Copy link
Member

I thought of using mock data, i.e. testing that the right kinds of exports are found. But maybe that is too complicated and/or not worth it?

@ota-meshi
Copy link
Member Author

Hmm. I don't think we can get the correct names by using mock because the type definition information is not exported in the actual JavaScript.
It may be possible to test for less than the names exported by JS, but it may not be worth it.

@FloEdelmann
Copy link
Member

Then let's merge this now, and see if this causes any bugs in the future. We can still try to add regression tests then.

@ota-meshi ota-meshi merged commit 1bb4edd into master Feb 22, 2022
@ota-meshi ota-meshi deleted the prefer-import-from-vue branch February 22, 2022 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rule Proposal: disallow imports from @vue/* dependencies
2 participants