[英]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
.我安装了
eslint-plugin-import-order
并将其添加到eslintConfig
的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沙盒: https://codesandbox.io/s/elegant-elbakyan-pilnc
Note: eslint-plugin-import-order
has been deprecated.注意:
eslint-plugin-import-order
已被弃用。 Please use this https://github.com/benmosher/eslint-plugin-import请使用这个https://github.com/benmosher/eslint-plugin-import
create a .eslintrc.json
file and add the plugin like below.创建一个
.eslintrc.json
文件并添加如下插件。
{
....,
"extends": ["eslint:recommended", "plugin:import/errors", "plugin:import/warnings"],
"plugins": ["import"],
.....
}
Restart your local server once to ensure the changes are reflected.重新启动一次本地服务器以确保反映更改。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.