[英]ESLint with Babel plugin-proposal-export-default-from
I just added this babel plugin in order to make use of that export aDefault from 'a/module'
.我刚刚添加了这个babel 插件,以便使用
export aDefault from 'a/module'
。
Works well as I can import such an export from other files but eslint isn't sparing me.效果很好,因为我可以从其他文件导入这样的导出,但 eslint 并没有放过我。 It highlights my export statement ruthlessly.
它无情地突出了我的出口声明。
Do we have an eslint plugin for that, or how should I go about it?我们是否有一个 eslint 插件,或者我应该怎么做? My
.eslintrc.yaml
currently extends standard
.我的
.eslintrc.yaml
目前扩展了standard
.
Well, I have exhausted my options;好吧,我已经用尽了我的选择; including having
babel-eslint
as the parser in the eslintrc.json
file.包括将
babel-eslint
作为eslintrc.json
文件中的解析器。
In case anyone lands here with a similar issue, I decided to adapt the standard specification, with some aliasing, and forget about the babel syntax;如果有人遇到类似的问题,我决定调整标准规范,使用一些别名,并忘记 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 .eslintrc
"comma-dangle": [
"error",
{
"exports": "never",
"imports": "never"
}
]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.