question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:7
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

86reactions
Hypnosphicommented, Mar 25, 2020

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

35reactions
jhochcommented, Mar 25, 2020

@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',
      ],
    },
  ],

  // ...
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Rules - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >
Newest 'eslint' Questions - Stack Overflow
How to understand the weights from a survey design object in R? ... Why are wire transfers not reversible by the bank? ......
Read more >
ESLint | IntelliJ IDEA Documentation - JetBrains
question on top of the file. IntelliJ IDEA suggests importing the code style from ESLint. The list of applied rules is shown in...
Read more >
ESLint: Everything You need to know about setting up a style ...
If you are using create-react-app no need to download ESLint rather and ... it is asking these question because, in the end, ESLint...
Read more >
Issues · eslint/eslint - GitHub
Bug: (fill in) ESLint couldn't find the plugin "eslint-plugin-prettier". question This issue asks a question about ESLint. #16694 opened 15 hours ago by...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found