import-js/eslint-plugin-import
View on GitHubv2.20.2 import/order triggered only after adding newline
Open
#1,711 opened on Mar 31, 2020
bughelp wantedimport/export ordering
Description
OS: Ubuntu 18 Node: 12.16.1 Eslint: 6.8.0 (bundled with CRA) Eslint-plugin-import: 2.20.2 (bundled with CRA) Eslint-config-create-react-app: 5.2.1 (bundled with CRA, source)
Steps to reproduce
- Install create-react-app
- Add import/order rule with groups via EXTEND_ESLINT
- Run it - no errors occured
- Add newline before
function App() {(2 newline between import and function now) - Save - now error occured
./src/App.js
Line 4:1: `./logo.svg` import should occur before import of `react` import/order
Search for the keywords to learn more about each error.
Or
- Checkout https://github.com/koutsenko/sort-imports
- Run it - it will print error
- Remove one of two newlines between import and function statements
- Import error will gone.
Question: why import rules are triggered by adding newline?