我刚刚添加了这个babel 插件,以便使用它export aDefault from 'a/module'
。
效果很好,因为我可以从其他文件导入这样的导出,但 eslint 并没有放过我。它无情地突出了我的出口声明。
我们是否有一个 eslint 插件,或者我应该怎么做?我.eslintrc.yaml
目前的扩展standard
。
我刚刚添加了这个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"
}
]