import-js/eslint-plugin-import
在 GitHub 查看Support for named import pattern in import/named
Open
#1,583 创建于 2019年12月26日
bughelp wanted
描述
Given:
// ./foo.js
export const foo = "I'm so foo"
The following Es6 syntax is considered invalid:
// ./bar.js
import { foo as bar } from './foo'
Error:
ESLint: foo not found in './foo'(import/named)
However, the following is considered valid
// ./bar.js
import * as bar from './foo'
is it done intentionally? And if so, do we have an option to disable errors?
My configuration:
{
"env": {
"browser": true,
"jest": true
},
"parserOptions": {
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"extends": [
"airbnb",
"plugin:prettier/recommended"
],
"plugins": [
"react"
],
"rules": {
"class-methods-use-this": 0,
"import/no-named-as-default": 0,
"react/jsx-filename-extension": [
"error",
{
"extensions": [
".js",
".jsx"
]
}
]
}
}
Eslint version: v6.8.0