简体   繁体   中英

ESLint Rule: Break nested JSX Elements into Multi Lines

I'd like to configure my ESLint to automatically style my JSX Elements. Basically it should convert this:

<Link to={'operations'}><Button variant={'contained'}><i>Çalışmalar</i></Button></Link>

to this

<Link to={'groups'}>
  <Button variant={'contained'}>
    <i>Gruplar</i>
  </Button>
</Link>

I just can't seem to find the correct ESLint rule for it.

I have tried some rules like react/jsx-newline , but they are not what I'm looking for.

you can achive this with prettier .

install the extension in your VSCode then see here how to setup ESLINT and PRETTIER in React app

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM