Add sort rule for named imports
See original GitHub issue❌
import {b, a, c} from 'foo.js';
✔️
import {a, b, c} from 'foo.js';
Not sure if this should be a new rule or an option under import/order
. Both tslint and eslint have a option for this in their import order rules.
I can attempt to make a PR if we think this is a good idea.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Add sort rule for named imports · Issue #1732 - GitHub
@ljharb I think that might be a different issue. That issue seems to be about the order of import line based on import...
Read more >sort-imports - ESLint - Pluggable JavaScript Linter
This rule checks all import declarations and verifies that all imports are first sorted by the used member syntax and then alphabetically by...
Read more >Sorting your imports with ESLint - DEV Community
The named imports should be sorted in alphabetical order; It should skip a line before relative imports that are in other folders; It...
Read more >Rule: ordered-imports - Palantir Open Source
Requires that import statements be alphabetized and grouped. The exact ordering can be controlled by the named-imports-order option. “longName as name” imports ......
Read more >ESLint sort imports by package name - Stack Overflow
You can use a different sorting rule like the one here. https://www.npmjs.com/package/eslint-plugin-simple-import-sort.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
👍 Can confirm it does work. Thanks!
duplicate of https://github.com/benmosher/eslint-plugin-import/issues/163