This repository was archived by the owner on Aug 31, 2023. It is now read-only.

Description
Environment information
Nightly & Rome Playground.
What happened?
This code produces an incorrect error on L4.
const unused = 1;
declare const declareUnused;
export const ok = 1;
export declare const ohno;
main.tsx:4:22 [lint/correctness/noUnusedVariables](https://docs.rome.tools/lint/rules/noUnusedVariables) FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠ This variable is unused.
2 │ declare const declareUnused;
3 │ export const ok = 1;
> 4 │ export declare const ohno;
│ ^^^^
Expected result
There are possibly 2 problems here?
- L2 should arguably be an error because none of the following code depends on the declaration. I am don't have a strong opinion on this, declarations are not variables so maybe they should just not be in scope at all for this rule?
- L4 should definitely not be an error because it is an
export. The current behaviour seems obviously wrong to me.
Code of Conduct