function-paren-newline error vs. max-len error
See original GitHub issueThe snippet:
export default connect(mapStateToProps, mapDispatchToProps)(
generateDndContextWithBackend(SiteEditorContainer));
gives me the error Unexpected newline after "("
But when I remove the newline:
export default connect(mapStateToProps, mapDispatchToProps)(generateDndContextWithBackend(SiteEditorContainer));
I get the max-len
error, because the line is longer than 100 characters.
What’s the way to fix this to avoid all errors? function-paren-newline
isn’t currently smart enough to take account of line length, which seems like a shortcoming, especially now that we have highly evolved line-length tools like Prettier. I understand that there are tradeoffs, and best practices may conflict, but in principle there should be an error-free way to write this code that isn’t highly contorted. Solution?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:19
- Comments:14
Top Results From Across the Web
function-paren-newline - 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 ...
AFAIK, there is no way to apply eslint rules to the template, and ... to get around it, I've added this rule 'max-len':...
Read more >set max length and show the error message - MSDN - Microsoft
this texbox allow the user input the URL into db, right now I want to set if the size is over 70, display...
Read more >HTML attribute: maxlength - MDN Web Docs
The maxlength attribute defines the maximum number of characters (as UTF-16 code units) the user can enter into an or .
Read more >Error while increasing Max Length - ServiceNow Community
Syntax Error or Access Rule Violation detected by database (BLOB/TEXT column 'a_str_16' used in key specification without a key length).
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
This seems like it’s actually a bug in the
function-paren-newline
rule (or an unavoidable conflict withmax-len
).For now, you may want to disable that rule entirely; I’ll leave this open to investigate disabling it in the config itself.
@yutin1987 fwiw, this is how we handle your example:
or