# react/jsx-equals-spacing

> Enforce or disallow spaces around the `=` of JSX attributes

`name="email"` and `name = "email"` mean the same thing. Using one style everywhere keeps props easy to scan. By default the rule doesn't allow a space on either side of the `=`.

`--fix` adds or removes the spaces.

{/* Generated by src/codegen/lint-rule-docs.ts. Do not edit this section. */}

## Configure

Off by default. To turn it on:

```toml bunfig.toml
[lint.rules]
"react/jsx-equals-spacing" = "error" # or "warn"
```

Every option, set to its default:

```toml bunfig.toml
[lint.rules]
"react/jsx-equals-spacing" = ["error", "never"] # "always" or "never"
```

{/* End of the generated section. */}

## Examples

Reported:

{/* bad {"count": 2} */}
```jsx
const field = <input name = "email" />;
```

Not reported:

{/* good */}
```jsx
const field = <input name="email" required />;
```

## Options

| Option | What it does |
| --- | --- |
| `"never"` (default) | Don't allow a space before or after the `=`. |
| `"always"` | Require a space before and after the `=`. |

{/* bad {"options": ["always"]} */}
```jsx
const field = <input name="email" />;
```

{/* good {"options": ["always"]} */}
```jsx
const field = <input name = "email" />;
```

## When not to use it

A formatter such as `bun fmt` or Prettier already fixes this spacing.
