Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I want to add a space between the JS method function name and the parenthesis. how to set it? #318

Closed
qingyuun opened this issue Jan 4, 2018 · 24 comments
Labels
locked Please open a new issue and fill out the template instead of commenting.

Comments

@qingyuun
Copy link

qingyuun commented Jan 4, 2018

I want to add a space between the JS method function name and the parenthesis. how to set it?

@CiGit
Copy link
Member

CiGit commented Jan 4, 2018

There is no such thing in prettier. ref: prettier/prettier#1139
However, this should be possible with eslint https://eslint.org/docs/rules/space-before-function-parentheses

Edit: It's https://eslint.org/docs/rules/space-before-function-paren the other one is deprecated and doesn't work

@CiGit CiGit added the question label Jan 4, 2018
@antonreshetov
Copy link

antonreshetov commented Jan 17, 2018

Such a situation occurred when I upgraded from 1.0.1 to 1.1.0. I'm using eslint and standard JS style. In 1.1.0 prettier ignores this rule. I rolled back to 1.0.1 and all was well.

Here is a link to 1.0.1 https://esbenp.gallery.vsassets.io/_apis/public/gallery/publisher/esbenp/extension/prettier-vscode/1.0.1/assetbyname/Microsoft.VisualStudio.Services.VSIXPackage

After downloading, rename the extension from vsixpackage to vsix and install

@azz
Copy link
Member

azz commented Jan 17, 2018

Did the extension stop using prettier-eslint entirely, or was it just one rule?

@azz
Copy link
Member

azz commented Jan 17, 2018

I think it is this issue. prettier/prettier-eslint#156

@CiGit Maybe bump prettier-eslint and release a new version?

@antonreshetov
Copy link

@azz Not quite understand the question. You say that this problem is related to an outdated version prettier-eslint?

@azz
Copy link
Member

azz commented Jan 17, 2018

Yeah, this extension bundles in prettier-eslint (which it uses when prettier.eslintIntegration is true). I suspect the issue your facing is a consequence of the aforementioned issue. You could try npm install prettier-eslint@latest and it might work.

@antonreshetov
Copy link

@azz No, out. Probably not the problem. I have installed the latest prettier-eslint 8.7.5 and still is ignoring the rules

@CiGit
Copy link
Member

CiGit commented Jan 17, 2018

Will update prettier-eslint, but there was no change between 1.0.1 and 1.1.0 ...

@antonreshetov you have to update it in the extension itself, we don't pick your local version.

@CiGit
Copy link
Member

CiGit commented Jan 17, 2018

Isn't it an issue between eslint 3 and eslint 4 ? The rule is named space-before-function-paren in v4. Bundled version is also an eslint@4 in 1.0.1

@CiGit
Copy link
Member

CiGit commented Jan 17, 2018

Just released version 1.1.1

@antonreshetov
Copy link

I updated to 1.1.1, the result is now somewhat deteriorated

screenflow2

@CiGit
Copy link
Member

CiGit commented Jan 17, 2018

What's wrong?
Can you post a before / after text please :-)

@antonreshetov
Copy link

Briefly, again not working correctly https://eslint.org/docs/rules/space-before-function-parentheses

@CiGit
Copy link
Member

CiGit commented Jan 17, 2018

This rule was removed in ESLint v1.0 and replaced by the space-before-function-paren rule

@Spittal
Copy link

Spittal commented Feb 6, 2019

Hey, I'm still having this issue.

No matter what I do regardless of the rule I have set in my .eslintrc.js I can't seem to get prettier to add the space between function and parenthesis.

I am totally up to date with both ESLint and Prettier and have the "Prettier: Eslint Integration" enabled.

I end up with a situation, that when I format document it ends up spitting ESLint errors, because there's no space between function name and parenthesis.

This is after a Format Document command
image

@mike1e
Copy link

mike1e commented Feb 20, 2019

@Spittal Were you able to resolve this issue?

@Spittal
Copy link

Spittal commented Feb 27, 2019

Not yet, sorry. @mike1e

@kivervinicius
Copy link

any update?

@rlam3
Copy link

rlam3 commented Jul 12, 2019

same issue. is there a workaround ?

@opravil-jan
Copy link

Hello,

this bug is really annoying. What prevents it from resolving this issue?

Thank you

Jan Opravil

@chrfs
Copy link

chrfs commented Aug 6, 2019

Still an issue, this is very annoying!
Why is commenting on the issue ? :/

@ntotten
Copy link
Member

ntotten commented Aug 24, 2019

Due to the huge amount of bugs, linting support has been deprecated in version 2.0.0. See the documentation on the recommended configuration: https://github.com/prettier/prettier-vscode#vscode-eslint-and-tslint-integration

See #870 for more details.

@ntotten ntotten closed this as completed Aug 24, 2019
@brodybits
Copy link

FYI the equivalent of space-before-function-paren is supported by my prettierx fork.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot added the locked Please open a new issue and fill out the template instead of commenting. label Apr 12, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked Please open a new issue and fill out the template instead of commenting.
Projects
None yet
Development

No branches or pull requests