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: max-lines #6078

Closed
mysticatea opened this issue May 4, 2016 · 9 comments
Closed

Rule Proposal: max-lines #6078

mysticatea opened this issue May 4, 2016 · 9 comments
Assignees
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 feature This change adds a new feature to ESLint rule Relates to ESLint's core rules

Comments

@mysticatea
Copy link
Member

From maximumNumberOfLines.

This rule will disallow that a file gets the number of lines more than the specific integer.

{
    "max-lines": ["error", {
        "max": 300,
        "skipBlankLines": false,
        "skipComments": false
    }]
}
  • max (default is 300) - The maximum count of lines per file.
  • skipBlankLines (default is false) - If this is true, this rule skips blank lines to count lines.
  • skipComments (default is false) - If this is true, this rule skips comment lines to count lines.
@mysticatea mysticatea added rule Relates to ESLint's core rules feature This change adds a new feature to ESLint evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion labels May 4, 2016
@mysticatea mysticatea added this to the JSCS Compatibility milestone May 4, 2016
@alberto
Copy link
Member

alberto commented May 4, 2016

I'm a champion

@ilyavolodin
Copy link
Member

This rule is very close to complexity (no direct correlation, but never the less more lines usually means higher complexity). Do we need this in the core or should it go into a plugin of some kind?

@alberto
Copy link
Member

alberto commented May 4, 2016

@ilyavolodin there is a bit of correlation, but they are quite different. Also, complexity is per function, same as max-statements

@doberkofler
Copy link
Contributor

+1

@alberto
Copy link
Member

alberto commented May 27, 2016

@eslint/eslint-team opinions?

@alberto alberto self-assigned this May 27, 2016
@mikesherov
Copy link
Contributor

👍

2 similar comments
@qfox
Copy link

qfox commented May 30, 2016

👍

@nzakas
Copy link
Member

nzakas commented May 30, 2016

👍

@nzakas nzakas added accepted There is consensus among the team that this change meets the criteria for inclusion and removed evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion labels May 30, 2016
@platinumazure
Copy link
Member

platinumazure commented May 30, 2016

For skipComments, I assume that refers to lines with only comments and whitespace on them?

Lines I assume count under that definition:

// comment

/* comment */

/* comment one */ /* comment two */

/* comment one */ // comment two

Lines I assume don't count under that definition:

var foo = "bar"; // comment

And I'm happy to take this on if @alberto isn't super attached.

alberto added a commit that referenced this issue Jun 4, 2016
alberto added a commit that referenced this issue Jun 6, 2016
alberto added a commit that referenced this issue Jun 7, 2016
alberto added a commit that referenced this issue Jun 8, 2016
alberto added a commit that referenced this issue Jun 10, 2016
alberto added a commit that referenced this issue Jun 10, 2016
alberto added a commit that referenced this issue Jun 10, 2016
@nzakas nzakas closed this as completed in 2520f5a Jun 10, 2016
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 6, 2018
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Feb 6, 2018
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 feature This change adds a new feature to ESLint rule Relates to ESLint's core rules
Projects
No open projects
Development

No branches or pull requests

8 participants