[prefer-const] does not account for side effect in default argument #2954
Labels
bug
Something isn't working
package: eslint-plugin
Issues related to @typescript-eslint/eslint-plugin
Repro
package.json
input.ts
tsconfig.json
Expected Result
./node_modules/.bin/eslint input.js
should give no error.Actual Result
If I use
--fix
, thelet
would be changed toconst
, and TypeScript will report compilation error.Additional Info
Compiled input.js
./node_modules/.bin/eslint input.js
gives no error.Versions
@typescript-eslint/eslint-plugin
4.14.0
@typescript-eslint/parser
4.14.0
TypeScript
4.1.3
ESLint
7.18.0
node
15.5.1
This issue did not occur 3 days ago (2021-01-17). All of typescript-eslint, TypeScript, and ESLint had upgrades during this period of time. Downgrading typescript-eslint to 4.13.0 (but not downgrading other packages) seem to solve this problem. Thus, this is a regression.
The text was updated successfully, but these errors were encountered: