Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rule proposal: consistent typing for Map and Set #3494

Closed
bschlenk opened this issue Jun 7, 2021 · 0 comments · Fixed by #4924
Closed

Rule proposal: consistent typing for Map and Set #3494

bschlenk opened this issue Jun 7, 2021 · 0 comments · Fixed by #4924
Labels
accepting prs Go ahead, send a pull request that resolves this issue enhancement: new plugin rule New rule request for eslint-plugin package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin

Comments

@bschlenk
Copy link

bschlenk commented Jun 7, 2021

I sometimes forget that I can type Map/Set with a generic on the right hand side. I'd like to add a rule to enforce typing Map/Set with a generic on the RHS, instead of typing the variable on the LHS.

This would be an error:

const mySet: Set<string> = new Set();

And would autocorrect to:

const mySet = new Set<string>();
@bschlenk bschlenk added package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for maintainers to take a look labels Jun 7, 2021
@bradzacher bradzacher added enhancement: new plugin rule New rule request for eslint-plugin and removed triage Waiting for maintainers to take a look labels Jul 6, 2021
@JoshuaKGoldberg JoshuaKGoldberg added the accepting prs Go ahead, send a pull request that resolves this issue label Oct 25, 2021
@bradzacher bradzacher changed the title proposal: consistent typing for Map and Set Rule proposal: consistent typing for Map and Set May 3, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepting prs Go ahead, send a pull request that resolves this issue enhancement: new plugin rule New rule request for eslint-plugin package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants