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

Require newlines inbetween import groups #2

Closed
wants to merge 1 commit into from

Conversation

giodamelio
Copy link
Contributor

@giodamelio giodamelio commented Oct 15, 2016

First off I wanted to say thanks for making this config. We agree on almost everything style wise, which I have not found in any other config preset. I am not sure what your process is for adding new rules, so I figured I would just send a pull.

It is just one simple change, but I have always liked keeping my import types separate.

Also, I wasn't sure what the scope in the commit message should be, I can change it if need be.

@giodamelio
Copy link
Contributor Author

Oops, forgot to run the tests. I love how your linter lints itself. 😄 I will push a fix.

@scottnonnenberg
Copy link
Owner

Hey there! Glad you're finding this project useful! :0)

I just tested it on my current import-using project, and I didn't like that it wanted me to get rid of the line breaks for this code:

import stats from 'simple-statistics';

import forEach from 'lodash/forEach';
import map from 'lodash/map';

import flow from 'lodash/fp/flow';
import sortBy from 'lodash/fp/sortBy';
import groupBy from 'lodash/fp/groupBy';
import transform from 'lodash/fp/transform';

Yes, I understand that they're all the 'node modules' category, but they are organized conceptually! If the rule allowed me to put a newline wherever I wanted, but would force me to separate the various categories of imports, I'd be okay with it. :0(

@giodamelio
Copy link
Contributor Author

Hmm, that does seem nicer. It looks like the import/order does not allow configuring of newlines inside import groups.

If set to always, at least one new line between each group will be enforced, and new lines inside a group will be forbidden.

I just made an issue at import-js/eslint-plugin-import#627, hopefully I will be ok'd to contribute a new setting to eslint-plugin-import that will take care of this.

@scottnonnenberg
Copy link
Owner

Great to see the progress on import-js/eslint-plugin-import#627 - I'm excited. :0)

@giodamelio
Copy link
Contributor Author

Hopefully I can get it accepted soon.

@giodamelio
Copy link
Contributor Author

Closing this because I accidentally created it from my forks master branch which is making it difficult to make other pull requests. I will make another pull when import-js/eslint-plugin-import#628 lands.

@giodamelio giodamelio closed this Jan 19, 2017
@scottnonnenberg
Copy link
Owner

Sounds good.

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.

2 participants