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

Update: Add sort-imports ignoreDeclarationSort (fixes #11019) #11040

Merged
merged 2 commits into from Jan 4, 2019

Conversation

remcohaszing
Copy link
Contributor

@remcohaszing remcohaszing commented Oct 30, 2018

This allows users to enforce sorting import members, without having to enforce
sorting of import declarations.

fixes #11019

This allows users to enforce sorting import members, without having to enforce
sorting of import declarations.
@eslint-deprecated eslint-deprecated bot added the triage An ESLint team member will look at this issue soon label Oct 30, 2018
@not-an-aardvark not-an-aardvark added enhancement This change enhances an existing feature of ESLint rule Relates to ESLint's core rules evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion and removed triage An ESLint team member will look at this issue soon labels Dec 8, 2018
@nzakas nzakas added accepted There is consensus among the team that this change meets the criteria for inclusion and removed evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion labels Dec 20, 2018
Copy link
Member

@nzakas nzakas left a comment

Choose a reason for hiding this comment

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

LGTM. We do need a couple other reviews in order to merge.

Copy link
Member

@platinumazure platinumazure left a comment

Choose a reason for hiding this comment

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

Requested some small documentation changes, but the code and tests look good to me. Thanks!

docs/rules/sort-imports.md Outdated Show resolved Hide resolved
docs/rules/sort-imports.md Outdated Show resolved Hide resolved
@@ -136,6 +138,34 @@ import c from 'baz.js';

Default is `false`.

### `ignoreDeclarationSort`

Ignores the sorting of import declaration statements.
Copy link
Member

Choose a reason for hiding this comment

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

Please add a note that the default is false here. (I see the note below, but I think it's important enough to be included in the intro/summary of the section.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I decided to keep it at the end for consistency with the other sections.

Please let me know if this really needs to be changed.

Copy link
Member

@platinumazure platinumazure left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for explaining the rationale. I don't like the location of that info still but it can be fixed in a separate PR. I have no objections to this landing as is. Thanks!

Copy link
Member

@not-an-aardvark not-an-aardvark left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

Copy link
Member

@btmills btmills left a comment

Choose a reason for hiding this comment

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

LGTM, thank you!

@btmills btmills merged commit 0d91e7d into eslint:master Jan 4, 2019
```js
/*eslint sort-imports: ["error", { "ignoreDeclarationSort": false }]*/
import 'foo.js'
import 'bar.js'
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for pointing this out. I fixed it in #11242.

@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Jul 4, 2019
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Jul 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion enhancement This change enhances an existing feature of ESLint rule Relates to ESLint's core rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add sort-imports member sorting into a separate option
6 participants