question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

new rule option request: max-len ignores strings

See original GitHub issue

Currently, max-len supports ignoreComments, ignoreUrls, etc. I’d like to request an additional option, ignoreStrings.

My rationale is the following:

  • strings are an atomic token, and it is a code smell to treat them as anything other than a single unbroken unit.
  • trivial changes in the string contents might necessitate the string being re-joined and re-broken, causing unnecessary diff churn
  • people use line length limits for many things, but i personally use them as a proxy for limiting line complexity - as such, length isn’t actually what i care about.

This affects both inline strings as well as “require” paths and “import from” paths (and should apply to template literals as well as single/double-quoted strings)

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:28
  • Comments:22 (17 by maintainers)

github_iconTop GitHub Comments

11reactions
platinumazurecommented, Aug 11, 2016

I will champion @ljharb’s proposal.

6reactions
ljharbcommented, Aug 26, 2016

If nobody gets to it first, definitely! Just need to find the time 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

max-len - ESLint - Pluggable JavaScript Linter
This rule enforces a maximum line length to increase code readability and ... true ignores lines that contain a double-quoted or single-quoted string...
Read more >
How to disable eslint rule max line length for paragraph in ...
Original Answer. AFAIK, there is no way to apply eslint rules to the template, and specifically to one line in a template. I...
Read more >
Options - Prettier
In code styleguides, maximum line length rules are often set to 100 or 120. However, when humans write code, they don't strive to...
Read more >
vue/max-len
This rule enforces a maximum line length to increase code readability and maintainability. This rule is the similar rule as core max-len rule...
Read more >
JSHint Options Reference
If you would like to enforce rules relating to code style, check out the ... The option cannot be maintained without automatically opting...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found