[英]Definition for rule '@typescript-eslint/no-implicit-any' was not found with Storybook js
I am getting this error when I make changes to the generated code from running Storybook.js
.当我通过运行
Storybook.js
更改生成的代码时出现此错误。 These are the instructions I am following这些是我遵循的说明
https://gist.github.com/shilman/bc9cbedb2a7efb5ec6710337cbd20c0c https://gist.github.com/shilman/bc9cbedb2a7efb5ec6710337cbd20c0c
But because I am adding StorybookJS
to an existing project, the only commands I've ran are:但是因为我将
StorybookJS
添加到现有项目中,所以我运行的唯一命令是:
$ npx -p @storybook/cli@next sb init --story-format=csf-ts
$ yarn add @storybook/addon-docs@next --dev
Running yarn storybook
produces this error.运行
yarn storybook
会产生此错误。
ERROR in ./src/stories/0-Welcome.stories.tsx
Module Error (from ./node_modules/eslint-loader/dist/cjs.js):
Line 5:1: Definition for rule '@typescript-eslint/no-implicit-any' was not found @typescript-eslint/no-implicit-any
Line 24:1: Definition for rule '@typescript-eslint/no-implicit-any' was not found @typescript-eslint/no-implicit-any
The storybook server runs fine but as soon as I make changes to some text and Storybook
tries to reload the changes, I get the error seen above. Storybook
服务器运行良好,但是一旦我对某些文本进行更改并且Storybook
尝试重新加载更改,我就会收到上面看到的错误。
There is a lot of magic that happens behind the scenes of create-react-app
so I am unaware of how to pinpoint and fix this error. create-react-app
的幕后发生了很多魔法,所以我不知道如何查明和修复这个错误。 My guess is that a eslint typescript rule
is missing so upon Storybook
reloading any type of change, the missing rule error occurs我的猜测是缺少
eslint typescript rule
,因此在Storybook
重新加载任何类型的更改时,会发生缺少规则的错误
It sounds like you're missing the .eslintrc.json
file which describes the rules.听起来您缺少描述规则的
.eslintrc.json
文件。 You can read more about the file format and options here: https://eslint.org/docs/user-guide/configuring您可以在此处阅读有关文件格式和选项的更多信息: https : //eslint.org/docs/user-guide/configuring
Example:例子:
{
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"rules": {
"semi": "error"
}
}
If the error still occurs, try configuring the no-implicit-any
rule.如果错误仍然出现,请尝试配置
no-implicit-any
规则。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.