-
Notifications
You must be signed in to change notification settings - Fork 26.6k
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
Define a max line length of 100 characters #639
Conversation
@@ -34,6 +34,8 @@ module.exports = { | |||
'lines-around-comment': 0, | |||
// disallow mixed 'LF' and 'CRLF' as linebreaks | |||
'linebreak-style': 0, | |||
// specify the maximum length of a line in your program |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add https://github.com/eslint/eslint/blob/master/docs/rules/max-len.md in a comment?
This LGTM, pending comments. I'd be fine with it either in its own section, or in the whitespace section. |
[eslint] Add comment above `max-len` rule with link to its docs [eslint] Change tab width for `max-len` rule from 4 to 2 [eslint] Replace double quotes around `max-len` with single quotes [eslint] Use object form of `max-len` and include all of the options
I moved the rule from legacy.js to style.js and enabled it
[eslint] Add comment above `max-len` rule with link to its docs [eslint] Change tab width for `max-len` rule from 4 to 2 [eslint] Replace double quotes around `max-len` with single quotes [eslint] Use object form of `max-len` and include all of the options
5fe80f9
to
e2e4724
Compare
@ljharb done! I also rebased |
[eslint config] [breaking] Define a max line length of 100 characters
This rule definition results in an error:
The current definition is valid only in [email protected], but the package has a dependency on [email protected] which requires a different format. |
Oops! 2.x isn't released yet, so we should fix that. Luckily, it hasn't yet been released in |
[eslint] Add comment above `max-len` rule with link to its docs [eslint] Change tab width for `max-len` rule from 4 to 2 [eslint] Replace double quotes around `max-len` with single quotes [eslint] Use object form of `max-len` and include all of the options
[eslint] Add comment above `max-len` rule with link to its docs [eslint] Change tab width for `max-len` rule from 4 to 2 [eslint] Replace double quotes around `max-len` with single quotes [eslint] Use object form of `max-len` and include all of the options
[eslint] Add comment above `max-len` rule with link to its docs [eslint] Change tab width for `max-len` rule from 4 to 2 [eslint] Replace double quotes around `max-len` with single quotes [eslint] Use object form of `max-len` and include all of the options
Taking over #510
Addresses #509
This PR adds section 18.12, which defines a limit for the length of a line to be 100 characters (including whitespace). This number was agreed upon in #510 and is also the line length defined in the Ruby style guide.
I enabled ESLint rule max-len to enforce this, as well as updated
.jshintrc
.I also updated section 6.2 to recognize the newly defined line length.
Something to discuss: I put this new rule in the Whitespace section (18), but should it have its own section?
The Ruby style guide has it in its section, separate from the Whitespace section.