Skip to content

Commit b767367

Browse files
committed
Pettier format
1 parent 2051756 commit b767367

27 files changed

+136
-118
lines changed

.prettierignore

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
node_modules
22
package-lock.json
3-
README.md
3+
README.md
4+
.next
5+
pnpm-lock.yaml
6+
dist
7+
storybook-static

.prettierrc

-11
This file was deleted.

.storybook/style.css

+6-4
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22
@tailwind components;
33
@tailwind utilities;
44

5-
html,body,#storybook-root {
6-
@apply h-full;
5+
html,
6+
body,
7+
#storybook-root {
8+
@apply h-full;
79
}
810
body {
9-
padding: 0 !important;
10-
}
11+
padding: 0 !important;
12+
}

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"postcss": "^8.4.23",
4545
"postcss-loader": "^7.2.4",
4646
"prettier": "^2.8.2",
47-
"prettier-plugin-tailwindcss": "^0.2.7",
47+
"prettier-plugin-tailwindcss": "^0.2.8",
4848
"react": "^18.2.0",
4949
"rollup": "^3.9.1",
5050
"rollup-plugin-peer-deps-external": "^2.2.4",

pnpm-lock.yaml

+23-18
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-workspace.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
packages:
22
- 'website'
3-
- '.'
3+
- '.'

