why is space-in-parens disabled?
See original GitHub issueHello! 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:
- Created 8 years ago
- Comments:11 (2 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
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.