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.

RFC: space-in-parens: exception to distinguish between function calls and sub-expression grouping.

See original GitHub issue

I like to use spaces in parentheses when grouping expressions, but not when calling functions, like this:

a = ( 1 + 2 ) * 3;
b(1, 2);

It allows one to visually mark semantically distinct uses of parentheses.

Would you accept a PR that implements this (and the opposite, off course)?

Edit: Thanks, eslintbot. So, a priori, the only unknown to me is whether it is “1. Widely applicable”.

<bountysource-plugin>

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource. </bountysource-plugin>

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
dantmancommented, Jan 16, 2016

Adding to this; space-in-parens seems to be unable to differentiate condition expressions (i.e. if () {}, where, etc…).

This is important since this is a perfectly valid coding style:

function foo(x) {}

if ( y ) {
  foo('x');
}

i.e. never space parenthesis in general, but always space the test in conditions.

0reactions
not-an-aardvarkcommented, Nov 3, 2017

Thanks for your interest in improving ESLint. Unfortunately, it looks like this issue didn’t get consensus from the team, so I’m closing it. We define consensus as having three 👍s from team members, as well as a team member willing to champion the proposal. This is a high bar by design – we can’t realistically accept and maintain every feature request in the long term, so we only accept feature requests which are useful enough that there is consensus among the team that they’re worth adding.

Since ESLint is pluggable and can load custom rules at runtime, the lack of consensus among the ESLint team doesn’t need to be a blocker for you using this in your project, if you’d find it useful. It just means that you would need to implement the rule yourself, rather than using a bundled rule that is packaged with ESLint.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to distinguish SUP error from RFC function exception?
I know the reason of the problem, it is a raised exception in my RFC module. In my Android application, if it is...
Read more >
Chapter 14. Exception Handling - Exploring JS
Tip: If you want to distinguish between different kinds of exceptions, you can use the constructor property to switch over the exceptions' constructors...
Read more >
rfc:random-function-exceptions - PHP.net wiki
Concern has been raised over the way failure is indicated by several functions in the core that are often used for security purposes....
Read more >
How to represent SEH (__try / __except) in LLVM IR
The filter expressions are emitted as separate function bodies that the personality function calls. If a filter function returns '1', ...
Read more >
Exception Groups in Python - GeeksforGeeks
Now, what happens if we call this Function? Users will get a structured new kind of error message which clearly states the number...
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