_From @aochsner on November 11, 2016 22:19_
We use space-before-function-paren in our eslint rules for readability. I'd like an option to format to this behavior
Steps to Reproduce:
function foo () { }function foo() { } with no mechanism to override_Copied from original issue: Microsoft/vscode#15386_
@aochsner thank you for opening this issue. The functionality for formatting is provided by TS Server. I will migrate this feature request to their repo.
Hi team, I met the same problem, this made me so sad, I have to format my code in command line tools since the build-in formatter will change function () -> function() .
So I have gotten around this issue a little bit by turning on:
"eslint.autoFixOnSave": true
in my settings.
@aochsner yeah, you approach works fine for me, thanks.
PRs welcomed.
Happy to take a stab... can you point me in the right direction?
The formatting logic resides in src/services/formatting. You'll want to check out the tests/cases/fourslash directory and peek around to get a sense of how to write a formatter test.
Also see our CONTRIBUTING.md.
Okay. I added a couple more test cases for InsertSpaceBeforeFunctionParenthesis. Found InsertSpaceAfterFunctionKeywordForAnonymousFuctions to cover that case. Added InsertSpaceAfterConstructor to handle that case. That should cover the main cases that http://eslint.org/docs/rules/space-before-function-paren enforces.
Let me know what else should be done. Thanks!
thanks @aochsner!
Most helpful comment
So I have gotten around this issue a little bit by turning on:
"eslint.autoFixOnSave": truein my settings.