question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

29reactions
josh18commented, Apr 19, 2020

👍 Can confirm it does work. Thanks!

'sort-imports': ['error', {
    'ignoreDeclarationSort': true,
}],
1reaction
teppeiscommented, Feb 11, 2021
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found