Eslint-plugin-react: False indentation, when use jsx-closing-bracket-location --fix

Created on 8 Jun 2017  路  3Comments  路  Source: yannickcr/eslint-plugin-react

Hello! Used fixer for this code:

    `const stack = notifications.map((notification, index) =>
        (<Notification
            actions = { actions }
            content = { notification.get('content') }
            heading = { notification.get('heading') }
            icon = { notification.get('icon') }
            id = { notification.get('id') }
            index = { index }
            key = { notification.get('id') }
            theme = { notification.get('theme') }
        />)
    );`

Closing />) line was indented not properly, need additional space before />), which was not added. Using last version of eslint-plugin-react with prettier (prettier + prettier-eslint + prettier-eslint-cli).

Most helpful comment

Fixed with

react/jsx-closing-bracket-location: [1, {"selfClosing": "line-aligned", nonEmpty: "after-props"}]

All 3 comments

Fixed with

react/jsx-closing-bracket-location: [1, {"selfClosing": "line-aligned", nonEmpty: "after-props"}]

@dzhytomyrsky did you add this piece of code to the package settings ?

@sahanatroam you add the code to eslintrc.js or your estlin config file.

Was this page helpful?
0 / 5 - 0 ratings