noJsxNamespace
Ta treść nie jest jeszcze dostępna w Twoim języku.
Summary
Section titled “Summary”- Rule available since:
v2.4.12 - Diagnostic Category:
lint/nursery/noJsxNamespace - This rule doesn’t have a fix.
- The default severity of this rule is information.
- This rule belongs to the following domains:
- Sources:
- Same as
react-jsx/no-namespace - Same as
@eslint-react/jsx-no-namespace
- Same as
How to configure
Section titled “How to configure”{ "linter": { "rules": { "nursery": { "noJsxNamespace": "error" } } }}Description
Section titled “Description”Disallow JSX namespace syntax.
React does not support XML namespaced tags such as <ns:Component />.
Although the JSX specification permits namespaces, React does not implement
them and using a namespaced element may cause a runtime error.
Examples
Section titled “Examples”Invalid
Section titled “Invalid”<ns:testcomponent />code-block.jsx:1:2 lint/nursery/noJsxNamespace ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ℹ Unexpected JSX namespace syntax.
> 1 │ <ns:testcomponent />
│ ^^^^^^^^^^^^^^^^
2 │
ℹ React does not support namespaced JSX tags. Use a plain element name or a member expression instead.
ℹ This rule belongs to the nursery group, which means it is not yet stable and may change in the future. Visit https://biomejs.dev/linter/#nursery for more information.
<svg:circle cx="50" cy="50" r="40" />code-block.jsx:1:2 lint/nursery/noJsxNamespace ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ℹ Unexpected JSX namespace syntax.
> 1 │ <svg:circle cx=“50” cy=“50” r=“40” />
│ ^^^^^^^^^^
2 │
ℹ React does not support namespaced JSX tags. Use a plain element name or a member expression instead.
ℹ This rule belongs to the nursery group, which means it is not yet stable and may change in the future. Visit https://biomejs.dev/linter/#nursery for more information.
<testcomponent /><object.TestComponent />Related links
Section titled “Related links”Copyright (c) 2023-present Biome Developers and Contributors.