Rules

no-jsx-script-tag

Avoid native script elements in JSX.

Purpose and behavior

Avoid native script elements in JSX.

Reports lowercase <script> JSX elements. Components such as <Script> are not the same syntax and are allowed. Use your framework-owned script integration rather than manually injecting execution.

Options

No configurable options. Enable with "rules/no-jsx-script-tag": "error".

Invalid example

const el = <script>alert(1)</script>

Valid example

const el = <Script />

Fixes and exceptions

This rule reports diagnostics without an automatic fix. Rewrite the code deliberately rather than guessing its intended semantics.

For a genuine boundary exception, use an oxlint-disable-next-line rules/no-jsx-script-tag -- reason comment. Examples illustrate this rule alone and may omit imports and declarations.

Source and tests

Enabled by the TypeScript preset.

no-jsx-script-tag.ts · Tests