close

jsx-equals-spacing

Configuration

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

export default defineConfig([
  reactPlugin.configs.recommended,
  {
    rules: {
      'react/jsx-equals-spacing': 'error',
    },
  },
]);

Rule Details

Enforce or disallow spaces around the = sign in JSX attributes.

Examples of incorrect code with the default "never" option:

<Foo name = "value" />
<Foo name= "value" />
<Foo name ="value" />

Examples of correct code with the default "never" option:

<Foo name="value" />

Options

  • "never" (default): Disallow spaces around =.
  • "always": Require one space on each side of =.

Original Documentation