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

Update: added ignoreExpressions option to max-classes-per-file #15000

Merged

Conversation

JoshuaKGoldberg
Copy link
Contributor

@JoshuaKGoldberg JoshuaKGoldberg commented Aug 31, 2021

Prerequisites checklist

What is the purpose of this pull request? (put an "X" next to an item)

[ ] Documentation update
[ ] Bug fix (template)
[ ] New rule (template)
[x] Changes an existing rule (template)
[ ] Add autofixing to a rule
[ ] Add a CLI option
[ ] Add something to the core
[ ] Other, please explain:

What changes did you make? (Give an overview)

Allowed max-classes to take in an object for its options, with a new ignoreExpressions option alongside the existing maxClasses.

Fixes #14855.

Is there anything you'd like reviewers to focus on?

These files are a few years old. Would you like me to update them to a newer format?

@eslint-github-bot eslint-github-bot bot added the triage An ESLint team member will look at this issue soon label Aug 31, 2021
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Aug 31, 2021

CLA Signed

The committers are authorized under a signed CLA.

@JoshuaKGoldberg JoshuaKGoldberg marked this pull request as ready for review August 31, 2021 02:48
@nzakas nzakas added accepted There is consensus among the team that this change meets the criteria for inclusion enhancement This change enhances an existing feature of ESLint rule Relates to ESLint's core rules and removed triage An ESLint team member will look at this issue soon labels Sep 1, 2021
Copy link
Member

@nzakas nzakas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docs specified the option name as “maximum” while the code used “maxClasses”. I think we can just go with “max”, which is what other rules use in a similar situation.

code looks good overall.

docs/rules/max-classes-per-file.md Outdated Show resolved Hide resolved
docs/rules/max-classes-per-file.md Outdated Show resolved Hide resolved
docs/rules/max-classes-per-file.md Outdated Show resolved Hide resolved
docs/rules/max-classes-per-file.md Outdated Show resolved Hide resolved
lib/rules/max-classes-per-file.js Outdated Show resolved Hide resolved
tests/lib/rules/max-classes-per-file.js Outdated Show resolved Hide resolved
tests/lib/rules/max-classes-per-file.js Outdated Show resolved Hide resolved
tests/lib/rules/max-classes-per-file.js Outdated Show resolved Hide resolved
tests/lib/rules/max-classes-per-file.js Outdated Show resolved Hide resolved
tests/lib/rules/max-classes-per-file.js Outdated Show resolved Hide resolved
JoshuaKGoldberg and others added 2 commits August 31, 2021 20:48
Co-authored-by: Nicholas C. Zakas <nicholas@humanwhocodes.com>
Copy link
Member

@nzakas nzakas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

Copy link
Contributor

@snitin315 snitin315 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for contributing!

Copy link
Member

@mdjermanovic mdjermanovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@nzakas nzakas merged commit dd10937 into eslint:master Sep 4, 2021
@JoshuaKGoldberg JoshuaKGoldberg deleted the max-classes-per-file-ignore-expressions branch September 4, 2021 00:46
@eslint-github-bot eslint-github-bot bot locked and limited conversation to collaborators Mar 4, 2022
@eslint-github-bot eslint-github-bot bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Mar 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion enhancement This change enhances an existing feature of ESLint rule Relates to ESLint's core rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow excluding class expressions in max-classes-per-file
4 participants