Skip to content

Commit

Permalink
chore: Use plugin:react/jsx-runtime config (#6868)
Browse files Browse the repository at this point in the history
* chore: Replace plugin:react/recommended with plugin:react/jsx-runtime

* Remove unused namespace import

* Fix tsconfig jsx field
  • Loading branch information
lachlancollins committed Feb 10, 2024
1 parent 1bb8ec7 commit 9b496bf
Show file tree
Hide file tree
Showing 26 changed files with 24 additions and 46 deletions.
2 changes: 1 addition & 1 deletion examples/react/algolia/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extends": [
"plugin:react/recommended",
"plugin:react/jsx-runtime",
"plugin:react-hooks/recommended",
"plugin:@tanstack/eslint-plugin-query/recommended"
]
Expand Down
2 changes: 1 addition & 1 deletion examples/react/basic-graphql-request/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": ["plugin:react/recommended", "plugin:react-hooks/recommended"]
"extends": ["plugin:react/jsx-runtime", "plugin:react-hooks/recommended"]
}
2 changes: 1 addition & 1 deletion examples/react/basic-typescript/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extends": [
"plugin:react/recommended",
"plugin:react/jsx-runtime",
"plugin:react-hooks/recommended",
"plugin:@tanstack/eslint-plugin-query/recommended"
]
Expand Down
2 changes: 1 addition & 1 deletion examples/react/basic/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extends": [
"plugin:react/recommended",
"plugin:react/jsx-runtime",
"plugin:react-hooks/recommended",
"plugin:@tanstack/eslint-plugin-query/recommended"
]
Expand Down
2 changes: 1 addition & 1 deletion examples/react/default-query-function/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": ["plugin:react/recommended", "plugin:react-hooks/recommended"]
"extends": ["plugin:react/jsx-runtime", "plugin:react-hooks/recommended"]
}
2 changes: 1 addition & 1 deletion examples/react/offline/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": ["plugin:react/recommended", "plugin:react-hooks/recommended"]
"extends": ["plugin:react/jsx-runtime", "plugin:react-hooks/recommended"]
}
2 changes: 1 addition & 1 deletion examples/react/playground/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": ["plugin:react/recommended", "plugin:react-hooks/recommended"]
"extends": ["plugin:react/jsx-runtime", "plugin:react-hooks/recommended"]
}
2 changes: 1 addition & 1 deletion examples/react/react-router/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": ["plugin:react/recommended", "plugin:react-hooks/recommended"]
"extends": ["plugin:react/jsx-runtime", "plugin:react-hooks/recommended"]
}
2 changes: 1 addition & 1 deletion examples/react/rick-morty/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": ["plugin:react/recommended", "plugin:react-hooks/recommended"]
"extends": ["plugin:react/jsx-runtime", "plugin:react-hooks/recommended"]
}
2 changes: 1 addition & 1 deletion examples/react/simple/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": ["plugin:react/recommended", "plugin:react-hooks/recommended"]
"extends": ["plugin:react/jsx-runtime", "plugin:react-hooks/recommended"]
}
2 changes: 1 addition & 1 deletion examples/react/star-wars/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": ["plugin:react/recommended", "plugin:react-hooks/recommended"]
"extends": ["plugin:react/jsx-runtime", "plugin:react-hooks/recommended"]
}
2 changes: 1 addition & 1 deletion examples/react/suspense/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": ["plugin:react/recommended", "plugin:react-hooks/recommended"]
"extends": ["plugin:react/jsx-runtime", "plugin:react-hooks/recommended"]
}
7 changes: 1 addition & 6 deletions integrations/react-cra4/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
/** @type {import('eslint').Linter.Config} */
module.exports = {
root: true,
extends: [
'../../.eslintrc.cjs',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
],
extends: ['plugin:react/jsx-runtime', 'plugin:react-hooks/recommended'],
settings: {
react: {
version: 'detect',
Expand Down
7 changes: 1 addition & 6 deletions integrations/react-cra5/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
/** @type {import('eslint').Linter.Config} */
module.exports = {
root: true,
extends: [
'../../.eslintrc.cjs',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
],
extends: ['plugin:react/jsx-runtime', 'plugin:react-hooks/recommended'],
settings: {
react: {
version: 'detect',
Expand Down
7 changes: 1 addition & 6 deletions integrations/react-next/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
/** @type {import('eslint').Linter.Config} */
module.exports = {
root: true,
extends: [
'../../.eslintrc.cjs',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
],
extends: ['plugin:react/jsx-runtime', 'plugin:react-hooks/recommended'],
settings: {
react: {
version: 'detect',
Expand Down
7 changes: 1 addition & 6 deletions integrations/react-vite/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
/** @type {import('eslint').Linter.Config} */
module.exports = {
root: true,
extends: [
'../../.eslintrc.cjs',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
],
extends: ['plugin:react/jsx-runtime', 'plugin:react-hooks/recommended'],
settings: {
react: {
version: 'detect',
Expand Down
2 changes: 1 addition & 1 deletion packages/react-query-devtools/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/** @type {import('eslint').Linter.Config} */
const config = {
extends: ['plugin:react/recommended', 'plugin:react-hooks/recommended'],
extends: ['plugin:react/jsx-runtime', 'plugin:react-hooks/recommended'],
rules: {
'react/jsx-key': ['error', { checkFragmentShorthand: true }],
'react-hooks/exhaustive-deps': 'error',
Expand Down
2 changes: 1 addition & 1 deletion packages/react-query-devtools/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"jsx": "react"
"jsx": "react-jsx"
},
"include": [
"src/**/*.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-query-next-experimental/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/** @type {import('eslint').Linter.Config} */
const config = {
extends: ['plugin:react/recommended', 'plugin:react-hooks/recommended'],
extends: ['plugin:react/jsx-runtime', 'plugin:react-hooks/recommended'],
rules: {
'react/jsx-key': ['error', { checkFragmentShorthand: true }],
'react-hooks/exhaustive-deps': 'error',
Expand Down
2 changes: 1 addition & 1 deletion packages/react-query-next-experimental/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"jsx": "react"
"jsx": "react-jsx"
},
"include": [
"src/**/*.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-query-persist-client/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/** @type {import('eslint').Linter.Config} */
const config = {
extends: ['plugin:react/recommended', 'plugin:react-hooks/recommended'],
extends: ['plugin:react/jsx-runtime', 'plugin:react-hooks/recommended'],
rules: {
'react/jsx-key': ['error', { checkFragmentShorthand: true }],
'react-hooks/exhaustive-deps': 'error',
Expand Down
2 changes: 1 addition & 1 deletion packages/react-query-persist-client/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"jsx": "react"
"jsx": "react-jsx"
},
"include": [
"src/**/*.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-query/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/** @type {import('eslint').Linter.Config} */
const config = {
extends: ['plugin:react/recommended', 'plugin:react-hooks/recommended'],
extends: ['plugin:react/jsx-runtime', 'plugin:react-hooks/recommended'],
rules: {
'react/jsx-key': ['error', { checkFragmentShorthand: true }],
'react-hooks/exhaustive-deps': 'error',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { describe, expect, test } from 'vitest'
import * as React from 'react'
import { render, waitFor } from '@testing-library/react'

import { vi } from 'vitest'
Expand Down
1 change: 0 additions & 1 deletion packages/react-query/src/__tests__/ssr-hydration.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { afterAll, beforeAll, describe, expect, it, vi } from 'vitest'
import * as React from 'react'
import ReactDOM from 'react-dom'
import * as ReactDOMTestUtils from 'react-dom/test-utils'
import * as ReactDOMServer from 'react-dom/server'
Expand Down
2 changes: 1 addition & 1 deletion packages/react-query/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"jsx": "react"
"jsx": "react-jsx"
},
"include": [
"src/**/*.ts",
Expand Down

0 comments on commit 9b496bf

Please sign in to comment.