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

fix(linter): do not report obsolete devDependencies since they are not used in production files #18353

Merged
merged 1 commit into from
Jul 28, 2023

Conversation

jaysoo
Copy link
Member

@jaysoo jaysoo commented Jul 27, 2023

This PR fixes an issue where we report devDependencies as obsolete for standalone projects. This happens because they are not used in production files. This means nx and all @nx/* packages are obsolete, and --fix will remove them from the workspaces.

In general, we do not care what users put into their devDependencies, we only need to check the ones that affect their consumers.

Current Behavior

Standalone projects will report things like this for nx lint.

  14:5  error  The "@nx/eslint-plugin" package is not used by "my-awesome-package"                                                            @nx/dependency-checks
  15:5  error  The "@nx/js" package is not used by "my-awesome-package"                                                                       @nx/dependency-checks
  16:5  error  The "@nx/linter" package is not used by "my-awesome-package"                                                                   @nx/dependency-checks
  18:5  error  The "@nx/workspace" package is not used by "my-awesome-package"                                                                @nx/dependency-checks
  19:5  error  The "@types/node" package is not used by "my-awesome-package"                                                                  @nx/dependency-checks
  20:5  error  The "@typescript-eslint/eslint-plugin" package is not used by "my-awesome-package"                                             @nx/dependency-checks
  21:5  error  The "@typescript-eslint/parser" package is not used by "my-awesome-package"                                                    @nx/dependency-checks
  22:5  error  The "@vitest/coverage-c8" package is not used by "my-awesome-package"                                                          @nx/dependency-checks
  23:5  error  The "@vitest/ui" package is not used by "my-awesome-package"                                                                   @nx/dependency-checks
  24:5  error  The "eslint" package is not used by "my-awesome-package"                                                                       @nx/dependency-checks
  25:5  error  The "eslint-config-prettier" package is not used by "my-awesome-package"                                                       @nx/dependency-checks
  26:5  error  The "nx" package is not used by "my-awesome-package"                                                                           @nx/dependency-checks
  27:5  error  The "nx-cloud" package is not used by "my-awesome-package"                                                                     @nx/dependency-checks
  28:5  error  The "prettier" package is not used by "my-awesome-package"                                                                     @nx/dependency-checks
  29:5  error  The "typescript" package is not used by "my-awesome-package"                                                                   @nx/dependency-checks
  31:5  error  The "vitest" package is not used by "my-awesome-package"                                                                       @nx/dependency-checks

Expected Behavior

Standalone projects should not report errors on legit dev dependencies.

Related Issue(s)

Fixes #

@jaysoo jaysoo requested a review from a team as a code owner July 27, 2023 19:03
@jaysoo jaysoo requested a review from JamesHenry July 27, 2023 19:03
@vercel
Copy link

vercel bot commented Jul 27, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nx-dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 27, 2023 8:14pm

@github-actions
Copy link

github-actions bot commented Aug 3, 2023

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
scope: linter Issues related to Eslint support in Nx
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants