Suggestion: Enforce 80 character lines with Eslint
See original GitHub issueDescribe the problem and steps to reproduce it:
Whilst working on #4693, multiple reviewers mentioned that my lines exceeded 80 characters and thus were too long, however eslint did not complain. For example, here is 95 characters long.
To reproduce the problem, simply type out any valid line of code that is greater than 80 characters in length.
What happened?
yarn lint
did not report any errors with lines > 80 characters.
What did you expect to happen?
yarn lint
should complain when lines are > 80 characters and the build should fail on CI.
Anything else we should know?
It looks like the currently .eslintrc
configuration extends from amo
- that would be a good place to begin investigations.
In addition, it might be worthwhile to use Prettier pre-commit hooks to automatically format code when commits are made based on the existing eslint
config.
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
max-len - ESLint - Pluggable JavaScript Linter
The length of a line is defined as the number of Unicode characters in the line. Options. This rule has a number or...
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 >How to replace Prettier by ESLint rules ? | by Florian Briand
So, when Prettier rewrite the code to ensure the 80 characters line length replacing some local consistency, wisely choosen for a particular ...
Read more >Options - Prettier
For readability we recommend against using more than 80 characters: In code styleguides, maximum line length rules are often set to 100 or...
Read more >Coding Style - The Modern JavaScript Tutorial
The maximum line length should be agreed upon at the team-level. It's usually 80 or 120 characters. Indents. There are two types of...
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 Free
Top 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
Fixed by #5313
FWIW Prettier got a lot better lately with more config options like
--arrow-parens
and a nice integration with eslint.