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 rule (vue-strong): Component in separate files #22

Closed
Tracked by #18
rrd108 opened this issue Jun 6, 2024 · 8 comments
Closed
Tracked by #18

add rule (vue-strong): Component in separate files #22

rrd108 opened this issue Jun 6, 2024 · 8 comments
Labels
enhancement New feature or request

Comments

@rrd108
Copy link
Owner

rrd108 commented Jun 6, 2024

https://vuejs.org/style-guide/rules-strongly-recommended.html#component-files

@rrd108 rrd108 mentioned this issue Jun 6, 2024
15 tasks
@rrd108 rrd108 changed the title Component files add rule (vue-strong): Component files Jun 6, 2024
@rrd108 rrd108 added the enhancement New feature or request label Jun 8, 2024
@rrd108 rrd108 changed the title add rule (vue-strong): Component files add rule (vue-strong): Component in separate files Jun 8, 2024
@David-Pena
Copy link
Collaborator

Would this rule be just to check for the pattern .component('...', { ... } inside the file right? Or am I missing something?

@rrd108
Copy link
Owner Author

rrd108 commented Jul 18, 2024

Yes, that would be the easiest approach. Perhaps all vue files should be checked.

@David-Pena
Copy link
Collaborator

Wouldnt the check apply to all files in the given path? or this pattern should just be check in the entry-point file where you can register components globally?

@rrd108
Copy link
Owner Author

rrd108 commented Jul 18, 2024

People can do weird things. So I would suggest check all files.

However checking only main.js/ts will be much quicker. But even in a big project it will save less then a second.

What do you think?

@David-Pena
Copy link
Collaborator

I think checking all files in the given path would be better to avoid missing some really weird component registration (I haven't seen one but there must exists somewhere haha)

However, I'm wondering how you get to that less than a second estimate? If it's that way then I agree it won't be noticeable for the end user

@rrd108
Copy link
Owner Author

rrd108 commented Jul 18, 2024

However, I'm wondering how you get to that less than a second estimate? If it's that way then I agree it won't be noticeable for the end user

All our current checks go throught all the files again and again.
I have a middle size project and still it runs quickly.

@David-Pena
Copy link
Collaborator

Got it! Then I support the "check all Vue files" approach for this rule 🤚🏻

@David-Pena
Copy link
Collaborator

Hi @rrd108 I created a PR for this issue #68

@rrd108 rrd108 closed this as completed in cd0098a Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants