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

Base rule extension: [max-params] don't count this: void #7538

Closed
5 tasks done
RettentoRectangle opened this issue Aug 25, 2023 · 1 comment · Fixed by #7696
Closed
5 tasks done

Base rule extension: [max-params] don't count this: void #7538

RettentoRectangle opened this issue Aug 25, 2023 · 1 comment · Fixed by #7696
Labels
accepting prs Go ahead, send a pull request that resolves this issue enhancement: new base rule extension New base rule extension required to handle a TS specific case package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin

Comments

@RettentoRectangle
Copy link

RettentoRectangle commented Aug 25, 2023

Before You File a Proposal Please Confirm You Have Done The Following...

My proposal is suitable for this project

  • My proposal specifically checks TypeScript syntax, or it proposes a check that requires type information to be accurate.
  • I believe my proposal would be useful to the broader TypeScript community (meaning it is not a niche proposal).

Link to the base rule

https://eslint.org/docs/latest/rules/max-params

Description

It would be great ignore "this: void" by default.

Eslint cries about "this: void" even though it is not a real parameter.

Fail

// Fail. Still report an error if too much parameters are there:

private doSomethingWild (x: number, y: number, z: number, k: any) {
 //
}

Pass

// Pass. Don't count "this: void".

private doSomethingWild (this: void, x: number, y: number, z: number) {
 //
}

Additional Info

I don't have time to make it myself. :(

@RettentoRectangle RettentoRectangle added enhancement: new base rule extension New base rule extension required to handle a TS specific case package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for maintainers to take a look labels Aug 25, 2023
@bradzacher bradzacher closed this as not planned Won't fix, can't repro, duplicate, stale Aug 25, 2023
@bradzacher bradzacher added please fill out the template we have the processes for good reasons 😔 and removed triage Waiting for maintainers to take a look labels Aug 25, 2023
@RettentoRectangle RettentoRectangle changed the title Base rule extension: [rule-name] <a short description of my proposal> Base rule extension: [max-params] don't count this: void Aug 25, 2023
@RettentoRectangle
Copy link
Author

RettentoRectangle commented Aug 25, 2023

Ups, forgot to name it after filled the template.

@bradzacher bradzacher reopened this Aug 25, 2023
@bradzacher bradzacher added triage Waiting for maintainers to take a look and removed please fill out the template we have the processes for good reasons 😔 labels Aug 25, 2023
@JoshuaKGoldberg JoshuaKGoldberg added accepting prs Go ahead, send a pull request that resolves this issue and removed triage Waiting for maintainers to take a look labels Sep 14, 2023
StyleShit added a commit to StyleShit/typescript-eslint that referenced this issue Sep 27, 2023
StyleShit added a commit to StyleShit/typescript-eslint that referenced this issue Sep 27, 2023
JoshuaKGoldberg added a commit that referenced this issue Oct 17, 2023
…7696)

* feat(eslint-plugin): [max-params] don't count `this: void` parameter

Closes #7538

* hard-code schema

* refactor

* lint

* snapshot

* wip

* Update packages/eslint-plugin/src/rules/max-params.ts

Co-authored-by: Josh Goldberg ✨ <git@joshuakgoldberg.com>

* Small PR nits, don't mind me, it's great either way

---------

Co-authored-by: Josh Goldberg ✨ <git@joshuakgoldberg.com>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 25, 2023
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 base rule extension New base rule extension required to handle a TS specific case 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