Skip to content

Commit 77813f0

Browse files
committed
[Docs] improve instructions for jsx-runtime config
Closes #3052
1 parent d74a7d8 commit 77813f0

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ This change log adheres to standards from [Keep a CHANGELOG](http://keepachangel
2929
* [Docs] [`jsx-uses-react`], [`react-in-jsx-scope`]: document [`react/jsx-runtime`] config ([#3018][] @pkuczynski @ljharb)
3030
* [Docs] [`require-default-props`]: fix small typo ([#2994][] @evsasse)
3131
* [Tests] add weekly scheduled smoke tests ([#2963][] @AriPerkkio)
32+
* [Docs] improve instructions for `jsx-runtime` config ([#3052][] @ljharb)
3233

34+
[#3052]: https://github.com/yannickcr/eslint-plugin-react/issues/3052
3335
[#3049]: https://github.com/yannickcr/eslint-plugin-react/pull/3049
3436
[#3048]: https://github.com/yannickcr/eslint-plugin-react/pull/3048
3537
[#3043]: https://github.com/yannickcr/eslint-plugin-react/issues/3043

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Use [our preset](#recommended) to get reasonable defaults:
3131
]
3232
```
3333

34-
If you are using the [new JSX transform from React 17](https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html#removing-unused-react-imports), extend [`react/jsx-runtime`](https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/index.js#L163-L176) in your eslint config to disable the relevant rules.
34+
If you are using the [new JSX transform from React 17](https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html#removing-unused-react-imports), extend [`react/jsx-runtime`](https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/index.js#L163-L176) in your eslint config (add `"plugin:react/jsx-runtime"` to `"extends"`) to disable the relevant rules.
3535

3636
You should also specify settings that will be shared across all the plugin rules. ([More about eslint shared settings](https://eslint.org/docs/user-guide/configuring/configuration-files#adding-shared-settings))
3737

docs/rules/jsx-uses-react.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,4 @@ var Hello = <div>Hello {this.props.name}</div>;
4545

4646
If you are not using JSX, if React is declared as global variable, or if you do not use the `no-unused-vars` rule.
4747

48-
If you are using the [new JSX transform from React 17](https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html#removing-unused-react-imports), you should disable this rule by extending [`react/jsx-runtime`](https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/index.js#L163-L176) in your eslint config.
48+
If you are using the [new JSX transform from React 17](https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html#removing-unused-react-imports), you should disable this rule by extending [`react/jsx-runtime`](https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/index.js#L163-L176) in your eslint config (add `"plugin:react/jsx-runtime"` to `"extends"`).

docs/rules/react-in-jsx-scope.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ var Hello = <div>Hello {this.props.name}</div>;
4444

4545
If you are not using JSX, or if you are setting `React` as a global variable.
4646

47-
If you are using the [new JSX transform from React 17](https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html#removing-unused-react-imports), you should disable this rule by extending [`react/jsx-runtime`](https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/index.js#L163-L176) in your eslint config.
47+
If you are using the [new JSX transform from React 17](https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html#removing-unused-react-imports), you should disable this rule by extending [`react/jsx-runtime`](https://github.com/yannickcr/eslint-plugin-react/blob/HEAD/index.js#L163-L176) in your eslint config (add `"plugin:react/jsx-runtime"` to `"extends"`).

0 commit comments

Comments
 (0)