Skip to content

"react/jsx-curly-spacing": [ 2, "always", { "spacing": { "objectLiterals": "never" }}] errors on node context #671

Closed
@MoOx

Description

@MoOx

I added spacing/objectLiterals config for jsx-curly-spacing and I think I am getting an issue.

  render() {
    return (
      <div
        onClick={ this.handleClick }
        style={{ color: "blue" }} // From doc, it should affect only this part right?
      >
        { // <- There should be no newline after '{'
          !this.state.clicked
          ? "Hi"
          : "Hey"
        } // <- There should be no newline before '{'
      </div>
    )
  }

The doc only show an example in props, not sure why it's yelling for nodes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions