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

Discussion node/no-missing-import, node/no-missing-require,import/no-unresolved #425

Open
lukasholzer opened this issue Jan 19, 2022 · 4 comments

Comments

@lukasholzer
Copy link

lukasholzer commented Jan 19, 2022

The following ruleset which is new causing issues:

  • node/no-missing-require
  • node/no-missing-import
  • import/no-unresolved

In general they seem to be redundant (the ones from the node package with the ones from the import package)

This rule was causing our CI to fail on the publish of a release candidate because it requires installing dependencies. https://netlify.slack.com/archives/CBC2U9MMG/p1642520718015700

https://github.com/netlify/cli/runs/4855518297?check_suite_focus=true

This is not the major problem despite the fact that it increases our CI usage without the need to.

In my opinion which drives me crazy currently is if you work on multiple issues in parallel that have different additions on dependencies you cannot just switch to the other branch do a small typo fix and push.

(As on push the lint rule is run and complains about a non existing dependency)

So I have to run install (as I don't want to bypass it by running with --no-verify)

This is not a huge issue if you don't add or remove dependencies but if you do it can get quite frustrating.

CleanShot 2022-01-19 at 10 58 40@2x

@eduardoboucas
Copy link
Member

I've also been bitten by this rule.

When working with TypeScript projects that compile to ESM, we need to import TypeScript files using a .js extension. These paths don't actually exist, and so this will cause ESLint to complain.

src/
  child.ts
  parent.ts
// Fails the `node/no-missing-import` rule
import child from './child.js'

@lukasholzer
Copy link
Author

cc @ehmicky

@ehmicky
Copy link
Contributor

ehmicky commented Jan 20, 2022

If those rules are creating issues for you, we should disable them 👍

@lukasholzer
Copy link
Author

lukasholzer commented Jan 20, 2022

@ehmicky IMO we should discuss them in general. Lint rules should help us avoiding issues and not making our lives harder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants