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

Define a max line length of 100 characters #639

Merged
merged 5 commits into from
Dec 24, 2015

Conversation

chrisngobanh
Copy link
Contributor

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.

@@ -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
Copy link
Collaborator

Choose a reason for hiding this comment

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

@ljharb
Copy link
Collaborator

ljharb commented Dec 24, 2015

This LGTM, pending comments. I'd be fine with it either in its own section, or in the whitespace section.

chrisngobanh added a commit to chrisngobanh/javascript that referenced this pull request Dec 24, 2015
[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
@chrisngobanh
Copy link
Contributor Author

@ljharb done! I also rebased

ljharb added a commit that referenced this pull request Dec 24, 2015
[eslint config] [breaking] Define a max line length of 100 characters
@ljharb ljharb merged commit 6d00939 into airbnb:master Dec 24, 2015
@gergoerdosi
Copy link
Contributor

This rule definition results in an error:

Configuration for rule "max-len" is invalid:
Value "[object Object]" is the wrong type.

The current definition is valid only in [email protected], but the package has a dependency on [email protected] which requires a different format.

@ljharb
Copy link
Collaborator

ljharb commented Dec 31, 2015

Oops! 2.x isn't released yet, so we should fix that. Luckily, it hasn't yet been released in eslint-config-airbnb. @gergoerdosi, would you mind submitting a PR to fix that? It'd be ideal to also preserve the object form in a comment noting that it should be used with 2.x.

dustinmartin pushed a commit to dustinmartin/javascript that referenced this pull request Jan 4, 2016
[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
@pitaj pitaj mentioned this pull request Mar 4, 2016
gilbox pushed a commit to gilbox/javascript that referenced this pull request Mar 21, 2016
[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
jaylaw81 pushed a commit to appirio-digital/ads-best-practices that referenced this pull request Sep 19, 2017
[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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants