-
Notifications
You must be signed in to change notification settings - Fork 26.5k
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
Reverse rule on string concatenation for long lines #995
Conversation
LGTM |
Broken and concatenated long strings are painful to work with and produce less readable and searchable code. I think we should reverse this rule. Unfortunately, the max-len rule currently does not allow for this, but there is currently a proposal to add an option to ESLint's max-len rule that would allow for strings to be ignored. eslint/eslint#5805 There have also been discussions around performance of string concatenation (#40), but I don't think that is very relevant here so I removed the links to them.
fc8442f
to
150499c
Compare
While you bring up a good point about it being less searchable, I disagree with your opinion that it makes it easier to read. I always make sure that my line lengths are within the 100 character limit because it's obnoxious to have to scroll to the right in my text editor to read a line of code. I propose that we go forth with adding the |
@chrisngobanh the string's contents aren't something that needs to be read - strings are data, a black box. The code is what matters. We'll definitely add that option when it becomes available, but strings broken across lines are very hard to read, so I don't think we should change the guide in that manner. |
@chrisngobanh see #1027 |
Broken and concatenated long strings are painful to work with and produce less readable and searchable code. I think we should reverse this rule. Unfortunately, the max-len rule currently does not allow for this, but there is currently a proposal to add an option to ESLint's max-len rule that would allow for strings to be ignored. eslint/eslint#5805 There have also been discussions around performance of string concatenation (airbnb#40), but I don't think that is very relevant here so I removed the links to them.
Broken and concatenated long strings are painful to work with and produce less readable and searchable code. I think we should reverse this rule. Unfortunately, the max-len rule currently does not allow for this, but there is currently a proposal to add an option to ESLint's max-len rule that would allow for strings to be ignored. eslint/eslint#5805 There have also been discussions around performance of string concatenation (airbnb#40), but I don't think that is very relevant here so I removed the links to them.
Broken and concatenated long strings are painful to work with and
produce less readable and searchable code. I think we should reverse
this rule.
Unfortunately, the max-len rule currently does not allow for this, but
there is currently a proposal to add an option to ESLint's max-len rule
that would allow for strings to be ignored.
eslint/eslint#5805
There have also been discussions around performance of string
concatenation (#40), but I
don't think that is very relevant here so I removed the links to them.