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.

Unclear warning about "sort-imports" rule when mixing single and multiple imports in a single line

See original GitHub issue

The following code:

import React, {Component} from 'react';

Returns the following error: Member 'Component' of the import declaration should be sorted alphabetically

There appears to be no way to control the case where you’re importing a default as well as multiple parts of a module.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
EvHauscommented, Feb 16, 2016

Correct. import {Component}, React from 'react'; is not valid syntax and doesn’t work.

1reaction
wyzecommented, Feb 16, 2016

That is not valid syntax.

Gives Unexpected token from Babel. ESLint throws fatal error, Parsing error: Unexpected token.

Read more comments on GitHub >

github_iconTop Results From Across the Web

eslint sort-imports mixing single and multiple - Stack Overflow
All linting seems to work as I want, apart from the sort-imports rule. It seems to be allowing the mixing of single and...
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 >
Changelog - isort
Fixed #1525: Some warnings can't be disabled with --quiet. Fixed #1523: in rare cases isort can ignore direct from import if as import...
Read more >
Import-Module (Microsoft.PowerShell.Core)
The Import-Module cmdlet adds one or more modules to the current session. Starting in PowerShell 3.0, installed modules are automatically imported to the ......
Read more >
tslint-eslint-rules - npm Package Health Analysis | Snyk
Learn more about tslint-eslint-rules: package health score, popularity, security, ... block-spacing, disallow or enforce spaces inside of single line blocks.
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