There is error in project:
[eslint] '@storybook/addon-actions' should be listed in the project's dependencies, not devDependencies. (import/no-extraneous-dependencies)
more about this rule. So, how to resolve this issue? I won't add @storybook/addon-actions
in dependencies, but how to fix this error?
You may want to add something like this to your eslint config:
rules: {
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: [
'.storybook/**',
'stories/**'
]
}
]
}
This will allow usage of devDependencies in the listed directories
@Hypnosphi Yeah, it's work fine, thank you very much
@Hypnosphi, you have a small typo in your comment above: error
should be 'error'
.
Years later, I copied your suggestion, with a small tweak for my project, and it worked perfectly - thank you! Including mine for anyone who would find it useful:
rules: {
// ...
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: [
'**/*.stories.tsx',
],
},
],
// ...
}
Most helpful comment
You may want to add something like this to your eslint config:
This will allow usage of devDependencies in the listed directories