规则“import/no-unresolved”的 generated-stories-entry.js 错误
我已使用 vue add Storybook
将故事书添加到我的 Vue 项目中。
这为我的项目添加了几个依赖项,例如在我的 package.json
中,我发现了以下内容:
"vue": "~2.6.14",
"@storybook/vue": "6.4.19",
"vue-cli-plugin-storybook": "~2.1.0",
"eslint": "~6.8.0",
现在我尝试使用 npm runstorybook:serve
运行故事书服务器但我收到错误:
我一直在尝试不同的事情,例如将 'import/no-unresolved' 规则配置为关闭,eslist-loader< 上的
emitError: false
/code> 在 .eslintrc
中,跳过 webpack 配置中的 linter 插件等。没有任何效果,每次尝试都会产生新的错误。
目前我根本没有显式的 es-linter 或 webpack 配置。 但是如果我在 node_modules/eslint-loader/index.js
中注释一行,如下所示:
//emitter(new ESLintError(messages));
然后一切正常。
我不想注释掉库内的行,我希望有一个适当的解决方案并了解正在发生的情况。
I have added storybook to my Vue project with vue add storybook
.
This has added several dependencies to my project, e.g. in my package.json
I find this among others:
"vue": "~2.6.14",
"@storybook/vue": "6.4.19",
"vue-cli-plugin-storybook": "~2.1.0",
"eslint": "~6.8.0",
Now I am trying to run the storybook server with npm run storybook:serve
but I get an error:
I have been trying different things, like configuring the 'import/no-unresolved' rule to be off, emitError: false
on the eslist-loader
inside .eslintrc
, skipping the linter plugin in the webpack configuration, etc. Nothing worked and each attempt just produced new errors.
Currently I have no explicit es-linter
nor webpack
configuration at all. But if I comment a line inside node_modules/eslint-loader/index.js
like this:
// emitter(new ESLintError(messages));
then it all works.
I don't want to be commenting out lines inside a library, I would like to have a proper solution and understand what is happening.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我自己找到了答案。我必须添加 eslint-plugin-import 包:
并将插件添加到 eslint 配置中:
I found the answer myself. I had to add the
eslint-plugin-import
package:And add the plugin to the
eslint
configuration:对我来说,建议的答案不起作用,最终解决的方法是忽略 eslint 配置中的这些文件:
For me the suggested answer didn’t work, what fix it in the end was to ignore those files in eslint configuration: