Skip to content
This repository was archived by the owner on Dec 19, 2025. It is now read-only.

Commit 5dd5e91

Browse files
committed
Format example-browser files
1 parent 8a06ef6 commit 5dd5e91

File tree

8 files changed

+146
-155
lines changed

8 files changed

+146
-155
lines changed
Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
module.exports = {
2-
env: { browser: true, es2020: true },
3-
extends: [
4-
'eslint:recommended',
5-
'plugin:@typescript-eslint/recommended',
6-
'plugin:react-hooks/recommended',
7-
],
8-
parser: '@typescript-eslint/parser',
9-
parserOptions: { ecmaVersion: 'latest', sourceType: 'module' },
10-
plugins: ['react-refresh'],
11-
rules: {
12-
'react-refresh/only-export-components': 'warn',
13-
},
2+
env: { browser: true, es2020: true },
3+
extends: [
4+
'eslint:recommended',
5+
'plugin:@typescript-eslint/recommended',
6+
'plugin:react-hooks/recommended',
7+
],
8+
parser: '@typescript-eslint/parser',
9+
parserOptions: { ecmaVersion: 'latest', sourceType: 'module' },
10+
plugins: ['react-refresh'],
11+
rules: {
12+
'react-refresh/only-export-components': 'warn',
13+
},
1414
}

packages/example-browser/.gitignore

Lines changed: 0 additions & 24 deletions
This file was deleted.
Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
{
2-
"name": "example-browser",
3-
"private": true,
4-
"version": "3.0.0",
5-
"type": "module",
6-
"scripts": {
7-
"dev": "vite",
8-
"build": "tsc && vite build",
9-
"lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
10-
"preview": "vite preview"
11-
},
12-
"dependencies": {
13-
"@version-checker/browser": "*",
14-
"react": "^18.2.0",
15-
"react-dom": "^18.2.0",
16-
"react-query": "^3.39.3"
17-
},
18-
"devDependencies": {
19-
"@types/react": "^18.0.37",
20-
"@types/react-dom": "^18.0.11",
21-
"@typescript-eslint/eslint-plugin": "^5.59.0",
22-
"@typescript-eslint/parser": "^5.59.0",
23-
"@vitejs/plugin-react": "^4.0.0",
24-
"eslint": "^8.38.0",
25-
"eslint-plugin-react-hooks": "^4.6.0",
26-
"eslint-plugin-react-refresh": "^0.3.4",
27-
"typescript": "^5.0.2",
28-
"vite": "^4.3.9"
29-
}
2+
"name": "example-browser",
3+
"private": true,
4+
"version": "3.0.0",
5+
"type": "module",
6+
"scripts": {
7+
"dev": "vite",
8+
"build": "tsc && vite build",
9+
"lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
10+
"preview": "vite preview"
11+
},
12+
"dependencies": {
13+
"@version-checker/browser": "*",
14+
"react": "^18.2.0",
15+
"react-dom": "^18.2.0",
16+
"react-query": "^3.39.3"
17+
},
18+
"devDependencies": {
19+
"@types/react": "^18.0.37",
20+
"@types/react-dom": "^18.0.11",
21+
"@typescript-eslint/eslint-plugin": "^5.59.0",
22+
"@typescript-eslint/parser": "^5.59.0",
23+
"@vitejs/plugin-react": "^4.0.0",
24+
"eslint": "^8.38.0",
25+
"eslint-plugin-react-hooks": "^4.6.0",
26+
"eslint-plugin-react-refresh": "^0.3.4",
27+
"typescript": "^5.0.2",
28+
"vite": "^4.3.9"
29+
}
3030
}

