Error
The exported identifier "undefined" is not declared in Babel's scope tracker
as a JavaScript value binding, and "@babel/plugin-transform-typescript"
never encountered it as a TypeScript type declaration.
It will be treated as a JavaScript value.
This problem is likely caused by another plugin injecting
"undefined" without registering it in the scope tracker. If you are the author
of that plugin, please use "scope.registerDeclaration(declarationPath)".
分析
代码中使用了不合适的语法导致的:
export default undefined;
为什么会出现这样的代码?
不想通过eslint将这个提示关掉,所以用了这个方法。
解决办法:
- 单行注释,避免eslint检查
- 关闭全局eslint检测