close

jsx-no-duplicate-props

Configuration

PresetConfigured Value
✅ reactPlugin.configs.recommended"error"
rslint.config.ts
import { defineConfig, reactPlugin } from '@rslint/core';

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

Disallow duplicate properties in JSX.

Rule Details

Creating JSX elements with duplicate props can cause unexpected behavior in your application.

Examples of incorrect code for this rule:

<Hello name="John" name="John" />;

Examples of correct code for this rule:

<Hello first="John" last="Doe" />;

Rule Options

{ "react/jsx-no-duplicate-props": ["error", { "ignoreCase": true }] }

ignoreCase

When true the rule ignores the case of the props. Defaults to false.

Examples of incorrect code for this rule with { "ignoreCase": true }:

{ "react/jsx-no-duplicate-props": ["error", { "ignoreCase": true }] }
<Hello name="John" Name="John" />;

Original Documentation