gpt4 book ai didi

javascript - ESLint 与 Babel plugin-proposal-export-default-from

转载 作者:行者123 更新时间:2023-12-01 01:11:02 29 4
gpt4 key购买 nike

我刚刚添加了 this babel 插件,以便利用从 'a/module' 导出 aDefault

效果很好,因为我可以从其他文件导入这样的导出,但 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

关于javascript - ESLint 与 Babel plugin-proposal-export-default-from,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55145990/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com