Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some dependencies are extraneous #92

Closed
EvgenyOrekhov opened this issue Dec 15, 2021 · 3 comments
Closed

Some dependencies are extraneous #92

EvgenyOrekhov opened this issue Dec 15, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@EvgenyOrekhov
Copy link

For example, the try-catch is used here:

const tryCatch = require('try-catch');

but it's declared in devDependencies, not dependencies:

"devDependencies": {
"@cloudcmd/stub": "^3.0.0",
"acorn": "^8.1.1",
"acorn-jsx": "^5.0.2",
"acorn-stage3": "^4.0.0",
"c8": "^7.5.0",
"eslint": "^8.0.1",
"eslint-plugin-node": "^11.0.0",
"eslint-plugin-putout": "^12.0.0",
"espree": "^9.0.0",
"esprima": "^4.0.1",
"just-camel-case": "^4.0.2",
"lerna": "^4.0.0",
"madrun": "^8.0.1",
"montag": "^1.0.0",
"nodemon": "^2.0.1",
"putout": "*",
"supertape": "^6.0.0",
"tenko": "^2.0.0",
"try-catch": "^3.0.0"
},

And if you use Yarn v3, it will give you the following error:

Error: Failed to load plugin 'putout' declared in '.eslintrc.json » eslint-config-hardcore » ./base.json': @putout/engine-parser tried to access try-catch, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.

Required package: try-catch
Required by: @putout/engine-parser@npm:4.9.0 (via /Users/evgeny/Downloads/next-ts/.yarn/cache/@putout-engine-parser-npm-4.9.0-40929d5a11-78a1d5c5c8.zip/node_modules/@putout/engine-parser/lib/)

Require stack:
- /Users/evgeny/Downloads/next-ts/.yarn/cache/@putout-engine-parser-npm-4.9.0-40929d5a11-78a1d5c5c8.zip/node_modules/@putout/engine-parser/lib/second-chance.js

The solution for this particular case is to move try-catch from devDependencies to dependencies.
But I suspect there might be similar problems in other Putout packages, so I would highly recommend enabling the import/no-extraneous-dependencies rule and checking all Putout packages.

Original issue: EvgenyOrekhov/eslint-config-hardcore#385.

@coderaiser
Copy link
Owner

Thank you! Fixed in @putout/engine-parser v4.9.1 🎉 , is it works for you?

@coderaiser
Copy link
Owner

But I suspect there might be similar problems in other Putout packages, so I would highly recommend enabling the import/no-extraneous-dependencies rule and checking all Putout packages.

Thanks :), just added.

@EvgenyOrekhov
Copy link
Author

It works now! Thanks for a quick fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants