sort-imports emits false positives for named imports with spaces in braces.
phyllisstein opened this issue · 0 comments
phyllisstein commented
I was taking the sort-imports
rule for a spin with the following configuration:
rules:
sort-imports:
severity: error
options:
- ignore-case
...and noticed that although it attempts to order imports by their names (a welcome relief from whatever the heck TSLint thinks it's doing with their paths), it throws a false positive for named imports with spaces in their braces. For example, this code:
import createTheme from 'spectacle/lib/themes/default'
import { hot } from 'react-hot-loader'
import React from 'react'
...emits this error:
ERROR: presentation.tsx[2, 1]: All imports of the same type must be sorted alphabetically. " hot " must come before "createTheme"
As the error indicates, the spaces are being included when linting the node. Removing them resolves the issue.
Please let me know if I can provide any more color, and thanks in advance for taking a look!