palantir / tslint-react

:orange_book: Lint rules related to React & JSX for TSLint.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

jsx-wrap-multiline issue with trailing-comma

SimonSchick opened this issue · comments

Bug Report

  • tslint-react version: 4.0.0
  • tslint version: 5.14.0
  • typescript version: 3.4
  • Running TSLint via: NodeJS v11.13

TypeScript code being linted

      group.push(
        <Button
          id={`assign${this.props.dealer.id}`}
          key='assign'
          onClick={() => this.props.openAssignTable()}
        >
          Assign Table
        </Button>,
      );

with tslint.json configuration:

    "trailing-comma": [true, {
        "esSpecCompliant": true,
        "multiline": "always",
        "singleline": "never"
      }],
      "jsx-wrap-multiline": true

Actual behavior

Lints fine.

Expected behavior

When a trailing comma is added the rule complaints about not being wrapped.
While this is technically correct I think an exception should be made in the case of being the single argument with a trailing comma.

There are a lot of issues with this rule, see #79. My suggestion is to use prettier.

Cool, I already disabled it, kinda sad tho.