dprint-plugin-typescript icon indicating copy to clipboard operation
dprint-plugin-typescript copied to clipboard

Expand `forceMultiLineSpecifiers` to format imports of a single named import as a single line

Open jakebailey opened this issue 1 year ago • 0 comments

This is a continuation of https://github.com/dprint/dprint-plugin-typescript/pull/473#issuecomment-1399724050.

forceMultiLineSpecifiers forces imports to be vertical lists of single items, which is great for preventing merge conflicts. But, when importing one thing (which is surprisingly often), it looks like:

import {
    someFunction,
} from "some-library";

Which is maybe a little silly, especially when you may also be writing:

import someFunction from "some-library";

For libraries that have a default export instead.

It'd be nice if there were some way to say "a single import is okay", or similar. (per https://github.com/dprint/dprint-plugin-typescript/pull/473#pullrequestreview-1273626359)

jakebailey avatar Jan 05 '24 00:01 jakebailey