Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upClasses and Missing space before function parentheses. (space-before-function-paren) #346
Comments
This comment has been minimized.
This comment has been minimized.
|
I don't think setting the parser to babel-eslint is required anymore. When I take the code above and paste it into http://standardjs.com/demo it comes back valid with no errors. Could you try reinstalling the latest version of standard and testing again? |
This comment has been minimized.
This comment has been minimized.
|
Everything is up-to-date. I reinstalled Standard just in case but no difference. Still the same error that indeed doesn't appear on the standardjs demo page. For the parser, without it, I have weird stuff like an |
This comment has been minimized.
This comment has been minimized.
|
Ah ha ! Just found the problem ! I'm using vim as well as the auto-format taken from the readme: It was actually removing the space between the function name and the I guess the problem would rely in the formatter then... and maybe some change to the vim autoformat command would help detect other potential future error ? |
This comment has been minimized.
This comment has been minimized.
tabulahussla
commented
Jan 9, 2016
|
Does standard actually support ES6 features that are now part of the stable node.js build? export class Foo {
constructor (bar) {
this.baz(bar)
}
baz (bar) {
console.log(bar)
}
test () {
console.log('test')
}
}
Using this code snippet with standardjs.com/demo, "Format" button not giving a correct result: export class Foo {
constructor( bar) {
this.baz(bar)
}
baz( bar) {
console.log(bar)
}
test() {
console.log('test')
}
}
Of course after code was formatted, linter reports errors. Thats an incorrect behaviour. Same story with the object shorthand: let test = {
foo () {
console.log('foo')
}
}
test.foo()
After format, becomes the let test = {
foo() {
console.log('foo')
}
}
test.foo()Generating new "Missing space before function parentheses" error. |
This comment has been minimized.
This comment has been minimized.
lipp
commented
Jan 25, 2016
|
+1 same problem as @yura415: the formater messes up the parentheses spacing. |
This comment has been minimized.
This comment has been minimized.
pnw
commented
Feb 1, 2016
|
+1 getting the same thing. The formatter breaks the subsequent lint. |
This comment has been minimized.
This comment has been minimized.
|
Yeah, the formatter has issues with some ES6 features. You can help fix these issues by contributing to the This issue is already open on that issue tracker: maxogden/standard-format#134 |
yormi commentedNov 27, 2015
Ok, I'm not sure if it's the right place to post the issue but I haven't manage to determine if the problem lies in standard or eslint or babel-eslint... maybe you could help me !
Same problem than posted here(#59). I tried to test with Eslint using the rc/.eslintrc of this project but I'm still confuse with all that.
giving:
Missing space before function parentheses. (space-before-function-paren)In package.json: