4 ms·
Interesting, yeah, that’s definitely missing. ESLint has rules for ordering, feels like it’d be a relatively simple addition to prettier.
by jeremy_wiebe 8y ago
Interesting, yeah, that’s definitely missing. ESLint has rules for ordering, feels like it’d be a relatively simple addition to prettier.
- eropple 8y agoIn JavaScript, imports sometimes (too often, really) have side effects. I don't know if it makes sense for prettier to do that, at least by default.
- paulddraper 8y agoIn my experience, side-effecting imports are fairly uncommon. But in any cases, all formatters allow you to selectively disable it for certain liners.
- dvlsg 8y agoHopefully uncommon, anyways. Imports with side effects sounds like a nightmare to debug.
- michaelmior 8y agoI don't have a problem with anything that discourages imports with side effects. You can always ignore[0] any cases where this happens. [0] https://prettier.io/docs/en/ignore.html https://prettier.io/docs/en/ignore.html
- chrisweekly 8y agoeslint and prettier are not mutually exclusive
- jeremy_wiebe 8y agoI didn’t mean to imply that. In fact we use eslint + prettier where I work.
- paulddraper 8y ago> it’d be a relatively simple addition to prettier. It would be, but as you can see in the linked issue, it was closed for being a non-goal. So, it's not likely to change. (Prettier generally keeps the AST identical; i.e. whitespace and parentheses changes only.)