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.

Restrict line length to 80 characters (adjust eslint rule)

See original GitHub issue

Code lines restricted to 80 characters lets you use many horizontal split screens in your editor which is nice.

diff --git a/.eslintrc b/.eslintrc
index c9d84498..6d8085f9 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -10,6 +10,13 @@
     "jest"
   ],
   "rules": {
+    "max-len": ["error", 80, 2, {
+      ignoreUrls: true,
+      ignoreComments: false,
+      ignoreRegExpLiterals: true,
+      ignoreStrings: false,
+      ignoreTemplateLiterals: false,
+    }],
     // FIXME: Deprecate use of findDOMNode https://github.com/mozilla/addons-frontend/issues/968
     "react/no-find-dom-node": "off",
   },

We discussed it here: https://github.com/mozilla/addons-frontend/pull/3036#discussion_r136206566

Unfortunately, yarn eslint -- --fix cannot help with this.

Please ask before fixing this issue as it will be hard to review and could introduce merge conflicts.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
muffinresearchcommented, Aug 31, 2017

Alright I’ll put a patch together to see what it look like - that’ll be a good way for everyone to see if they’re on board with Prettier’s output as a starting point.

1reaction
kumar303commented, Aug 31, 2017

As a stepping stone we could maybe do ignoreStrings: true and ignoreTemplateLiterals: true.

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 maintainability. The length of a line is defined as the number...
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 Use and Disable ESLint Max-Len (Line Length Rule)
If you have max-len enabled, by default it sets “code”: 80 and “tabWidth”: 4. This means that the compiler allows lines up to...
Read more >
T185295 Decide on max-len rule for eslint-wikimedia-config
The JavaScript community at large has standardized at 80 chars length, some examples:
Read more >
What is your stance on the 80 characters limit on code lines?
I do not set line length linting rules (via eslint) or formatting rules (e.g. print width, prettier) to hard wrap the codebase.
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