Skip to content

Proposal: Allow trailing commas in function argument list #12306

Closed
@streamich

Description

@streamich

TypeScript allows trailing commas in object definitions:

var obj = {
    key: 'value',
};

Proposal: Allow trailing commas in function argument list:

someFunction(argument,);

Why? Trailing commas in object definitions are great for convenience when editing lists:

{
    key1: 'val1',
    key2: 'val2',
    key3: 'val3',
};

Same is with functions, consider usage of Virtual Hypertext functions:

return (
    h('div', null,
        h('span', null, 'span 1'),
        h('span', null, 'span 1'),
        h('span', null, 'span 1'),
    )
);

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateAn existing issue was already created

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions