[英]Missing file extension "tsx" for "./reducer" error after using eslint-config-airbnb
I am using eslint and prettier code formatters for my project.我正在为我的项目使用 eslint 和更漂亮的代码格式化程序。 After using airbnb I am getting errors like
使用 airbnb 后,我收到类似的错误
reducer has index.tsx and so does saga folder. reducer 有 index.tsx,saga 文件夹也有。 I have tried import/extensions: [".js", ".jsx", ".tsx"] in my.eslintrc.yml file but still getting the error.
我在 my.eslintrc.yml 文件中尝试了 import/extensions: [".js", ".jsx", ".tsx"] 但仍然出现错误。
eslint-config-airbnb
has this rule enabled: eslint-config-airbnb
启用了这条规则:
'import/extensions': ['error', 'ignorePackages', {
js: 'never',
mjs: 'never',
jsx: 'never',
}],
If want to turn it off, you could override it in your own eslint config file like so:如果想关闭它,你可以像这样在你自己的 eslint 配置文件中覆盖它:
'import/extensions': 'off'
More information on how you could configure this specific rule can be found here有关如何配置此特定规则的更多信息,请参见此处
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.