close

no-namespace

Unreleased

Configuration

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

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

Rule Details

Enforce that namespaces are not used in React elements. React does not support namespace-qualified element names such as <svg:circle />.

Examples of incorrect code for this rule:

<ns:TestComponent />
React.createElement('ns:TestComponent');

Examples of correct code for this rule:

<TestComponent />
<testComponent />
React.createElement('TestComponent');

Original Documentation