import-js/eslint-plugin-import
v2.20.2 import/order triggered only after adding newline
开放
#1,711 创建于 2020年3月31日
bughelp wantedimport/export ordering
仓库指标
- 星标
- (5,938 个星标)
- PR 合并指标
- (平均合并 138天 22小时) (30 天内合并 3 个 PR)
描述
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?