Bug: [prefer-const] inconsistent prefer-const
rule report
#10426
Labels
bug
Something isn't working
fix: user error
issue was fixed by correcting the configuration / correcting the code
locked due to age
Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.
package: eslint-plugin
Issues related to @typescript-eslint/eslint-plugin
working as intended
Issues that are closed as they are working as intended
Before You File a Bug Report Please Confirm You Have Done The Following...
Playground Link
https://typescript-eslint.io/play#ts=5.6.2&fileType=.tsx&code=PQKgpgHgDg9gTgFzAEwAQEMTFQGzAjVAXlQCYBuIA&eslintrc=N4KABGBEBOCuA2BTAzpAXGUEKQA7UQDNFoBaAYwHsA7ZAF3ShOkuknDAF8ROg&tsconfig=N4KABGBEDGD2C2AHAlgGwKYCcDyiAuysAdgM6QBcYoEEkJemy0eAcgK6qoDCAFutAGsylBm3TgwAXxCSgA&tokens=false
Repro Code
ESLint Config
tsconfig
Expected Result
In
eslint-plugin-svelte
, I am rewriting theprefer-const
rule because, in Svelte, there are variable declarations that some users may prefer not to be reported asconst
. Since thesvelte-eslint-plugin
uses@typescript-eslint
, I expect the base rule to exhibit the same behavior.Actual Result
The rule report is inconsistent.
Additional Info
I've been researching for a bit and seems like
typescript-eslint
does not mark aVariable
aseslintUsed
the same way it doeseslint
, therefore comments such as/* exported
do not seteslintUsed
totrue
.The text was updated successfully, but these errors were encountered: