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.

why is space-in-parens disabled?

See original GitHub issue

Hello! This is a question not a bug 😃

Looking at your examples you always use the following style: if (x) {, functionCall(a, b, c). So, I was wondering why is space-in-parens completely disabled in your eslint config?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
jesucarrcommented, May 19, 2016

I think adding spaces to objects makes it less readable because it can be confused with a block (block-spacing rule), specially if it is a inline block.

Also, since arrays don’t have spaces, and they are also “objects”, it would be more congruent to treat them in the same way.

I understand it is your current style in Airbnb, but perhaps you might consider favour readability and congruence over the “looks weird” reasoning.

0reactions
jesucarrcommented, May 20, 2016

Ok I can see your thinking, however objects don’t necessarily have more than one item, and with the new assignment shorthand, objects don’t necessarily have key/value pairs. If the object has more than a couple of items, they should go in different lines anyways. When scanning code I find more useful to clearly distinguish a block from an object, than to see what separates each item.

Read more comments on GitHub >

github_iconTop Results From Across the Web

space-in-parens - ESLint - 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 >
Prevent paredit from inserting a space when ... - Stack Overflow
Opening a parenthesis inserts a space before the parenthesis. I understand this is probably the preferred style of the whole internet, ...
Read more >
Prettier Function Parenthesis Spacing - Opinionated is Key
Upon running Prettier, I noticed that it kept adding spaces between the function keyword and the argument parenthesis. For example (demo):.
Read more >
Bug - Javascript function parens spacing
It's not a bug. If you like to avoid inserting a white space after 'function' keyword in callbacks/anonymous functions, please make sure to ......
Read more >
No space with after parenthesis, but needed - TeX
As the maintainer of ChkTeX I give you permission to ignore this warning. :-) Most things in ChkTeX are just that warnings.
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