Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion crates/oxc_linter/src/rules/react/jsx_no_undef.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ pub struct JsxNoUndef;
declare_oxc_lint!(
/// ### What it does
///
/// Disallow undeclared variables in JSX
/// Disallow undeclared variables in JSX.
///
/// Note that this rule is generally unnecessary if you are using TypeScript, as
/// TypeScript will catch undeclared variables for you.
///
/// ### Why is this bad?
///
Expand Down
7 changes: 5 additions & 2 deletions crates/oxc_linter/src/rules/react/no_string_refs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,14 @@ pub struct NoStringRefs {
declare_oxc_lint!(
/// ### What it does
///
/// This rule prevents using string literals in ref attributes.
/// This rule prevents using the deprecated behavior of string literals in ref attributes.
///
/// ### Why is this bad?
///
/// Using string literals in ref attributes is deprecated in React.
/// Using string literals in ref attributes has been deprecated since React 16.3.0.
///
/// String refs are [removed entirely in React 19](https://react.dev/blog/2024/04/25/react-19-upgrade-guide#removed-string-refs),
/// and so this rule can be disabled if on React 19+.
///
/// ### Examples
///
Expand Down
13 changes: 13 additions & 0 deletions tasks/lint_rules/src/unsupported-rules.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,19 @@
"react/todo": "React Compiler rules will not be implemented in oxlint for now, as they require integration with the react compiler itself. These rules can be used via JS Plugins if desired.",
"react/void-use-memo": "React Compiler rules will not be implemented in oxlint for now, as they require integration with the react compiler itself. These rules can be used via JS Plugins if desired.",

"react/default-props-match-prop-types": "This rule only applies to legacy class components, which are not widely used in modern React. Also stylistic.",
"react/forbid-foreign-prop-types": "PropTypes are ignored in React 19, and this rule is only relevant for very specific use-cases involving it.",
"react/forbid-prop-types": "PropTypes are ignored in React 19, and this rule is only relevant if you use the PropTypes package.",
"react/no-access-state-in-setstate": "This rule only applies to legacy class components, which are not widely used in modern React.",
"react/no-unused-class-component-methods": "This rule only applies to legacy class components, which are not widely used in modern React. It is also complex to implement.",
"react/no-unused-state": "This rule only applies to legacy class components, which are not widely used in modern React. It is also complex to implement.",
"react/no-unused-prop-types": "PropTypes are ignored in React 19, and TypeScript + the `no-unused-vars` rule already catches unused props in most cases.",
"react/prefer-exact-props": "This rule is not relevant for TypeScript code, and PropTypes are ignored in React 19.",
"react/sort-comp": "This rule only applies to legacy class components, which are not widely used in modern React. Also stylistic.",
"react/sort-default-props": "`defaultProps` is removed entirely in React 19, this rule is no longer relevant. Also stylistic.",
"react/sort-prop-types": "PropTypes are ignored in React 19, and this rule is only relevant if you use the PropTypes package. Also stylistic.",
"react/static-property-placement": "This rule only applies to legacy class components, which are not widely used in modern React.",

"typescript/sort-type-constituents": "Deprecated, replaced by `perfectionist/sort-intersection-types` and `perfectionist/sort-union-types` rules.",
"typescript/no-type-alias": "Deprecated, replaced by `typescript-eslint/consistent-type-definitions` rule.",
"typescript/typedef": "Deprecated.",
Expand Down
Loading