Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why Eslint plugin for import order doesn't work in CRA?

I installed eslint-plugin-import-order and add it to eslintConfig in package.json.

Error I have:

Definition for rule 'import/order' was not found (import/order)

Please, help me to deal with it.

Sandbox: https://codesandbox.io/s/elegant-elbakyan-pilnc

like image 246
bigbabyweb Avatar asked Jan 01 '26 01:01

bigbabyweb


1 Answers

Note: eslint-plugin-import-order has been deprecated. Please use this https://github.com/benmosher/eslint-plugin-import

create a .eslintrc.json file and add the plugin like below.

{
  ....,
  "extends": ["eslint:recommended", "plugin:import/errors", "plugin:import/warnings"],

  "plugins": ["import"],
  
  .....
}

Restart your local server once to ensure the changes are reflected.

like image 62
Saurish Kar Avatar answered Jan 03 '26 14:01

Saurish Kar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!