相关疑难解决方法(0)

Create-React-App无法编译| 导入/第一个错误

我目前正在为我的个人网站使用Create-React-App.每次运行时我都会遇到以下错误:

./src/~/react-router-dom/es/index.js
 Line 3:   Import in body of module; reorder to top  import/first
 Line 5:   Import in body of module; reorder to top  import/first
 Line 7:   Import in body of module; reorder to top  import/first
 Line 9:   Import in body of module; reorder to top  import/first
 Line 11:  Import in body of module; reorder to top  import/first
 Line 13:  Import in body of module; reorder to top  import/first
 Line 15:  Import in body of module; reorder to top  import/first
 Line …
Run Code Online (Sandbox Code Playgroud)

import importerror reactjs create-react-app react-router-dom

8
推荐指数
3
解决办法
1万
查看次数

“在模块主体中导入;重新排序到顶部导入/首先”ESLint (ReactJs)

编译我的 ReactJs 代码时,出现以下错误导入/第一个错误:

在此处输入图片说明

类似问题中提出的解决方案似乎对我不起作用。

../recharts/es6/index.js文件如下所示:

import _Brush from './cartesian/Brush';
export { _Brush as Brush };
import _ReferenceLine from './cartesian/ReferenceLine';
export { _ReferenceLine as ReferenceLine };
import _ReferenceDot from './cartesian/ReferenceDot';
export { _ReferenceDot as ReferenceDot };
import _ReferenceArea from './cartesian/ReferenceArea';
export { _ReferenceArea as ReferenceArea };
Run Code Online (Sandbox Code Playgroud)

因此,我的问题是,如何禁用 ESLint 的导入/第一规则?或者错误可能完全是由于其他原因造成的?

javascript reactjs eslint

5
推荐指数
1
解决办法
5186
查看次数