react/no-typos
eslint-plugin-react
No autofix
eslint.config.js
import react from "eslint-plugin-react";
export default [
{
plugins: { react },
rules: {
"react/no-typos": "error",
},
},
];class MyComponent extends React.Component {
static PropTypes = {}
}
class MyComponent extends React.Component {
static proptypes = {}
}
class MyComponent extends React.Component {
static ContextTypes = {}
}
class MyComponent extends React.Component {
static contexttypes = {}
}
class MyComponent extends React.Component {
static ChildContextTypes = {}
}
class MyComponent extends React.Component {
static childcontexttypes = {}
}
class MyComponent extends React.Component {
static DefaultProps = {}
}
class MyComponent extends React.Component {
static defaultprops = {}
}
// …class MyComponent extends React.Component {
static propTypes = {}
}
class MyComponent extends React.Component {
static contextTypes = {}
}
class MyComponent extends React.Component {
static childContextTypes = {}
}
class MyComponent extends React.Component {
static defaultProps = {}
}
class MyComponent extends React.Component {
componentWillMount() {}
}
class MyComponent extends React.Component {
componentWillReceiveProps() {}
}
class MyComponent extends React.Component {
componentDidUpdate() {}
}
class MyComponent extends React.Component {
static propTypes = {
a: PropTypes.bool.isRequired
}
// …Examples from the ESLint documentation.
react/no-typos
eslint-plugin-react
import react from "eslint-plugin-react";
export default [
{
plugins: { react },
rules: {
"react/no-typos": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Prevent common typos in Next.js data fetching functions.
Disallow using another component's propTypes
Enforce PascalCase for user-defined JSX components
Disallow extra closing tags for components without children
Enforce shorthand or standard form for React fragments