Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

refactor(rome_js_analyze): relax noConfusingArrow #4593

Merged
merged 1 commit into from
Jun 21, 2023
Merged

refactor(rome_js_analyze): relax noConfusingArrow #4593

merged 1 commit into from
Jun 21, 2023

Conversation

Conaclos
Copy link
Contributor

@Conaclos Conaclos commented Jun 19, 2023

Summary

I often encounter the warnings of noConfusingArrow and I am starting to disable it.
The rule looks too pedantic.

This PR relaxes noConfusingArrow by accepting all arrow functions that enclose its parameter with parenthesis.
Thus, the following snippet no longer triggers the rule:

var x = (a) => 1 ? 2 : 3;

The following snippet still triggers the rule:

var x = a => 1 ? 2 : 3;

This means that code formatted by Rome can no longer trigger this rule.
Another solution could be to remove the rule.

Test Plan

Tests updated.

Changelog

  • The PR requires a changelog line

Documentation

  • The PR requires documentation
  • I will create a new PR to update the documentation

@netlify
Copy link

netlify bot commented Jun 19, 2023

Deploy Preview for docs-rometools ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 1992295
🔍 Latest deploy log https://app.netlify.com/sites/docs-rometools/deploys/649059310efb0a0008bfea84
😎 Deploy Preview https://deploy-preview-4593--docs-rometools.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@github-actions github-actions bot added the A-Linter Area: linter label Jun 19, 2023
@Conaclos Conaclos requested a review from ematipico June 19, 2023 13:33
@ematipico ematipico merged commit fb2d3e6 into rome:main Jun 21, 2023
@Conaclos Conaclos deleted the no-confusing-arrow-relax branch June 21, 2023 09:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Linter Area: linter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants