DEV Community

Discussion on: How to Prevent Merge Conflicts (or at least have less of them)

Collapse
 
artdevgame profile image
Mike Holloway

This goes under formatting rules, but where possible I like to sort lines alphabetically (things like union types, options, language translation keys, even CSS rules and function/variable declaration)

I find this helps avoid some unnecessary conflicts, but has an added benefit of making code a little easier to grok/scan when searching for needles.

Collapse
 
blackgirlbytes profile image
Rizèl Scarlett

That's a great tip! I do this as well!