palantir / tslint-react

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

jsx-curly-spacing accepted formats

OoDeLally opened this issue · comments

Bug Report

  • tslint-react version: 4.1.0
  • tslint version: 5.20.1
  • typescript version: 3.7.4
  • Running TSLint via: VSCode

TypeScript code being linted

<IonToast
        isOpen={ Boolean(toastMessage)}
        onDidDismiss={handleDismiss }
        buttons={[{
            text: 'Ok',
            role: 'cancel',
            handler: handleDismiss,
          }]}
/>

with tslint.json configuration:

{
    "jsx-curly-spacing": [
      2,
      {
        "when": "always",
        "allowMultiline": true
      }
    ],
}

Actual behavior

The rule is ignored.

However

{
    "jsx-curly-spacing": [
      true,
      "always"
    ],
}

works.

Expected behavior

Should behave the same way as https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-curly-spacing.md

This package is being deprecated, see #210.

Also, I recommend using prettier for code formatting.