Skip to content

Commit 94b129d

Browse files
chore: add prettier-plugin-tailwindcss & eslint cache (#4114)
Co-authored-by: Julius Marminge <[email protected]>
1 parent 43d0b01 commit 94b129d

File tree

3 files changed

+22
-18
lines changed

3 files changed

+22
-18
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"migrate": "prisma migrate deploy",
2626
"start": "cross-env NODE_ENV=production node dist/server/prodServer.js",
2727
"studio": "prisma studio",
28-
"lint": "eslint --ext \".js,.ts,.tsx\" --report-unused-disable-directives --report-unused-disable-directives src",
28+
"lint": "eslint --cache --ext \".js,.ts,.tsx\" --report-unused-disable-directives --report-unused-disable-directives src",
2929
"lint-fix": "pnpm lint --fix",
3030
"test-dev": "cross-env APP_ENV=test start-server-and-test dev 3000 test",
3131
"test-start": "cross-env APP_ENV=test WS_URL=ws://localhost:3000 start-server-and-test start 3000 test",
@@ -75,10 +75,10 @@
7575
"eslint-plugin-react-hooks": "^4.6.0",
7676
"npm-run-all": "^4.1.5",
7777
"postcss": "^8.4.14",
78-
"prettier": "^2.7.1",
78+
"prettier": "^2.8.7",
7979
"prisma": "^4.12.0",
8080
"start-server-and-test": "^1.12.0",
81-
"tailwindcss": "^3.1.6",
81+
"tailwindcss": "^3.3.0",
8282
"typescript": "^4.8.3"
8383
},
8484
"publishConfig": {

src/pages/index.tsx

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function AddMessageForm({ onMessagePost }: { onMessagePost: () => void }) {
2525
const userName = session?.user?.name;
2626
if (!userName) {
2727
return (
28-
<div className="flex justify-between w-full px-3 py-2 text-lg text-gray-200 bg-gray-800 rounded">
28+
<div className="flex w-full justify-between rounded bg-gray-800 px-3 py-2 text-lg text-gray-200">
2929
<p className="font-bold">
3030
You have to{' '}
3131
<button
@@ -39,7 +39,7 @@ function AddMessageForm({ onMessagePost }: { onMessagePost: () => void }) {
3939
<button
4040
onClick={() => signIn()}
4141
data-testid="signin"
42-
className="h-full px-4 bg-indigo-500 rounded"
42+
className="h-full rounded bg-indigo-500 px-4"
4343
>
4444
Sign In
4545
</button>
@@ -60,7 +60,7 @@ function AddMessageForm({ onMessagePost }: { onMessagePost: () => void }) {
6060
}}
6161
>
6262
<fieldset disabled={addPost.isLoading} className="min-w-0">
63-
<div className="flex items-end w-full px-3 py-2 text-lg text-gray-200 bg-gray-500 rounded">
63+
<div className="flex w-full items-end rounded bg-gray-500 px-3 py-2 text-lg text-gray-200">
6464
<textarea
6565
value={message}
6666
onChange={(e) => setMessage(e.target.value)}
@@ -89,7 +89,7 @@ function AddMessageForm({ onMessagePost }: { onMessagePost: () => void }) {
8989
}}
9090
/>
9191
<div>
92-
<button type="submit" className="px-4 py-1 bg-indigo-500 rounded">
92+
<button type="submit" className="rounded bg-indigo-500 px-4 py-1">
9393
Submit
9494
</button>
9595
</div>
@@ -185,10 +185,10 @@ export default function IndexPage() {
185185
<title>Prisma Starter</title>
186186
<link rel="icon" href="/favicon.ico" />
187187
</Head>
188-
<div className="flex flex-col h-screen md:flex-row">
189-
<section className="flex flex-col w-full bg-gray-800 md:w-72">
188+
<div className="flex h-screen flex-col md:flex-row">
189+
<section className="flex w-full flex-col bg-gray-800 md:w-72">
190190
<div className="flex-1 overflow-y-hidden">
191-
<div className="flex flex-col h-full divide-y divide-gray-700">
191+
<div className="flex h-full flex-col divide-y divide-gray-700">
192192
<header className="p-4">
193193
<h1 className="text-3xl font-bold text-gray-50">
194194
tRPC WebSocket starter
@@ -206,10 +206,10 @@ export default function IndexPage() {
206206
</a>
207207
</p>
208208
</header>
209-
<div className="flex-1 hidden p-4 space-y-6 overflow-y-auto text-gray-400 md:block">
209+
<div className="hidden flex-1 space-y-6 overflow-y-auto p-4 text-gray-400 md:block">
210210
<article className="space-y-2">
211211
<h2 className="text-lg text-gray-200">Introduction</h2>
212-
<ul className="space-y-2 list-disc list-inside">
212+
<ul className="list-inside list-disc space-y-2">
213213
<li>Open inspector and head to Network tab</li>
214214
<li>All client requests are handled through WebSockets</li>
215215
<li>
@@ -242,16 +242,16 @@ export default function IndexPage() {
242242
</div>
243243
</div>
244244
</div>
245-
<div className="flex-shrink-0 hidden h-16 md:block"></div>
245+
<div className="hidden h-16 shrink-0 md:block"></div>
246246
</section>
247247
<div className="flex-1 overflow-y-hidden md:h-screen">
248-
<section className="flex flex-col justify-end h-full p-4 space-y-4 bg-gray-700">
248+
<section className="flex h-full flex-col justify-end space-y-4 bg-gray-700 p-4">
249249
<div className="space-y-4 overflow-y-auto">
250250
<button
251251
data-testid="loadMore"
252252
onClick={() => fetchPreviousPage()}
253253
disabled={!hasPreviousPage || isFetchingPreviousPage}
254-
className="px-4 py-2 text-white bg-indigo-500 rounded disabled:opacity-40"
254+
className="rounded bg-indigo-500 px-4 py-2 text-white disabled:opacity-40"
255255
>
256256
{isFetchingPreviousPage
257257
? 'Loading more...'
@@ -263,7 +263,7 @@ export default function IndexPage() {
263263
{messages?.map((item) => (
264264
<article key={item.id} className=" text-gray-50">
265265
<header className="flex space-x-2 text-sm">
266-
<h3 className="text-md">
266+
<h3 className="text-base">
267267
{item.source === 'RAW' ? (
268268
item.name
269269
) : (
@@ -283,7 +283,7 @@ export default function IndexPage() {
283283
}).format(item.createdAt)}
284284
</span>
285285
</header>
286-
<p className="text-xl leading-tight whitespace-pre-line">
286+
<p className="whitespace-pre-line text-xl leading-tight">
287287
{item.text}
288288
</p>
289289
</article>
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
module.exports = {
1+
import type { Config } from 'tailwindcss';
2+
3+
const config: Config = {
24
content: ['./src/pages/**/*.{js,ts,jsx,tsx}'],
35
theme: {
46
extend: {},
57
},
68
plugins: [],
79
};
10+
11+
export default config;

0 commit comments

Comments
 (0)