new rule option request: max-len ignores strings
See original GitHub issueCurrently, 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:
- Created 7 years ago
- Reactions:28
- Comments:22 (17 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I will champion @ljharb’s proposal.
If nobody gets to it first, definitely! Just need to find the time 😃