Skip to content
This repository has been archived by the owner on Jan 31, 2024. It is now read-only.

Latest commit

 

History

History
57 lines (46 loc) · 903 Bytes

jsx-attribute-align.md

File metadata and controls

57 lines (46 loc) · 903 Bytes

spiff/jsx-attribute-align

Align the attributes of multi-line JSX elements.

  • ⭐️ This rule is included in plugin:spiff/recommended preset.
  • ✒️ The --fix option on the command line can automatically fix some of the problems reported by this rule.

Rule Details

Correct:

<MultiLine
  key    = "key"
  banana = {<Inner i="i" />}
/>
<MultiLine
  key   = "key"
  count = {42}
/>
<MultiLine
  id     = {id}
  banana = {<Inner i="i" />}
/>

Incorrect:

<MultiLine
  key="key"
  banana={<Inner i="i" />}
/>
<MultiLine
  key  ="key"
  count={42}
/>
<MultiLine
  id =     {id}
  banana = {<Inner i="i" />}
/>

Implementation