Skip to content

Commit

Permalink
chore: fix "react-in-jsx-scope" ESLint errors
Browse files Browse the repository at this point in the history
This fixes all 50 violations of the [`react/react-in-jsx-scope`][0] lint
rule.

In the docs for that rule:

> If you are using the [new JSX transform from React 17][1], you should
> disable this rule by extending `react/jsx-runtime` in your eslint
> config (add `"plugin:react/jsx-runtime"` to `"extends"`).

We are, so we can do this! It also lets us remove many `React` imports.

[0]: https://github.com/jsx-eslint/eslint-plugin-react/blob/4467db503e38b9356517cf6926d11be544ccf4b1/docs/rules/react-in-jsx-scope.md
[1]: https://legacy.reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html
  • Loading branch information
EvanHahn committed Apr 21, 2024
1 parent 92fc7f4 commit 8dcf2ea
Show file tree
Hide file tree
Showing 47 changed files with 862 additions and 223 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
root: true,
extends: ['@react-native', 'prettier'],
extends: ['@react-native', 'plugin:react/jsx-runtime', 'prettier'],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
overrides: [
Expand Down
Loading

0 comments on commit 8dcf2ea

Please sign in to comment.