Skip to content
tai-kun's Vite+ Lint Plugins
Esc
↑↓navigate↵open⌘Jpreview
On this page

type-literal-properties-newline

Enforce multiline type literals when they have two or more members.

  • Rule ID: tai-kun/type-literal-properties-newline
  • Auto-fix: Yes

Inserts a line break after { when a type literal has two or more members and the first member starts on the same line as the brace.

Configuration

Add the rule to lint.rules in vite.config.ts to enable it.

"tai-kun/type-literal-properties-newline": "error",

Examples

Invalid

type Options = { a: string; b: number };

Valid

type Options = {
  a: string;
  b: number;
};

Notes

  • interface declarations are excluded because Oxfmt always prints them multiline.
  • Use it together with sort-type-members.

Was this page helpful?