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

Codacy is not importing needed @types #140

Open
richard-giraud opened this issue Nov 15, 2024 · 0 comments
Open

Codacy is not importing needed @types #140

richard-giraud opened this issue Nov 15, 2024 · 0 comments
Labels

Comments

@richard-giraud
Copy link

Describe the bug
It looks like Codacy isn't able to leverage the @types/git-url-parse package, which results in odd error messages. Specifically, it gives the following:

  • Unsafe assignment of an error typed value.
  • Unsafe call of an `error` type typed value.

I don't believe there is an error type that could possibly apply here, suggesting that it's badly communicated error.

This was observed with #138, where the above error messages were generated.

To Reproduce

  1. Create a new branch.
  2. Find an imported code element that uses a @type library not appearing in this file: https://github.com/codacy/codacy-eslint/blob/master/package.json. (E.g., the git-url-parse package in src/core/package/SfpPackageInquirer.ts);
  3. Modify a line that involves the imported resource.
  4. Build and test locally.
  5. Observe there are no errors.
  6. Commit and push the changes.
  7. Create a PR.
  8. Observe that Codacy starts the validation, then gives an odd error message.

Expected behavior
The code passes without error (in the case of the referenced PR) or the error messages would make more sense.

Screenshots

Image

Platform Details (please complete the following information):
This is with GitHub workflow on the #138 PR.

Additional context
It looks like this may be a limitation of how Codacy is configured/works. I found an old GitHub Issue (from back before when they hid their Issues) that says that they don't do an npm install when running on their cloud, and that is causing the error. https://web.archive.org/web/20201123173420/https://github.com/codacy/codacy-eslint/issues/920

This report is from 2020, so it may no longer be relevant. However, it would explain the error type.

If this turns out to be the case, the solution is likely move the checks into the GitHub workflow:

  1. npm install
  2. npm run build
  3. Run Codacy CLI to perform the analysis.
  4. Upload the results to Codacy.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant