2
votes

I recently implemented eslint and prettier with format on save. When i save it pushed my text to the start of the line like this:

            <Text style={styles.getStartedText}>
Get started
            </Text>

I am using react native, with AirBnb eslint presets, flow plugin and babel-eslint parser. Is there a rule that is causing this ?

Thanks

1
I am facing the same issue, did you find a solution?Mahdi Pedram

1 Answers

1
votes

found the issue, the rule is inherited from Airbnb.

if you override the below rule, the issue will get fixed.

'react/jsx-one-expression-per-line': 'off'

but still not sure why it pushes the text to the beginning.

https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-one-expression-per-line.md