Tags

  • Always self-close tags that have no children. eslint: react/self-closing-comp

    1. // bad
    2. <Foo variant="stuff"></Foo>
    3. // good
    4. <Foo variant="stuff" />
  • If your component has multi-line properties, close its tag on a new line. eslint: react/jsx-closing-bracket-location

    1. // bad
    2. <Foo
    3. bar="bar"
    4. baz="baz" />
    5. // good
    6. <Foo
    7. bar="bar"
    8. baz="baz"
    9. />