question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

space-before-function-paren not working

See original GitHub issue

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”

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
sheeruncommented, Jun 12, 2017

@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

0reactions
sheeruncommented, Jun 12, 2017

there are few but .editorconfig doesn’t seem one of them: http://eslint.org/docs/user-guide/configuring#configuration-file-formats

Read more comments on GitHub >

github_iconTop Results From Across the Web

VS Code - space before function parentheses - Stack Overflow
In VS Code open File -> Preferences -> Settings; Add to your JSON config: "javascript.format.insertSpaceBeforeFunctionParenthesis": true.
Read more >
space-before-function-paren - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >
Unable to add a space before function parens #494 - GitHub
Default behavior for ESLint is to add a space before function parens. This is also a defined rule with StandardJS.
Read more >
Rule: space-before-function-paren - Palantir Open Source
One argument which is an object which may contain the keys anonymous , named , and asyncArrow These should be set to either...
Read more >
space-before-function-paren - TypeScript ESLint
space -before-function-paren ... We strongly recommend you do not use this rule or any other formatting linter rules. Use a separate dedicated formatter...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found