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@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.
This issue was moved to Microsoft/TypeScript#12234
Does this have a new issue for the vscode side now, @waderyan? Can't seem to find it
This doesn't seem fixed at all yet the referenced issue(Microsoft/TypeScript#12234) and this one is closed. Format still removes space between function name and (. I found no settings option for this either.
Using the latest 1.9.0 on macOS.
same as krokofant, MacOS, 1.9.1
Using Vs code 1.12 insider build. Following settings are ignored on format:
// Defines space handling before function argument parentheses. Requires TypeScript >= 2.1.5.
"typescript.format.insertSpaceBeforeFunctionParenthesis": true,
// Defines space handling before function argument parentheses. Requires TypeScript >= 2.1.5.
"javascript.format.insertSpaceBeforeFunctionParenthesis": true
same as krokofant, MacOS, 1.12.2
I am able to fix this by making es-lint auto correct the fixable code:
"files.associations": {
"*.vue": "html"
},
"editor.formatOnSave": true,
// Defines space handling before function argument parentheses. Requires TypeScript >= 2.1.5.
"typescript.format.insertSpaceBeforeFunctionParenthesis": true,
// Defines space handling before function argument parentheses. Requires TypeScript >= 2.1.5.
"javascript.format.insertSpaceBeforeFunctionParenthesis": true,
// Eslint options
"eslint.enable": true,
"eslint.options": {
"extensions": [
".html",
".js",
".vue",
".jsx"
]
},
// An array of language ids which should be validated by ESLint
"eslint.validate": [
"javascript",
"javascriptreact",
{
"language": "html",
"autoFix": true
}
],
// Run the linter on save (onSave) or on type (onType)
"eslint.run": "onSave",
// Turns auto fix on save on or off.
"eslint.autoFixOnSave": true
Eslint is now fully integrated in vscode and everything works great! 馃憤
You guys should open a new issue, it works for me on Win10 and I don't think they watch comments on closed issues (that's why I opened the pull in the first place)
Thanks @mubaidr. Your settings fixed the problem for me. Version 1.16.1 (windows).
Most helpful comment
I am able to fix this by making es-lint auto correct the fixable code:
Eslint is now fully integrated in vscode and everything works great! 馃憤