Skip to content

Adding objectTypeBracketSpacing option to type-formatting rule #1615

@alexander-akait

Description

@alexander-akait

Motivation

Allow to control spacing after { and before } in object type - { a: string, b: number } notation

In https://github.com/webpack/webpack/ we prefer to write object notation with space after { and before }

Example:

/** @type {{ a: string, b: number }} */
const myObj = { a: "string", b: 1 };

To align with prettier default formatting for objects

Current behavior

No option

Desired behavior

Adding spaces

Alternatives considered

No alternatives, right now we need to disable typeBracketSpacing

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions