Details
-
Type:
Code Smell Detection
-
Status: Active
-
Resolution: Unresolved
-
Labels:
-
Message:
-
Highlighting:
-
Default Severity:Minor
-
Impact:Low
-
Likelihood:Low
-
Targeted languages:TypeScript
-
Covered Languages:JavaScript
-
Remediation Function:Constant/Issue
-
Constant Cost:2min
-
ESLint:arrow-body-style, arrow-parens
-
TSLint:arrow-parens, arrow-return-shorthand
Description
Shared coding conventions allow teams to collaborate effectively. This rule raises an issue when the use of parentheses with an arrow function does not conform to the configured requirements.
Noncompliant Code Example
With the configured defaults forbidding parentheses
var foo = (a) => { /* ... */ }; // Noncompliant; remove parens from arg var bar = (a, b) => { return 0; }; // Noncompliant; remove curly braces from body
Compliant Solution
var foo = a => { /* ... */ }; var bar = (a, b) => 0;
Attachments
1.
|
JavaScript | RSPEC-4114 |
|
Active | Unassigned |