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
Limit Maximum Length of Line #28
Comments
@mightyiam I'm not entirely sure what you mean, can you be a bit more specific with your question? thanks! |
Perhaps I mean row length. JSHint has the Good. ESLint also has For our enlightenment:
So it seems that 80 is the most popular and for what it is worth, I'd gladly accept 80 as the standard. However, I'd love to be enlightened more if anyone has compelling advice in favor of a different value. |
JSCS has |
In general, I try not to make lines longer than 100 characters, but it's not a hard-and-fast rule. I'm -1 on adding this rule. If you have a long string (example), especially in a test file, you don't gain anything by splitting it into multiple lines. It doesn't protect you from bugs, or even improve readability. |
Also, this new rule would require a major version bump. Lots of the modules listed here have lines longer than 100. A quick note on philosophy: The idea is for |
I understand that we want backwards compatibility and I understand that we want it to be done. I do not agree that long strings are a good reason not to have a Standard row length limit. For one, because ES6 has multi–line strings! And another reason is that the size of the windows on people's desktops are a big (huge?) important part of how people develop and if the row length is not standardized when we have a chance now then that is just a shame, isn't it? Standard row length will allow everyone to never again resize their terminal or GUI editor windows, moving from working on one project to a different project! That seems huge to me. On an 1920 pixels wide display (already seems minimal standard for desktop displays and gradually becoming minimal standard for laptops, as well), this is what it looks like for me: Notice that 100 rows don't fit. What do we see? We see the Ubuntu Unity side panel and a gnome-terminal window. The terminal window is with a font of size 9 (which is rather small, I would say). In it there is a byobu tmux session, dividing the the terminal into 67% & 33%. The former 67% part has a Vim running, divided in the middle. I use the 33% right part for on–change test running (standard will be one of them once #21 is fixed). Vim has some plugins that take up some row length, like line numbers, change markers and syntax checking. Overall, this seems to me like a reasonable—and I would image common—setup. Addressing the font size again; opening up a guest Ubuntu session, turns out that the default is 12. So my 9 is pretty small, I would say again. The caret in the screenshot, if you can spot it, is at column 97, which seems to be the last. With the default font size 12, the last column of this same setup is 72. So, I would say that 80 would seem to me the reasonable choice, since it is already a very popular choice, not only amongst JS developers, but amongst other languages, as well. Concerning existing very long lines—they can quite easily put in a comment rule and keep their long lines. As for large code bases, which have a big amount of > 80 length rows, they can use a global rule in an rcfile. I've convinced myself, anyway. |
I'm also -1 on this rule, I personally soft-limit to 120 characters, but am happy with large constants wrapping around if necessary. |
I'm also against this. On Tue, Feb 10, 2015 at 8:09 PM, Daniel Cousens notifications@github.com
Simple & Secure Bitcoin Wallet: https://www.coinbolt.com |
Thanks for the feedback, everyone. I think we can safely close this issue now because there's not enough support. |
😠 😊 😞 |
+1 for 80 column line length. |
I realize this is closed, but FWIW, I'm -1 on this too. I agree 100% with the following:
|
FWIW: even if i'm strict about 80-char limits on my projects, I'm also -1 on this. I can see this as a barrier to adoption because there really are special cases where you lines past 80 chars. |
A good formatter in my eyes should be able to always generate the same format no matter what happend to the file in the meantime. |
@mightyiam that is an interesting post, but, I almost always edit full screen, so the 80 char limit is entirely pointless for me. |
@nilsboy I assume you're thinking of |
I realise this is closed, but this feature should be added... or configurable through |
@rogeriopvl |
@mightyiam oh! awesome! didn't know that! Thanks. |
Sounds like nobody cares (or cared even), but it is possible to set a regex checker so that lines with long string constants are excluded from the ESLint line length rule. Nonetheless I agree that it's not an appropriate rule. If anybody's interested this is the (embarrassingly long) regex I use: var ignoreLongStrings = "\"(?:[^\"\\\\]|\\\\.){60,}\"|'(?:[^'\\\\]|\\\\.){60,}'|`(?:[^`\\\\]|\\\\.){60,}`"
module.exports = {
rules: {
'max-len': [warning, 80, 2, { ignoreComments: true, ignorePattern: ignoreLongStrings }]
}
} |
This is awesome.
Any thoughts on row width?
The text was updated successfully, but these errors were encountered: