Skip to content

Trim trailing commas and don't add spaces before/after brackets with inline objects #2376

@tumatanquang

Description

@tumatanquang

Description

Option to trim trailing commas and with inline objects not add spaces before/after brackets.

Input

With this new feature, when I give like this input:

import {
    ENVS,
    BROWSERS,
    BUILD_PATH,
} from '../constants';
let dataObj = {completed: false,{id: 1,title: "delectus aut autem",},userId: 1,};
const myArray = [
    item1,
        item2,
    item3,
];

Expected Output

I'd like to see this output:

import {
    ENVS,
    BROWSERS,
    BUILD_PATH // trim trailing comma
} from '../constants';
let dataObj = {completed: false, {id: 1, title: "delectus aut autem"}, userId: 1};  // trim trailing comma and
                                                                                    // don't add spaces before/after brackets with inline objects
const myArray = [
    item1,
    item2,
    item3  // trim trailing comma
];

Environment

Browser, CLI

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions