Closed
Description
Before You File a Proposal Please Confirm You Have Done The Following...
- I have searched for related issues and found none that match my proposal.
- I have searched the current rule list and found no rules that match my proposal.
- I have read the FAQ and my problem is not listed.
Relevant Package
typescript-eslint
My proposal is suitable for this project
- I believe my proposal would be useful to the broader TypeScript community (meaning it is not a niche proposal).
Description
Some rule's error report location seems too wide. I think it could be improved to report more accurate location where user should care about.For example,
-
no-unused-vars: fix(eslint-plugin): [no-unused-vars] clear error report range #8640
// AS-IS let unusedVar: { foo: number } | undefined = 1; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ // TO-BE let unusedVar: { foo: number } | undefined = 1; ^^^^^^^^
-
explicit-member-accessibility : fix(eslint-plugin): [explicit-member-accessibility] refine report locations #8869
// AS-IS class Animal { get name(): string { return this.animalName; } ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ } // TO-BE class Animal { get name(): string { return this.animalName; } ^^^^^^^^^ }
-
no-for-in-array fix(eslint-plugin): [no-for-in-array] refine report location #8874
// AS-IS declare const array: string[]; for (const i in array) { console.log(array[i]); } ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ // TO-BE declare const array: string[]; for (const i in array) { console.log(array[i]); } ^^^^^^^^^^^^^^^^^^^^^
-
init-declarations fix(eslint-plugin): [init-declarations] refine report locations #8893
// AS-IS let bar: number | undefined | string; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ bar = 2; // TO-BE let bar: number | undefined | string; ^^^^^ bar = 2;
-
prefer-readonly fix(eslint-plugin): [prefer-readonly] refine report locations #8894
// AS-IS class Container { private onClick = () => { /* ... */ }; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ } // TO-BE class Container { private onClick = () => { /* ... */ }; ^^^^^^^^^^^^^^^ }
-
space-before-blocks(formatting/layout rule)
... maybe more
Additional Info
No response
Metadata
Metadata
Assignees
Labels
Go ahead, send a pull request that resolves this issueGo ahead, send a pull request that resolves this issueNew feature or requestNew feature or requestPlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.Issues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugin