react/forbid-foreign-prop-types
eslint-plugin-react
No autofix
eslint.config.js
import react from "eslint-plugin-react";
export default [
{
plugins: { react },
rules: {
"react/forbid-foreign-prop-types": "error",
},
},
];import SomeComponent from './SomeComponent';
SomeComponent.propTypes;
var { propTypes } = SomeComponent;
SomeComponent['propTypes'];import SomeComponent, {propTypes as someComponentPropTypes} from './SomeComponent';Examples from the ESLint documentation.
react/forbid-foreign-prop-types
eslint-plugin-react
import react from "eslint-plugin-react";
export default [
{
plugins: { react },
rules: {
"react/forbid-foreign-prop-types": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Enforce PascalCase for user-defined JSX components
Disallow extra closing tags for components without children
Enforce shorthand or standard form for React fragments
Disallow .bind() or arrow functions in JSX props