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.

Suggestion: Enforce 80 character lines with Eslint

See original GitHub issue

Describe 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:closed
  • Created 5 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
willdurandcommented, Jun 22, 2018

Fixed by #5313

1reaction
willdurandcommented, May 8, 2018

FWIW Prettier got a lot better lately with more config options like --arrow-parens and a nice integration with eslint.

Read more comments on GitHub >

github_iconTop 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 >

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