close

jsx-max-props-per-line

Configuration

rslint.config.ts
import { defineConfig, reactPlugin } from '@rslint/core';

export default defineConfig([
  reactPlugin.configs.recommended,
  {
    rules: {
      'react/jsx-max-props-per-line': 'error',
    },
  },
]);

Rule Details

Limit the maximum number of props on a single line in JSX. Useful for readability when elements have many props.

Examples of incorrect code with the default { "maximum": 1, "when": "always" }:

<Foo bar="a" baz="b" />

Examples of correct code with the default { "maximum": 1, "when": "always" }:

<Foo bar="a" />
<Foo
  bar="a"
  baz="b"
/>

Options

  • maximum: Maximum number of props per line. Can be a number or { single: N, multi: N }.
  • when: "always" (default) or "multiline". If "multiline", only enforces the limit on multiline JSX elements.

Original Documentation