quick-lint / quick-lint-js

quick-lint-js finds bugs in JavaScript programs
https://quick-lint-js.com
GNU General Public License v3.0
1.52k stars 192 forks source link

correctly report assignment to imported variable error in TypeScript #1141

Open strager opened 8 months ago

strager commented 8 months ago

The following is valid TypeScript if the imported x is a type-only declaration (e.g. an interface):

import {x} from './mod';
x = 42;
var x;

The following is invalid TypeScript even if the imported x is a runtime declaration:

import {x} from './mod';
x = 42;

We should fix quick-lint-js's variable analyzer to handle both of these cases properly.