disabled space-before-function-paren adds a space between generic and function paren
See original GitHub issueEdited, initial version was not correct
I came across the weird and likely wrong behavior with formatting of the next lines of code
function foo<T>(x: T): T {
return x
}
Even if I don’t pass --space-before-function-paren
flag (default value is false), space is added between foo<T extends number>
and (x: T)
,
so the result is:
function foo<T> (x: T): T { // <-- space between <T> and (x: T)
return T
}
Could you please confirm it’s an issue?
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
space-before-function-paren - TypeScript ESLint
This rule extends the base eslint/space-before-function-paren rule. It adds support for generic type parameters on function calls.
Read more >Space after function keyword - MOVED to #3847! · Issue #1139
Current instruction: Disable the space-before-function-paren ESLint rule. If Prettier adds support for printing that space: Use ...
Read more >VS Code - space before function parentheses - Stack Overflow
In VS Code open File -> Preferences -> Settings; Add to your JSON config: "javascript.format.insertSpaceBeforeFunctionParenthesis": true.
Read more >space-before-function-paren - GitLab
This rule extends the base eslint/space-before-function-paren rule. It adds support for generic type parameters on function calls.
Read more >Enforces consistent spacing before function parenthesis ...
This rule extends the base eslint/space-before-function-paren rule. It adds support for generic type parameters on function calls.
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
Thanks @havenchyk, I added the bug label with help wanted for now. A new test case would be very helpful.
@brodybits new info came.
Tried it with version
0.10
. Am I doing formatting wrong? I’m also surprised it’s different from the result from CLI