I'm using Angular 14. I have set up a rule in tslint to warn about unused imports, and I can fix this across my project by running
> tslint --config tslint-imports.json --fix --project .
However, what if I just want to run the fix on a single file? I tried this
> tslint --config tslint-imports.json --fix ./src/app/services/my-products.service.ts
Warning: The 'no-unused-declaration' rule requires type information.
but besides the warning above, the file itself isn't fixed (it is fixed when it is run as part of the larger project initiative in the first code line above)
Edit: tslint-imports.json config file is
{
"extends": [
"tslint-etc"
],
"rules": {
"no-unused-declaration": true
}
}