When compiling my ReactJs code I get the following error import/first error:
The solutions presented in similar questions don't seem to work for me.
The ../recharts/es6/index.js
file looks something like this:
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 };
My question, therefore, how does one disable the import/first rule for ESLint? Or might the error be due to something else entirely?
I just resolved this error in one of my auto generated files. In my .ts
source file the import rule (any and all imports must be at the top of the file) was followed but the generated .js
had imports after some polyfills so I added this line to the top of my file to get around it:/* eslint-disable import/first */
*note: the comments have already mentioned this solution. just adding this so the question can have an answer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With