postcss.config.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
export default {
22
plugins: {
3-
'tailwindcss/nesting': {},
43
tailwindcss: {},
54
autoprefixer: {}
65
}

prettier.config.cjs

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
module.exports = {
2+
jsxSingleQuote: true,
3+
jsxBracketSameLine: true,
4+
printWidth: 120,
5+
singleQuote: true,
6+
trailingComma: 'none',
7+
useTabs: true,
8+
tabWidth: 2,
9+
semi: false,
10+
arrowParens: 'avoid',
11+
bracketSameLine: true,
12+
plugins: [require('prettier-plugin-tailwindcss')]
13+
}

prettier.config.js

-3
This file was deleted.

src/components/json-node.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export default function JsonNode({ node, depth, deleteHandle: _deleteHandle, nam
7878

7979
if (editHandle) editHandle(name!, evalValue, node)
8080
} catch (e) {
81-
const trimmedStringValue = resolveEvalFailedNewValue(type, newValue);
81+
const trimmedStringValue = resolveEvalFailedNewValue(type, newValue)
8282
if (editHandle) editHandle(name!, trimmedStringValue, node)
8383
}
8484

src/utils.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export function customCopy(customOptions?: CustomizeOptions) {
9595

9696
export function resolveEvalFailedNewValue(type: string, value: string) {
9797
if (type === 'string') {
98-
return value.trim().replace(/^\"([\s\S]+?)\"$/, '$1');
98+
return value.trim().replace(/^\"([\s\S]+?)\"$/, '$1')
9999
}
100-
return value;
101-
}
100+
return value
101+
}

website/.prettierignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
node_modules
2+
package-lock.json
3+
README.md
4+
.next
5+
pnpm-lock.yaml
6+
dist
7+
storybook-static

website/.prettierrc

-11
This file was deleted.

website/package.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"dev": "next dev",
77
"build": "next build",
88
"start": "next start",
9-
"lint": "next lint"
9+
"lint": "next lint",
10+
"format": "prettier --write ."
1011
},
1112
"dependencies": {
1213
"@types/node": "20.5.9",
@@ -18,6 +19,8 @@
1819
"hljs": "^6.2.3",
1920
"next": "13.4.19",
2021
"postcss": "8.4.29",
22+
"prettier": "^2.8.2",
23+
"prettier-plugin-tailwindcss": "^0.2.8",
2124
"react": "18.2.0",
2225
"react-dom": "18.2.0",
2326
"react18-json-view": "workspace:*",

website/postcss.config.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = {
2-
plugins: {
3-
tailwindcss: {},
4-
autoprefixer: {},
5-
},
2+
plugins: {
3+
tailwindcss: {},
4+
autoprefixer: {}
5+
}
66
}

website/prettier.config.js

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
11
module.exports = {
2+
jsxSingleQuote: true,
3+
jsxBracketSameLine: true,
4+
printWidth: 120,
5+
singleQuote: true,
6+
trailingComma: 'none',
7+
useTabs: true,
8+
tabWidth: 2,
9+
semi: false,
10+
arrowParens: 'avoid',
11+
bracketSameLine: true,
212
plugins: [require('prettier-plugin-tailwindcss')]
313
}

website/src/app/footer.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
export default function Footer() {
22
return (
3-
<footer className=' bg-gray-100 dark:bg-transparent dark:border-t border-gray-100/10'>
4-
<div className='py-8 container flex items-center'>
5-
<img src='https://avatars.githubusercontent.com/u/53907086?v=4' className='w-6 h-6 rounded-full mr-2' />
3+
<footer className=' border-gray-100/10 bg-gray-100 dark:border-t dark:bg-transparent'>
4+
<div className='container flex items-center py-8'>
5+
<img src='https://avatars.githubusercontent.com/u/53907086?v=4' className='mr-2 h-6 w-6 rounded-full' />
66
Made by
77
<a className='ml-1 font-bold' target='_blank' href='https://github.com/YYsuni'>
88
Suni

website/src/app/page.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import CollapseString from '@/contents/collapse-string'
1414

1515
export default function Home() {
1616
return (
17-
<main className='container pt-12 max-sm:pt-4 pb-20'>
17+
<main className='container pb-20 pt-12 max-sm:pt-4'>
1818
<Hero />
1919

2020
<Installation />

website/src/components/theme.tsx

+6-6
Original file line numberDiff line numberDiff line change
@@ -58,19 +58,19 @@ export default function Theme() {
5858
setTheme('light')
5959
}
6060
}}
61-
className='border border-slate-300 h-8 w-8 flex justify-center items-center rounded-lg'>
61+
className='flex h-8 w-8 items-center justify-center rounded-lg border border-slate-300'>
6262
{theme === 'light' ? (
63-
<LightSVG className='w-4 h-4' />
63+
<LightSVG className='h-4 w-4' />
6464
) : theme === 'dark' ? (
65-
<DarkSVG className='w-4 h-4' />
65+
<DarkSVG className='h-4 w-4' />
6666
) : (
67-
<SystemSVG className='w-4 h-4' />
67+
<SystemSVG className='h-4 w-4' />
6868
)}
6969
</button>
7070
)
7171
return (
72-
<button className='border border-slate-300 h-8 w-8 flex justify-center items-center rounded-lg'>
73-
<SystemSVG className='w-4 h-4' />
72+
<button className='flex h-8 w-8 items-center justify-center rounded-lg border border-slate-300'>
73+
<SystemSVG className='h-4 w-4' />
7474
</button>
7575
)
7676
}

website/src/contents/collapse-string.tsx

+7-7
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ export default function CollapseString() {
2929
<>
3030
<h2 className='mt-20 text-lg font-medium'>Collapse String</h2>
3131

32-
<div className='flex gap-2 mt-3 items-center flex-wrap'>
33-
<ul className='flex flex-wrap gap-1 select-none'>
32+
<div className='mt-3 flex flex-wrap items-center gap-2'>
33+
<ul className='flex select-none flex-wrap gap-1'>
3434
{options.map(item => (
3535
<li
3636
key={item}
3737
className={clsx(
38-
'border rounded-lg cursor-pointer px-2 py-1 text-center min-w-[32px]',
38+
'min-w-[32px] cursor-pointer rounded-lg border px-2 py-1 text-center',
3939
selected === item && 'bg-slate-200 dark:bg-slate-700'
4040
)}
4141
onClick={() => setSelected(item)}>
@@ -46,7 +46,7 @@ export default function CollapseString() {
4646

4747
<input
4848
value={length}
49-
className='py-1 px-2 rounded-lg border bg-white'
49+
className='rounded-lg border bg-white px-2 py-1'
5050
type='number'
5151
onInput={e => {
5252
const target = e.target as HTMLInputElement
@@ -58,19 +58,19 @@ export default function CollapseString() {
5858
</div>
5959

6060
<div className='relative'>
61-
<code className='my-3 flex items-center text-sm justify-between rounded-lg border bg-slate-50 p-4 dark:bg-slate-700 overflow-auto'>
61+
<code className='my-3 flex items-center justify-between overflow-auto rounded-lg border bg-slate-50 p-4 text-sm dark:bg-slate-700'>
6262
<pre
6363
dangerouslySetInnerHTML={{
6464
__html: highlightedCode
6565
}}
6666
/>
6767
</code>
68-
<button onClick={copy} className='rounded-lg p-1 absolute top-3 right-4 bg-white/50 border backdrop-blur'>
68+
<button onClick={copy} className='absolute right-4 top-3 rounded-lg border bg-white/50 p-1 backdrop-blur'>
6969
{copied ? <CopiedSVG className='h-5 w-5' /> : <CopySVG className='h-5 w-5' />}
7070
</button>
7171
</div>
7272

73-
<div className='rounded-lg border p-4 text-sm mt-2 bg-white dark:bg-[#0E0832]'>
73+
<div className='mt-2 rounded-lg border bg-white p-4 text-sm dark:bg-[#0E0832]'>
7474
<JsonView
7575
collapseStringMode={selected}
7676
collapseStringsAfterLength={length}

0 commit comments

Comments
 (0)