Open bahag-streckerj opened 1 month ago
I had the same problem. Solved it by messing with versions until it worked. Here is my current working config:
"@eslint/js": "9.3.0",
"@typescript-eslint/eslint-plugin": "7.10.0",
"@typescript-eslint/parser": "7.10.0",
"eslint-plugin-unused-imports": "^4.0.0",
Can this be attributed to the fact that eslint-plugin-unused-imports
now requires eslint v9.x ?
I haven't found a solution that fixes this error:
main.ts
import { bootstrapApplication } from '@angular/platform-browser';
import { appConfig } from './app/app.config';
import { AppComponent } from './app/app.component';
bootstrapApplication(AppComponent, appConfig).catch(() => {});
I'm using the following dependencies:
"@typescript-eslint/eslint-plugin": "7.10.0",
"@typescript-eslint/parser": "7.10.0",
"eslint-plugin-unused-imports": "4.0.0",
"eslint": "9.5.0",
And get the following error when running npm run lint
:
frontend/src/main.ts
1:1 error Definition for rule 'unused-imports/no-unused-imports-ts' was not found unused-imports/no-unused-imports-ts
What can I do to prevent that?
I haven't found a solution that fixes this error:
main.ts
import { bootstrapApplication } from '@angular/platform-browser'; import { appConfig } from './app/app.config'; import { AppComponent } from './app/app.component'; bootstrapApplication(AppComponent, appConfig).catch(() => {});
I'm using the following dependencies:
"@typescript-eslint/eslint-plugin": "7.10.0", "@typescript-eslint/parser": "7.10.0", "eslint-plugin-unused-imports": "4.0.0", "eslint": "9.5.0",
And get the following error when running
npm run lint
:frontend/src/main.ts 1:1 error Definition for rule 'unused-imports/no-unused-imports-ts' was not found unused-imports/no-unused-imports-ts
What can I do to prevent that?
in newer versions unused-imports/no-unused-imports-ts
does not exist, you need to use unused-imports/no-unused-imports
After following the suggestion of @sweepline, the following worked for me:
"unused-imports/no-unused-imports-ts": "error"
with "unused-imports/no-unused-imports": "error"
in the .eslintrc.json
eslint
dependency in package.json
from 8.57.0 to 9.5.0eslint-plugin-unused-imports
in package.json
from 3.2.0 to 4.0.0
function(_unused) gets reported as unused import
I am getting false positive errors on function arguments as if they were imports when I @typescript-eslint/eslint-plugin to >7.7.
The Package.json
The rule config:
The unexpected outout
for that 7th line in the following excerpt:
The problem is, that it is the wrong rule (
unused-imports/no-unused-imports
) "saying" that there is a false positive: An unused import.The problem does not occur with this
package.json
Further information:
There was a 7.8.0 release two weeks ago: https://github.com/typescript-eslint/typescript-eslint/releases/tag/v7.8.0 with this feature (https://github.com/typescript-eslint/typescript-eslint/pull/8640) in it, that might have to do with eslint-plugin-unused-imports.