Unclear warning about "sort-imports" rule when mixing single and multiple imports in a single line
See original GitHub issueThe 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:
- Created 8 years ago
- Comments:8 (6 by maintainers)
Top 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 >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
Correct.
import {Component}, React from 'react';
is not valid syntax and doesn’t work.That is not valid syntax.
Gives
Unexpected token
from Babel. ESLint throws fatal error,Parsing error: Unexpected token
.