I have the following eslint config:
"object-curly-newline": ["error", {
"ImportDeclaration": "never",
"ExportDeclaration": "never"
}],
That transforms:
import {
something,
somethingelse,
} from "../here";
to
import { something,
somethingelse, } from "../here";
but I'd like to get my import so it goes to a single line. Like so:
import { something, somethingelse, } from "../here";
Is there a way to do this within "object-curly-newline"? Or can I accomplish it via some other rule? I've tried the various other properties, but haven't had any luck.
I believe this might be related to the multiline setting of object-curly-newline, depending on your settings.
"multiline": truerequires line breaks if there are line breaks inside properties or between properties. Otherwise, it disallows line breaks.
That is what I noticed in my situation.

You can see which rule applies before saving, by hovering over the red or yellow underlines. In my case these were shown underneath the curly braces.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With