web-configs icon indicating copy to clipboard operation
web-configs copied to clipboard

Conflict in parens rules around binary assignment

Open gilbertbw opened this issue 1 year ago • 0 comments

Overview

I think there is a conflict in the @shopify/binary-assignment-parens and @typescript-eslint/no-extra-parens rules.

I have some code like:

const running = (this.state === 'running');

Which is getting the following error:

error Unnecessary parentheses around expression @typescript-eslint/no-extra-parens

from https://github.com/Shopify/web-configs/blob/5ab0fcff3d25c9f38d871b0d0104305554d86a97/packages/eslint-plugin/lib/config/typescript.js#L205

But if I change it to:

const running = this.state === 'running';

I get

error You must include parentheses around a binary assignment expression @shopify/binary-assignment-parens

from https://github.com/Shopify/web-configs/blob/5ab0fcff3d25c9f38d871b0d0104305554d86a97/packages/eslint-plugin/lib/config/core.js#L270

Consuming repo

What repo were you working in when this issue occurred?

A private repository

Labels

  • [ ] Add the Type: Bug label to this issue.

Area

  • [ ] Add any relevant Area: <area> labels to this issue

Scope

  • Is this issue related to a specific package?

    • [ ] Tag it with the Package: <package_name> label.

Checklist

  • [ ] Please delete the labels section before submitting your issue
  • [x] I have described this issue in a way that is actionable (if possible)

gilbertbw avatar Jun 16 '23 09:06 gilbertbw