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

"false" positive errors: E0358: 'declare' should not be written inside a 'declare namespace' #1142

Closed
strager opened this issue Dec 31, 2023 · 6 comments
Assignees
Milestone

Comments

@strager
Copy link
Collaborator

strager commented Dec 31, 2023

quick-lint-js diagnoses this, perhaps incorrectly: https://github.com/getsentry/sentry/blob/5d08d3d6f625a7c3d9352edc0fbef641f2d9a768/static/app/types/react-router.d.ts#L31

@strager strager added the false positive Severe bug: quick-lint-js rejects valid code label Dec 31, 2023
@skoch13
Copy link

skoch13 commented Jan 6, 2024

Facing this within my project

@strager strager added this to the 3.1 milestone Jan 6, 2024
@strager
Copy link
Collaborator Author

strager commented Jan 10, 2024

It looks like Sentry's tsconfig.json sets compilerOptions.skipLibCheck: true: https://github.com/getsentry/sentry/blob/5d08d3d6f625a7c3d9352edc0fbef641f2d9a768/config/tsconfig.base.json#L25

This suppresses errors in .d.ts files.

I think the right fix is to not have errors in the .d.ts files. I'm tempted to close this as a won't-fix because the code does have a bug.

@skoch13 Are you using compilerOptions.skipLibCheck: true?

@strager strager self-assigned this Jan 10, 2024
@skoch13
Copy link

skoch13 commented Jan 10, 2024

@skoch13 Are you using compilerOptions.skipLibCheck: true?

@strager correct, we are using it

@strager
Copy link
Collaborator Author

strager commented Jan 10, 2024

I don't think this is actually a bug in quick-lint-js. TypeScript rejects the code too.

I think this bug is common enough that quick-lint-js's documentation should mention skipLibCheck.

@strager strager removed the false positive Severe bug: quick-lint-js rejects valid code label Jan 10, 2024
@skoch13
Copy link

skoch13 commented Jan 10, 2024

I don't think this is actually a bug in quick-lint-js. TypeScript rejects the code too.

I think this bug is common enough that quick-lint-js's documentation should mention skipLibCheck.

I won’t argue with you on this, but I only observed it with quick-js-lint as without it my editor doesn’t show this as a warning

@strager strager changed the title TypeScript: possible false positive with 'declare' inside 'declare module' "false" positive errors: E0358: 'declare' should not be written inside a 'declare namespace' Jan 11, 2024
@strager
Copy link
Collaborator Author

strager commented Jan 15, 2024

I updated the docs to mention skipLibCheck: https://quick-lint-js.com/errors/E0358/

@strager strager closed this as not planned Won't fix, can't repro, duplicate, stale Jan 15, 2024
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

2 participants