Skip to content

Commit 049d58b

Browse files
chore: Update prettier, eslint, rollup, scripts (#5490)
1 parent d1b001a commit 049d58b

File tree

74 files changed

+554
-560
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+554
-560
lines changed

.codesandbox/ci.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
{
22
"installCommand": "install:csb",
3-
"sandboxes": ["/examples/react/basic-typescript", "/examples/solid/basic-typescript", "/examples/svelte/basic", "/examples/vue/basic"],
3+
"sandboxes": [
4+
"/examples/react/basic-typescript",
5+
"/examples/solid/basic-typescript",
6+
"/examples/svelte/basic",
7+
"/examples/vue/basic"
8+
],
49
"packages": ["packages/**"],
510
"node": "16"
611
}

.eslintrc.cjs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// @ts-check
22

33
/** @type {import('eslint').Linter.Config} */
4-
module.exports = {
4+
const config = {
55
root: true,
66
parser: '@typescript-eslint/parser',
77
plugins: ['@typescript-eslint', 'import'],
@@ -36,7 +36,8 @@ module.exports = {
3636
'@typescript-eslint/ban-types': 'off',
3737
'@typescript-eslint/ban-ts-comment': 'off',
3838
'@typescript-eslint/consistent-type-imports': [
39-
'error', { prefer: 'type-imports' }
39+
'error',
40+
{ prefer: 'type-imports' },
4041
],
4142
'@typescript-eslint/explicit-module-boundary-types': 'off',
4243
'@typescript-eslint/no-empty-interface': 'off',
@@ -45,10 +46,12 @@ module.exports = {
4546
'@typescript-eslint/no-unnecessary-condition': 'error',
4647
'@typescript-eslint/no-unnecessary-type-assertion': 'error',
4748
'@typescript-eslint/no-inferrable-types': [
48-
'error', { ignoreParameters: true },
49+
'error',
50+
{ ignoreParameters: true },
4951
],
5052
'import/default': 'off',
5153
'import/export': 'off',
54+
'import/newline-after-import': 'error',
5255
'import/no-cycle': 'error',
5356
'import/no-duplicates': 'off',
5457
'import/no-unresolved': ['error', { ignore: ['^@tanstack/'] }],
@@ -65,3 +68,5 @@ module.exports = {
6568
},
6669
],
6770
}
71+
72+
module.exports = config

.prettierignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
/packages/svelte-query/.svelte-kit
2-
/packages/react-query/build
1+
**/.next
2+
**/.svelte-kit
3+
**/build
4+
**/dist
35
/packages/codemods/**/__testfixtures__

CONTRIBUTING.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,17 @@ If you have been assigned to fix an issue or develop a new feature, please follo
2727
- Submit PR for review.
2828

2929
### Running examples
30+
3031
- Make sure you've installed the dependencies by running `$ pnpm install` in the repo's root directory.
3132
- If you want to run the example against your local changes, run `pnpm run watch` in the repo's root directory. Otherwise, it will be run against the latest TanStack Query release.
3233
- Run `pnpm run dev` in the selected examples' directory.
3334

3435
#### Note on `examples/react-native`
36+
3537
React Native example requires Expo to work. Please follow the instructions from example's README.md file to learn more.
3638

3739
#### Note on standalone execution
40+
3841
If you want to run an example without installing dependencies for the whole repo, just follow instructions from the example's README.md file. It will be then run against the latest TanStack Query release.
3942

4043
## Online one-click setup

examples/react/algolia/tsconfig.json

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
{
22
"compilerOptions": {
33
"target": "ES2020",
4-
"lib": [
5-
"dom",
6-
"dom.iterable",
7-
"esnext"
8-
],
4+
"lib": ["dom", "dom.iterable", "esnext"],
95
"allowJs": true,
106
"skipLibCheck": true,
117
"esModuleInterop": true,
@@ -20,7 +16,5 @@
2016
"noEmit": true,
2117
"jsx": "react-jsx"
2218
},
23-
"include": [
24-
"src"
25-
]
19+
"include": ["src"]
2620
}

examples/react/auto-refetching/pages/api/data.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default async (req, res) => {
1010
list = []
1111
}
1212

13-
await new Promise(r => setTimeout(r, 100))
13+
await new Promise((r) => setTimeout(r, 100))
1414

1515
res.json(list)
1616
}
Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
{
22
"compilerOptions": {
33
"target": "ES2020",
4-
"lib": [
5-
"dom",
6-
"dom.iterable",
7-
"esnext"
8-
],
4+
"lib": ["dom", "dom.iterable", "esnext"],
95
"allowJs": true,
106
"skipLibCheck": true,
117
"esModuleInterop": true,
@@ -20,7 +16,5 @@
2016
"noEmit": true,
2117
"jsx": "react-jsx"
2218
},
23-
"include": [
24-
"src"
25-
]
19+
"include": ["src"]
2620
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { defineConfig } from 'vite'
2-
import react from '@vitejs/plugin-react'
1+
import { defineConfig } from "vite";
2+
import react from "@vitejs/plugin-react";
33

44
// https://vitejs.dev/config/
55
export default defineConfig({
6-
plugins: [react()]
7-
})
6+
plugins: [react()],
7+
});

examples/react/load-more-infinite-scroll/pages/about.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export default () => {
22
return (
33
<a
44
href=""
5-
onClick={e => {
5+
onClick={(e) => {
66
window.history.back()
77
e.preventDefault()
88
}}

examples/react/load-more-infinite-scroll/pages/index.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,7 @@ function Example() {
109109
</>
110110
)}
111111
<hr />
112-
<Link href="/about">
113-
Go to another page
114-
</Link>
112+
<Link href="/about">Go to another page</Link>
115113
<ReactQueryDevtools initialIsOpen />
116114
</div>
117115
)

examples/react/nextjs/components/Header/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ export const Header = () => {
1010
<Link href="/" className={pathname === '/' ? 'is-active' : ''}>
1111
Home
1212
</Link>
13-
<Link href="/client-only" className={pathname === '/client-only' ? 'is-active' : ''}>
13+
<Link
14+
href="/client-only"
15+
className={pathname === '/client-only' ? 'is-active' : ''}
16+
>
1417
Client-Only
1518
</Link>
1619
<style jsx>{`

0 commit comments

Comments
 (0)