Skip to content

Commit 62704ce

Browse files
manudeliTkDodo
andauthored
chore(integrations/react-*): add eslintrc to resolve error (TanStack#6749)
Co-authored-by: Dominik Dorfmeister <[email protected]>
1 parent c774772 commit 62704ce

File tree

17 files changed

+186
-3
lines changed

17 files changed

+186
-3
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/** @type {import('eslint').Linter.Config} */
2+
module.exports = {
3+
root: true,
4+
extends: [
5+
'../../.eslintrc.cjs',
6+
'plugin:react/recommended',
7+
'plugin:react-hooks/recommended',
8+
],
9+
parserOptions: {
10+
tsconfigRootDir: __dirname,
11+
project: './tsconfig.json',
12+
},
13+
settings: {
14+
react: {
15+
version: 'detect',
16+
},
17+
},
18+
}

integrations/react-cra4/src/App.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import React from 'react'
12
import { useQuery } from '@tanstack/react-query'
23

34
const App = () => {
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"compilerOptions": {
3+
"target": "ES2020",
4+
"lib": ["dom", "dom.iterable", "esnext"],
5+
"allowJs": true,
6+
"skipLibCheck": true,
7+
"esModuleInterop": true,
8+
"allowSyntheticDefaultImports": true,
9+
"strict": true,
10+
"forceConsistentCasingInFileNames": true,
11+
"noFallthroughCasesInSwitch": true,
12+
"module": "esnext",
13+
"moduleResolution": "node",
14+
"resolveJsonModule": true,
15+
"isolatedModules": true,
16+
"noEmit": true,
17+
"jsx": "react-jsx"
18+
},
19+
"include": ["src", ".eslintrc.cjs"]
20+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/** @type {import('eslint').Linter.Config} */
2+
module.exports = {
3+
root: true,
4+
extends: [
5+
'../../.eslintrc.cjs',
6+
'plugin:react/recommended',
7+
'plugin:react-hooks/recommended',
8+
],
9+
parserOptions: {
10+
tsconfigRootDir: __dirname,
11+
project: './tsconfig.json',
12+
},
13+
settings: {
14+
react: {
15+
version: 'detect',
16+
},
17+
},
18+
}

integrations/react-cra5/src/App.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import React from 'react'
12
import { useQuery } from '@tanstack/react-query'
23

34
const App = () => {
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"compilerOptions": {
3+
"target": "ES2020",
4+
"lib": ["dom", "dom.iterable", "esnext"],
5+
"allowJs": true,
6+
"skipLibCheck": true,
7+
"esModuleInterop": true,
8+
"allowSyntheticDefaultImports": true,
9+
"strict": true,
10+
"forceConsistentCasingInFileNames": true,
11+
"noFallthroughCasesInSwitch": true,
12+
"module": "esnext",
13+
"moduleResolution": "node",
14+
"resolveJsonModule": true,
15+
"isolatedModules": true,
16+
"noEmit": true,
17+
"jsx": "react-jsx"
18+
},
19+
"include": ["src", ".eslintrc.cjs"]
20+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/** @type {import('eslint').Linter.Config} */
2+
module.exports = {
3+
root: true,
4+
extends: [
5+
'../../.eslintrc.cjs',
6+
'plugin:react/recommended',
7+
'plugin:react-hooks/recommended',
8+
],
9+
parserOptions: {
10+
tsconfigRootDir: __dirname,
11+
project: './tsconfig.json',
12+
},
13+
settings: {
14+
react: {
15+
version: 'detect',
16+
},
17+
},
18+
}

integrations/react-next/app/client-component.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
'use client'
22

3+
import React from 'react'
34
import { useQuery } from '@tanstack/react-query'
45

56
export function ClientComponent() {

integrations/react-next/app/layout.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import type { Metadata } from 'next'
1+
import React from 'react'
22
import Providers from './providers'
3+
import type { Metadata } from 'next'
34

45
export const metadata: Metadata = {
56
title: 'Create Next App',

integrations/react-next/app/page.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import { ClientComponent } from '@/app/client-component'
1+
import React from 'react'
22
import { queryOptions } from '@tanstack/react-query'
3+
import { ClientComponent } from './client-component'
34

45
const options = queryOptions({
56
queryKey: ['foo'],

0 commit comments

Comments
 (0)