For AI agents: the complete documentation index is available at https://rslint.rs/llms.txt, the full documentation bundle is available at https://rslint.rs/llms-full.txt, and this page is available as Markdown at https://rslint.rs/rules/react/jsx-equals-spacing.md.
close

jsx-equals-spacing

Added in v0.3.0

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