# JavaScript Function Parens Rule

**URL:** <https://community.sonarsource.com/t/javascript-function-parens-rule/5849>\
**Category:** SonarQube Server / Community Build\
**Tags:** javascript\
**Created:** [January 14, 2019, 7:04pm UTC](https://community.sonarsource.com/t/javascript-function-parens-rule/5849 "2019-01-14T19:04:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jeff\_Mathers](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/jeff_mathers/32/563_2.png) [@Jeff\_Mathers](https://community.sonarsource.com/u/Jeff_Mathers)\
**Post date:** [January 14, 2019, 7:04pm UTC](https://community.sonarsource.com/t/javascript-function-parens-rule/5849/1 "2019-01-14T19:04:58Z")

</div>

SonarQube 7+  
Rule Error/Deviation javascript:S3524 is inconsistent with ES2015  
Hi All,

Hoping this is the right place for this question.

[https://rules.sonarsource.com/javascript/tag/es2015/RSPEC-3524](https://rules.sonarsource.com/javascript/tag/es2015/RSPEC-3524)

This rule is not exactly consistent with ES2015. The standard says that when a single parameter arrow function has a function with parens, then the parens around the argument should be included. The rule is missing that nuance and my developers are complaining. Basically I think this rule needs a couple of more true/false options so that it could be configured to be this rule.

> **[arrow-parens - Rules](https://eslint.org/docs/rules/arrow-parens)**
>
> A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.

The rule includes this option: `{ "requireForBlockBody": true }`, but this is not in the SQ rule as far as I can tell.

What is the best way to proceed with seeing if this can be fixed/updated?

Jeff

---

<div class="post-metadata">

**Author:** ![Lena](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/lena/32/66719_2.png) [@Lena](https://community.sonarsource.com/u/Lena)\
**Post date:** [January 21, 2019, 12:49pm UTC](https://community.sonarsource.com/t/javascript-function-parens-rule/5849/3 "2019-01-21T12:49:33Z")

</div>

Hello @Jeff_Mathers,

Thanks for this feedback. Are you referencing airbnb standard? ([https://github.com/airbnb/javascript#arrows--one-arg-parens](https://github.com/airbnb/javascript#arrows--one-arg-parens))

I created ticket in SonarJS to fix your problem [https://github.com/SonarSource/SonarJS/issues/1148](https://github.com/SonarSource/SonarJS/issues/1148). But I’m not sure it will be implemented soon.

One option for you will be to deactivate SonarJS rule and import ESLint issues as external (see [docs](https://docs.sonarqube.org/display/PLUG/Importing+ESLint+Issues+Reports)).

Regards,  
Elena

---

<div class="post-metadata">

**Author:** ![Jeff\_Mathers](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/jeff_mathers/32/563_2.png) [@Jeff\_Mathers](https://community.sonarsource.com/u/Jeff_Mathers)\
**Post date:** [January 21, 2019, 1:27pm UTC](https://community.sonarsource.com/t/javascript-function-parens-rule/5849/4 "2019-01-21T13:27:26Z")

</div>

Yes - but I think the AirBNB standard is the same as ES2015 in this case. It is really only a minor issue so as long as it is corrected at some point that would be fantastic.

jeff
