static-property-placement
UnreleasedConfiguration
rslint.config.ts
Enforce where React component static properties are declared in an ES6 class.
The rule checks childContextTypes, contextTypes, contextType,
defaultProps (including legacy getDefaultProps), displayName, and
propTypes. The default placement is static public field.
Component detection follows eslint-plugin-react, including settings.react.pragma,
file-level @jsx comments, and adjacent JSDoc @extends React.Component or
@augments React.PureComponent markers. For class expressions assigned to a
variable, put the JSDoc before the variable declaration:
Options
The first option selects the default placement:
static public field—static propTypes = {...}static getter—static get propTypes() {...}property assignment—MyComponent.propTypes = {...}outside the class
The second option is an object that overrides the placement for individual properties. Unspecified properties use the first option.