Closed
Description
Before You File a Bug Report Please Confirm You Have Done The Following...
- I have tried restarting my IDE and the issue persists.
- I have updated to the latest version of the packages.
- I have searched for related issues and found none that matched my issue.
- I have read the FAQ and my problem is not listed.
Playground Link
Repro Code
// Using plain eslint, the following is not reported as an error
/* eslint/prefer-const: "error" */
/* exported a */ let a = 2;
// However, using this package, the same expression is reported as an error
/* exported a */ let a = 2; // 'a' is never reassigned. Use 'const' instead
ESLint Config
module.exports = {
parser: "@typescript-eslint/parser",
rules: {
"prefer-const": "error",
},
};
tsconfig
Expected Result
In eslint-plugin-svelte
, I am rewriting the prefer-const
rule because, in Svelte, there are variable declarations that some users may prefer not to be reported as const
. Since the svelte-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 a Variable
as eslintUsed
the same way it does eslint
, therefore comments such as /* exported
do not set eslintUsed
to true
.