Plugin: react-featuresRules
no-unknown-property
no-unknown-property rule
Prevent unknown DOM properties in JSX. This rule is part of eslint-plugin-react-features.
Quick Summary
| Aspect | Details |
|---|---|
| Severity | Error (correctness) |
| Auto-Fix | ✅ Yes (converts to correct prop) |
| Category | React |
| ESLint MCP | ✅ Optimized for ESLint MCP integration |
| Best For | All React/JSX projects |
Rule Details
React uses camelCase for DOM attributes and has some renamed attributes (e.g., className instead of class).
Common Corrections
| HTML Attribute | JSX Property |
|---|---|
class | className |
for | htmlFor |
tabindex | tabIndex |
colspan | colSpan |
rowspan | rowSpan |
readonly | readOnly |
maxlength | maxLength |
cellpadding | cellPadding |
cellspacing | cellSpacing |
frameborder | frameBorder |
Examples
❌ Incorrect
<div class="container">Content</div>
<label for="input">Label</label>
<input tabindex="1" readonly />
<table cellpadding="5" cellspacing="0"></table>✅ Correct
<div className="container">Content</div>
<label htmlFor="input">Label</label>
<input tabIndex={1} readOnly />
<table cellPadding={5} cellSpacing={0}></table>Configuration Examples
Basic Usage
{
rules: {
'react-features/no-unknown-property': 'error'
}
}Related Rules
no-invalid-html-attribute- Validate attribute values
Further Reading
- DOM Elements - React docs
- JSX Differences - HTML vs JSX
Known False Negatives
- An attribute name React does not know at all (
<div foo="x">) is not reported unless it is the HTML spelling of a React property: React 16+ passes unknown attributes through to the DOM. - Namespaced names (
xlink:href) are not checked. - Components and custom elements (
<my-widget>) take any prop and are never checked.
Use this rule
npm install -D oxlint-plugin-react-features{ "jsPlugins": ["oxlint-plugin-react-features"], "rules": { "react-features/no-unknown-property": "error" }}import { defineConfig } from 'vite-plus';export default defineConfig({ lint: { jsPlugins: ['oxlint-plugin-react-features'], rules: { 'react-features/no-unknown-property': 'error', }, },});oxlint-plugin-react-features re-exports eslint-plugin-react-features/oxlint: the same rules under the same IDs, and no ESLint install. Why oxlint.
Did this rule catch something? Star the repo to get new CWE coverage as we ship it — or follow the AI-code-security benchmarks behind these rules.