Restrict line length to 80 characters (adjust eslint rule)
See original GitHub issueCode 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:
- Created 6 years ago
- Reactions:1
- Comments:11 (11 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 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 >
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
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.
As a stepping stone we could maybe do
ignoreStrings: true
andignoreTemplateLiterals: true
.