-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Fix] jsx-no-constructed-context-values
: detect constructed context values in React 19 <Context>
usage
#3910
[Fix] jsx-no-constructed-context-values
: detect constructed context values in React 19 <Context>
usage
#3910
Conversation
… values in React 19 `<Context>` usage
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3910 +/- ##
==========================================
+ Coverage 94.21% 97.80% +3.59%
==========================================
Files 133 133
Lines 9966 9991 +25
Branches 3703 3715 +12
==========================================
+ Hits 9389 9772 +383
+ Misses 577 219 -358 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there's an uncovered line
The codecov check is stuck, so I can't confirm if the coverage has improved. Is there a way to rerun it without pushing code? |
1fe341a
to
b81c370
Compare
b81c370
to
ddefdce
Compare
I had to rebase it anyways, so no worries :-) hopefully it won't be stuck this time. Thanks! |
jsx-no-constructed-context-values
: detect constructed context values in React 19 <Context>
usage
5bf8e89
to
08d3ac8
Compare
2f3afb0
to
2428618
Compare
| datasource | package | from | to | | ---------- | ------------------- | ------ | ------ | | npm | eslint-plugin-react | 7.37.4 | 7.37.5 | ## [v7.37.5](https://github.com/jsx-eslint/eslint-plugin-react/blob/HEAD/CHANGELOG.md#7375---20250403) ##### Fixed - \[`no-unknown-property`]: allow shadow root attrs on `<template>` ([#3912][] [@ljharb](https://github.com/ljharb)) - \[`prop-types`]: support `ComponentPropsWithRef` from a namespace import ([#3651][] [@corydeppen](https://github.com/corydeppen)) - \[`jsx-no-constructed-context-values`]: detect constructed context values in React 19 `<Context>` usage ([#3910][] [@TildaDares](https://github.com/TildaDares)) - \[`no-unknown-property`]: allow `transform-origin` on `rect` ([#3914][] [@ljharb](https://github.com/ljharb)) ##### Changed - \[Docs] \[`button-has-type`]: clean up phrasing ([#3909][] [@hamirmahal](https://github.com/hamirmahal)) [7.37.5]: jsx-eslint/eslint-plugin-react@v7.37.4...v7.37.5 [#3914]: jsx-eslint/eslint-plugin-react#3914 [#3912]: jsx-eslint/eslint-plugin-react#3912 [#3910]: jsx-eslint/eslint-plugin-react#3910 [#3909]: jsx-eslint/eslint-plugin-react#3909 [#3651]: jsx-eslint/eslint-plugin-react#3651
| datasource | package | from | to | | ---------- | ------------------- | ------ | ------ | | npm | eslint-plugin-react | 7.37.4 | 7.37.5 | ## [v7.37.5](https://github.com/jsx-eslint/eslint-plugin-react/blob/HEAD/CHANGELOG.md#7375---20250403) ##### Fixed - \[`no-unknown-property`]: allow shadow root attrs on `<template>` ([#3912][] [@ljharb](https://github.com/ljharb)) - \[`prop-types`]: support `ComponentPropsWithRef` from a namespace import ([#3651][] [@corydeppen](https://github.com/corydeppen)) - \[`jsx-no-constructed-context-values`]: detect constructed context values in React 19 `<Context>` usage ([#3910][] [@TildaDares](https://github.com/TildaDares)) - \[`no-unknown-property`]: allow `transform-origin` on `rect` ([#3914][] [@ljharb](https://github.com/ljharb)) ##### Changed - \[Docs] \[`button-has-type`]: clean up phrasing ([#3909][] [@hamirmahal](https://github.com/hamirmahal)) [7.37.5]: jsx-eslint/eslint-plugin-react@v7.37.4...v7.37.5 [#3914]: jsx-eslint/eslint-plugin-react#3914 [#3912]: jsx-eslint/eslint-plugin-react#3912 [#3910]: jsx-eslint/eslint-plugin-react#3910 [#3909]: jsx-eslint/eslint-plugin-react#3909 [#3651]: jsx-eslint/eslint-plugin-react#3651
| datasource | package | from | to | | ---------- | ------------------- | ------ | ------ | | npm | eslint-plugin-react | 7.37.4 | 7.37.5 | ## [v7.37.5](https://github.com/jsx-eslint/eslint-plugin-react/blob/HEAD/CHANGELOG.md#7375---20250403) ##### Fixed - \[`no-unknown-property`]: allow shadow root attrs on `<template>` ([#3912][] [@ljharb](https://github.com/ljharb)) - \[`prop-types`]: support `ComponentPropsWithRef` from a namespace import ([#3651][] [@corydeppen](https://github.com/corydeppen)) - \[`jsx-no-constructed-context-values`]: detect constructed context values in React 19 `<Context>` usage ([#3910][] [@TildaDares](https://github.com/TildaDares)) - \[`no-unknown-property`]: allow `transform-origin` on `rect` ([#3914][] [@ljharb](https://github.com/ljharb)) ##### Changed - \[Docs] \[`button-has-type`]: clean up phrasing ([#3909][] [@hamirmahal](https://github.com/hamirmahal)) [7.37.5]: jsx-eslint/eslint-plugin-react@v7.37.4...v7.37.5 [#3914]: jsx-eslint/eslint-plugin-react#3914 [#3912]: jsx-eslint/eslint-plugin-react#3912 [#3910]: jsx-eslint/eslint-plugin-react#3910 [#3909]: jsx-eslint/eslint-plugin-react#3909 [#3651]: jsx-eslint/eslint-plugin-react#3651
@@ -33,6 +43,11 @@ return ( | |||
) | |||
``` | |||
|
|||
```jsx | |||
const SomeContext = createContext(); | |||
const Component = () => <SomeContext value="Some string"><SomeContext>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a slash missing in closing <SomeContext>
-> </SomeContext>
.
Fixes #3888
This PR updates the
jsx-no-constructed-context-values
rule to support React 19-style context providers using the shorthand.