How to keep array of objects on one line in prettier in js

Viewed 847

I would like to keep my array of objects on one line, but prettier is always expanding the array. I've looked into prose wrap, but I'm not sure if that solves the issue. If prose wrap does solve the issue, could I get a reminder on how to make that change in vscode

// current
const keyframes = [{
        opacity: 0
    }, {
        opacity: 1
    }]
// desired output
[{opacity: 0}, {opacity: 1}]
1 Answers

Prettier never prints arrays of objects the way you've shown in your question.

Anyway, // prettier-ignore comments might be what you're looking for. See the docs.

Related