packages/example-browser/src/App.tsx

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ function App() {
1717
error,
1818
isFetching,
1919
refetch
20-
} = useQuery<CheckResult['update'], any, CheckResult['update'], any>({
20+
} = useQuery<CheckResult['update'], any, CheckResult['update'], any>({
2121
queryKey: ['updater'],
2222
queryFn: async () => {
2323
const { update } = await versionCheck({
@@ -68,21 +68,21 @@ function App() {
6868
<span>Error: {error.message}</span>
6969
) : (
7070
<>
71-
<div>
72-
{data === undefined ?
73-
(
74-
<p>
75-
No update found.
76-
</p>
77-
) :
78-
(
79-
<p>
80-
<b>{data?.name}</b>
81-
</p>
82-
)
83-
}
84-
</div>
85-
<div>{isFetching ? 'Fetching...' : null}</div>
71+
<div>
72+
{data === undefined ?
73+
(
74+
<p>
75+
No update found.
76+
</p>
77+
) :
78+
(
79+
<p>
80+
<b>{data?.name}</b>
81+
</p>
82+
)
83+
}
84+
</div>
85+
<div>{isFetching ? 'Fetching...' : null}</div>
8686
</>
8787
)}
8888

packages/example-browser/src/index.css

Lines changed: 48 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,76 @@
11
:root {
2-
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
3-
line-height: 1.5;
4-
font-weight: 400;
2+
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
3+
line-height: 1.5;
4+
font-weight: 400;
55

6-
color-scheme: light dark;
7-
color: rgba(255, 255, 255, 0.87);
8-
background-color: #242424;
6+
color-scheme: light dark;
7+
color: rgba(255, 255, 255, 0.87);
8+
background-color: #242424;
99

10-
font-synthesis: none;
11-
text-rendering: optimizeLegibility;
12-
-webkit-font-smoothing: antialiased;
13-
-moz-osx-font-smoothing: grayscale;
14-
-webkit-text-size-adjust: 100%;
10+
font-synthesis: none;
11+
text-rendering: optimizeLegibility;
12+
-webkit-font-smoothing: antialiased;
13+
-moz-osx-font-smoothing: grayscale;
14+
-webkit-text-size-adjust: 100%;
1515
}
1616

1717
a {
18-
font-weight: 500;
19-
color: #646cff;
20-
text-decoration: inherit;
18+
font-weight: 500;
19+
color: #646cff;
20+
text-decoration: inherit;
2121
}
22+
2223
a:hover {
23-
color: #535bf2;
24+
color: #535bf2;
2425
}
2526

2627
body {
27-
margin: 0;
28-
display: flex;
29-
place-items: center;
30-
min-width: 320px;
31-
min-height: 100vh;
28+
margin: 0;
29+
display: flex;
30+
place-items: center;
31+
min-width: 320px;
32+
min-height: 100vh;
3233
}
3334

3435
h1 {
35-
font-size: 3.2em;
36-
line-height: 1.1;
36+
font-size: 3.2em;
37+
line-height: 1.1;
3738
}
3839

3940
button {
40-
border-radius: 8px;
41-
border: 1px solid transparent;
42-
padding: 0.6em 1.2em;
43-
font-size: 1em;
44-
font-weight: 500;
45-
font-family: inherit;
46-
background-color: #1a1a1a;
47-
cursor: pointer;
48-
transition: border-color 0.25s;
41+
border-radius: 8px;
42+
border: 1px solid transparent;
43+
padding: 0.6em 1.2em;
44+
font-size: 1em;
45+
font-weight: 500;
46+
font-family: inherit;
47+
background-color: #1a1a1a;
48+
cursor: pointer;
49+
transition: border-color 0.25s;
4950
}
51+
5052
button:hover {
51-
border-color: #646cff;
53+
border-color: #646cff;
5254
}
55+
5356
button:focus,
5457
button:focus-visible {
55-
outline: 4px auto -webkit-focus-ring-color;
58+
outline: 4px auto -webkit-focus-ring-color;
5659
}
5760

5861
@media (prefers-color-scheme: light) {
59-
:root {
60-
color: #213547;
61-
background-color: #ffffff;
62-
}
63-
a:hover {
64-
color: #747bff;
65-
}
66-
button {
67-
background-color: #f9f9f9;
68-
}
62+
:root {
63+
color: #213547;
64+
background-color: #ffffff;
65+
}
66+
67+
a:hover {
68+
color: #747bff;
69+
}
70+
71+
button {
72+
background-color: #f9f9f9;
73+
}
6974
}
7075

7176
button:disabled {
Lines changed: 31 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,33 @@
11
{
2-
"compilerOptions": {
3-
"target": "ES2020",
4-
"useDefineForClassFields": true,
5-
"lib": ["ES2020", "DOM", "DOM.Iterable"],
6-
"module": "ESNext",
7-
"skipLibCheck": true,
8-
9-
/* Bundler mode */
10-
"moduleResolution": "bundler",
11-
"allowImportingTsExtensions": true,
12-
"resolveJsonModule": true,
13-
"isolatedModules": true,
14-
"noEmit": true,
15-
"jsx": "react-jsx",
16-
17-
/* Linting */
18-
"strict": true,
19-
"noUnusedLocals": true,
20-
"noUnusedParameters": true,
21-
"noFallthroughCasesInSwitch": true
22-
},
23-
"include": ["src"],
24-
"references": [{ "path": "./tsconfig.node.json" }]
2+
"compilerOptions": {
3+
"target": "ES2020",
4+
"useDefineForClassFields": true,
5+
"lib": [
6+
"ES2020",
7+
"DOM",
8+
"DOM.Iterable"
9+
],
10+
"module": "ESNext",
11+
"skipLibCheck": true,
12+
/* Bundler mode */
13+
"moduleResolution": "bundler",
14+
"allowImportingTsExtensions": true,
15+
"resolveJsonModule": true,
16+
"isolatedModules": true,
17+
"noEmit": true,
18+
"jsx": "react-jsx",
19+
/* Linting */
20+
"strict": true,
21+
"noUnusedLocals": true,
22+
"noUnusedParameters": true,
23+
"noFallthroughCasesInSwitch": true
24+
},
25+
"include": [
26+
"src"
27+
],
28+
"references": [
29+
{
30+
"path": "./tsconfig.node.json"
31+
}
32+
]
2533
}
Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
{
2-
"compilerOptions": {
3-
"composite": true,
4-
"skipLibCheck": true,
5-
"module": "ESNext",
6-
"moduleResolution": "bundler",
7-
"allowSyntheticDefaultImports": true
8-
},
9-
"include": ["vite.config.ts"]
2+
"compilerOptions": {
3+
"composite": true,
4+
"skipLibCheck": true,
5+
"module": "ESNext",
6+
"moduleResolution": "bundler",
7+
"allowSyntheticDefaultImports": true
8+
},
9+
"include": [
10+
"vite.config.ts"
11+
]
1012
}

packages/example-browser/vite.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ import react from '@vitejs/plugin-react'
33

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

0 commit comments

Comments
 (0)