Closed simply-innovative closed 7 years ago
could you paste the source?
Please find below our class entire source:
` /* @flow /
class Offline { constructor (config: any) {}
save (event: any) { function a () { if (true) { } } } }
export { Offline } ` Please let me know in case any other information required too
I suspected may be due to flow, but after removing flow then also it is not working :(
in my case prettier-standard formats to following:
/** @flow */
class Offline {
constructor (config: any) {}
save (event: any) {
function a () {
if (true) {
}
}
}
}
export {Offline}
what version are you using?
ok, I see 4.1.0.. please make sure you also use have the newest eslint and prettier in node_modules
Verified I have the latest version of both eslint and prettier in node_modules: eslint: 3.19.0 prettier: 1.2.2
I guess you'd need to prepare repository to reproduce as I'm unable to do so with just this file
Sure Sheerun. I will do the needful and will share the path of repo.
Thanks a lot for looking into the same
I also see this issue. Just installed today v5.0.0, not used prettier or standard before.
$ yarn global add prettier-standard
$ prettier-standard --version
5.0.0
$ echo "function hello () {}" | prettier-standard
function hello() {}
@Gryff @simply-innovative Could you try 5.1.0?
yarn global add prettier-standard
prettier-standard --version
5.1.0
echo "function hello () {}" | prettier-standard
function hello () {}
Also, please note that .eslintrc might be interfering in proper formatting, as prettier-standard allows for customizing its behavior
I see what you mean.
Doing echo "function hello () {}" | prettier-standard
outside of the project I was working on produces the expected function hello () {}
, inside it does as above. This is both for 5.0.0 and 5.1.0.
Thanks for pointing that out :) Do you happen to have a list of files that will affect prettier-standard? I don't have an .eslintrc
, I'm guessing it's .editorconfig
that is customising it.
there are few but .editorconfig doesn't seem one of them: http://eslint.org/docs/user-guide/configuring#configuration-file-formats
based on steps provided, I have configured prettier-standard but when I do git add space-before-function-paren eslint rule seems not working:
Source:
function a () { if (true) { } }
After Git Add:
function a() { if (true) { } }
It is removing the space before function parentheses. I have also tried to put the same in .eslintrc but then also it is not working.
{ "rules": { "object-curly-spacing": ["error", "always"], "space-before-function-paren": ["error", { "anonymous": "always", "named": "always", "asyncArrow": "always" }] } }
Can you please guide me how to enable this feature. Please find below software stack:
"prettier": "1.2.2", "prettier-standard": "4.1.0"