What's Changed
🪄 Improvements
- Deprecated
no-default-propsrule by @Rel1cx in #1464 - Deprecated
no-prop-typesrule by @Rel1cx in #1464 - Deprecated
no-string-refsrule by @Rel1cx in #1464
📝 Changes you should be aware of
The following rules have been deprecated:
no-default-propsno-prop-typesno-string-refs
If you are working with legacy codebases that still require these rules, you can use a no-restricted-syntax rule to enforce these restrictions:
{
files: ['**/*.jsx', '**/*.tsx'],
rules: {
"no-restricted-syntax": [
"error",
{
"selector": "AssignmentExpression[operator='='][left.property.name='defaultProps']",
"message": "[Deprecated] Use ES6 default parameters instead."
},
{
"selector": "AssignmentExpression[operator='='][left.property.name='propTypes']",
"message": "[Deprecated] Use TypeScript or another type-checking solution instead."
},
{
"selector": "JSXAttribute[name.name='ref'][value.type='Literal']",
"message": "[Deprecated] Use callback refs instead."
}
]
}
}
(The rules that were deprecated in this release will still be available until the next major update to avoid breaking changes.)
Full Changelog: v2.9.2...v2.9.3