我刚刚添加了此Babel插件,以便使用该export aDefault from 'a/module'
。
效果很好,因为我可以从其他文件中导入这样的导出,但是Eslint并没有避开我。它突出了我的导出声明无情。
我们是否有一个Eslint插件,或者我应该如何处理?我的.eslintrc.yaml
当前扩展了standard
。
好吧,我已经用尽了选择;包括将babel-eslint
作为eslintrc.json
文件中的解析器。
如果有人在这里遇到类似问题的地方,我决定以某些混叠来调整标准规范,而忘记了babel语法;
// index.js
export { default as PreferredName, aNamedExport } from 'a/module';
export { default as AnotherPreferredName, anotherNamedExport } from 'another/module';
// or export all the named exports from another/module.js
export * from 'another/module'; // this won't export the default. It will also throw an error if anotherNamedExport has already been exported from another/module.js as above
.eslintrc
"comma-dangle": [
"error",
{
"exports": "never",
"imports": "never"
}
]