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

feat(import): enforce no extensions for js files #92

Merged
merged 1 commit into from
Jul 18, 2018

Conversation

bobylito
Copy link
Contributor

@bobylito bobylito commented Jul 3, 2018

As reported by @samouss we lack consistency in projects for extensions when importing files. Some projects suffers more from it than others (eg. instantsearch.js).

This rules forces to remove the extensions when importing js files.

Those were valide before:

import lib from './lib.js';
import lib2 from './otherLib';

Now:

import lib from './lib.js'; // 🙅‍♂️
import lib2 from './otherLib'; //  ✅

Related to algolia/instantsearch#3022

@Haroenv
Copy link
Contributor

Haroenv commented Jul 3, 2018

I actually think we could go the other way (browsers require extensions)

@samouss
Copy link
Contributor

samouss commented Jul 3, 2018

I agree with your @Haroenv but it's a huge change to do in all our codebase. I doubt it's the right time to do it (it not fixable with --fix for now). At least with this rule we are consistent in all our lib. We can chose to switch this value later. WDYT?

@francoischalifour
Copy link
Member

I agree with you, @samouss.

@bobylito
Copy link
Contributor Author

bobylito commented Jul 3, 2018

Those rules are not set in stone and we can definitely review them after a while when the time is right.

In this case, I agree with @samouss that in-browser usage of modules is not at its prime-time and the impact is more containable.

@bobylito
Copy link
Contributor Author

This is stuck. Can we move forward @Haroenv ?

@Haroenv
Copy link
Contributor

Haroenv commented Jul 18, 2018

thought upvote was clear enough, fine for me

@bobylito
Copy link
Contributor Author

Thanks for the heads-up 😀

@bobylito bobylito merged commit b24e9b2 into master Jul 18, 2018
@samouss samouss deleted the feat/import-no-extensions-js branch August 6, 2018 07:44
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.

4 participants