-
Notifications
You must be signed in to change notification settings - Fork 4
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 import extension rule #292
Conversation
If the best practice is to enforce it, why not do it now? We can start with a warning and change to an error in a year or so. |
8c8df4a
to
2d212b8
Compare
Wanted to avoid breaking things by introducing too many changes, so as suggested we can go with a warning instead |
Signed-off-by: Christopher Ng <[email protected]>
2d212b8
to
6cbcfde
Compare
One more review here? not required in this repo though |
With this rule the line export { default as richEditor } from './richEditor' is now invalid and one needs to write export { default as richEditor } from './richEditor/index.js' Is this the desired behaviour? |
@raimund-schluessler yes, as with the broader ecosystem, e.g. Node.js 14 docs, all import paths should include the file extension with no special treatment of index.js files excluding package imports as specified by the |
@Pytal Thanks for the background information 👍 |
@raimund-schluessler fine with me as long as this goes in a major as this is breaking :) @skjnldsv fine with releasing this in the next major? |
Yep! 👍 😉 |
Can this be automated with eslint fix? I haven't tried 🤔 |
I run this rule in nextcloud-libraries/nextcloud-vue#2637 already. No fix is offered and |
So.... Who is going to do the release? 🙂 🙈 |
Feel free @raimund-schluessler https://github.com/nextcloud/eslint-config#release-new-version 🚀 |
Fine with me. But how is the changelog generated? |
sometimes manually, sometimes with |
As recommended in @nextcloud/[email protected] nextcloud-libraries/eslint-config#292 Signed-off-by: Max <[email protected]>
As recommended in @nextcloud/[email protected] nextcloud-libraries/eslint-config#292 Signed-off-by: Max <[email protected]>
As recommended in @nextcloud/[email protected] nextcloud-libraries/eslint-config#292 Signed-off-by: Max <[email protected]>
Warn when file extensions are not used on imports paths with the import/extensions rule, this is to stay up-to-date with the ecosystem e.g. Node.js 14 docs
In future we may want to set this to
error
Also see nextcloud-libraries/webpack-vue-config#297