Line exceeds 100 characters and arrow body style
See original GitHub issueI have the following:
export const filteredItems = (state, filter, value) => state.items.filter(item => item.filter === value);
which gives the max-len (100) error.
When I rewrite it by changing the arrow function to the version with { } , naturally I get the error: https://github.com/airbnb/javascript#arrows--implicit-return .
What’s the way around this?
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
arrow-body-style - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >How to disable eslint rule max line length for paragraph in ...
I am using airbnb eslint and currently I am getting error: error: Line 6 exceeds the maximum line ...
Read more >eslint-config-prettier/README.md - UNPKG
Tip: First, you might be interested in installing [eslint-plugin-prettier]. 45, Follow the instructions over there. This is optional, though. 46.
Read more >Arrow function expressions - JavaScript - MDN Web Docs
Arrow functions cannot use yield within their body and cannot be created ... Traditional anonymous function (function (a) { return a + 100;...
Read more >Airbnb JavaScript Style Guide()
6.2 Strings that cause the line to go over 100 characters should not be ... braces and use a return statement. eslint: arrow-parens...
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
@gkatsanos Here’s a few options:
If you do have to disable a rule, disable max-len - line length limits are a really subpar proxy for managing complexity, so imo it’s always ok to disable that rule.
Our style guide does not permit arbitrary linebreaks after assignment; it’s always better to have too-long a line than to hit “enter” in a random place.