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/no-namespace.md.
close

no-namespace

Added in v0.9.2

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