Skip to content

Commit f0997b1

Browse files
authored
Prettier truce (#94)
2 parents 3a1f654 + 69bdfaa commit f0997b1

Some content is hidden

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

51 files changed

+1396
-1002
lines changed

biome.json

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
{
22
"$schema": "https://biomejs.dev/schemas/2.2.3/schema.json",
3-
"assist": {
4-
"actions": {
5-
"source": {
6-
"useSortedKeys": "on"
7-
}
8-
},
9-
"enabled": true
10-
},
113
"files": {
124
"ignoreUnknown": false,
135
"includes": [".*", "*.config.ts", "src/**", "tests/**", "!src/overtype"]
@@ -18,19 +10,22 @@
1810
"indentStyle": "space",
1911
"indentWidth": 2,
2012
"lineEnding": "lf",
21-
"lineWidth": 100
13+
"lineWidth": 80
2214
},
2315
"javascript": {
2416
"formatter": {
2517
"arrowParentheses": "always",
26-
"attributePosition": "auto",
2718
"bracketSameLine": false,
2819
"bracketSpacing": true,
29-
"jsxQuoteStyle": "single",
20+
"enabled": true,
21+
"indentStyle": "space",
22+
"indentWidth": 2,
23+
"jsxQuoteStyle": "double",
24+
"lineEnding": "lf",
3025
"quoteProperties": "asNeeded",
31-
"quoteStyle": "single",
26+
"quoteStyle": "double",
3227
"semicolons": "asNeeded",
33-
"trailingCommas": "all"
28+
"trailingCommas": "es5"
3429
}
3530
},
3631
"json": {

playwright.config.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
// playwright.config.ts
2-
import { defineConfig } from '@playwright/test'
2+
import { defineConfig } from "@playwright/test"
33

44
export default defineConfig({
5-
reporter: [['html', { open: 'never' }]],
6-
testDir: 'tests/e2e',
5+
reporter: [["html", { open: "never" }]],
6+
testDir: "tests/e2e",
77
use: {
8-
screenshot: 'only-on-failure',
9-
trace: 'retain-on-failure',
10-
video: 'retain-on-failure',
8+
screenshot: "only-on-failure",
9+
trace: "retain-on-failure",
10+
video: "retain-on-failure",
1111
},
1212
})

prettier.config.cjs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/** @type {import('prettier').Config} */
2+
module.exports = {
3+
endOfLine: "lf",
4+
semi: false,
5+
singleQuote: false,
6+
tabWidth: 2,
7+
trailingComma: "es5",
8+
}

src/components/Badge.tsx

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
import { type JSX, useState } from 'react'
2-
import { twMerge } from 'tailwind-merge'
3-
import type { VariantProps } from 'tailwind-variants'
4-
import { badgeCVA, typeColors, typeIcons } from '@/components/design'
5-
import type { CommentTableRow } from '@/entrypoints/background'
1+
import { type JSX, useState } from "react"
2+
import { twMerge } from "tailwind-merge"
3+
import type { VariantProps } from "tailwind-variants"
4+
import { badgeCVA, typeColors, typeIcons } from "@/components/design"
5+
import type { CommentTableRow } from "@/entrypoints/background"
66

7-
import { CodePreview } from './BadgePopups/CodePreview'
8-
import { ImagePreview } from './BadgePopups/ImagePreview'
9-
import { LinkPreview } from './BadgePopups/LinkPreview'
10-
import { OpenTabPopup } from './BadgePopups/OpenTabPopup'
11-
import { TextPreview } from './BadgePopups/TextPreview'
12-
import { TimePreview } from './BadgePopups/TimePreview'
7+
import { CodePreview } from "./BadgePopups/CodePreview"
8+
import { ImagePreview } from "./BadgePopups/ImagePreview"
9+
import { LinkPreview } from "./BadgePopups/LinkPreview"
10+
import { OpenTabPopup } from "./BadgePopups/OpenTabPopup"
11+
import { TextPreview } from "./BadgePopups/TextPreview"
12+
import { TimePreview } from "./BadgePopups/TimePreview"
1313

1414
const typePopups = {
1515
code: CodePreview,
@@ -18,7 +18,9 @@ const typePopups = {
1818
open: OpenTabPopup,
1919
text: TextPreview,
2020
time: TimePreview,
21-
} satisfies Partial<Record<keyof typeof typeIcons, (props: BadgePopupProps) => JSX.Element>>
21+
} satisfies Partial<
22+
Record<keyof typeof typeIcons, (props: BadgePopupProps) => JSX.Element>
23+
>
2224

2325
export interface BadgePopupProps {
2426
row: CommentTableRow
@@ -34,11 +36,13 @@ const Badge = ({ text, type, data }: BadgeProps) => {
3436
const Icon = typeIcons[type]
3537
const [showTooltip, setShowTooltip] = useState(false)
3638
const PopupComponent =
37-
showTooltip && type in typePopups && typePopups[type as keyof typeof typePopups]
39+
showTooltip &&
40+
type in typePopups &&
41+
typePopups[type as keyof typeof typePopups]
3842
return (
3943
<button
40-
type='button'
41-
className='relative'
44+
type="button"
45+
className="relative"
4246
onMouseEnter={() => setShowTooltip(true)}
4347
onMouseLeave={() => setShowTooltip(false)}
4448
>
@@ -47,17 +51,17 @@ const Badge = ({ text, type, data }: BadgeProps) => {
4751
badgeCVA({
4852
clickable: type in typePopups,
4953
type,
50-
}),
54+
})
5155
)}
5256
>
53-
{type === 'blank' || <Icon className='h-3 w-3' />}
57+
{type === "blank" || <Icon className="h-3 w-3" />}
5458
{text || type}
5559
</span>
5660
{PopupComponent && data && (
5761
<div
5862
className={twMerge(
59-
'absolute top-full z-10 w-30 rounded border px-2 py-1 text-left text-xs shadow-lg',
60-
typeColors[type],
63+
"absolute top-full z-10 w-30 rounded border px-2 py-1 text-left text-xs shadow-lg",
64+
typeColors[type]
6165
)}
6266
>
6367
<PopupComponent row={data} />

src/components/BadgePopups/CodePreview.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
import type { BadgePopupProps } from '@/components/Badge'
1+
import type { BadgePopupProps } from "@/components/Badge"
22

33
export function CodePreview({ row: _row }: BadgePopupProps) {
44
return (
55
<>
6-
TODO{' '}
7-
<a href='https://github.com/diffplug/gitcasso/issues/81' className='underline'>
6+
TODO{" "}
7+
<a
8+
href="https://github.com/diffplug/gitcasso/issues/81"
9+
className="underline"
10+
>
811
#81
912
</a>
1013
: show every codeblock in the draft

src/components/BadgePopups/ImagePreview.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
import type { BadgePopupProps } from '@/components/Badge'
1+
import type { BadgePopupProps } from "@/components/Badge"
22

33
export function ImagePreview({ row: _row }: BadgePopupProps) {
44
return (
55
<>
6-
TODO{' '}
7-
<a href='https://github.com/diffplug/gitcasso/issues/80' className='underline'>
6+
TODO{" "}
7+
<a
8+
href="https://github.com/diffplug/gitcasso/issues/80"
9+
className="underline"
10+
>
811
#80
912
</a>
1013
: show every image in the draft

src/components/BadgePopups/LinkPreview.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
import type { BadgePopupProps } from '@/components/Badge'
1+
import type { BadgePopupProps } from "@/components/Badge"
22

33
export function LinkPreview({ row: _row }: BadgePopupProps) {
44
return (
55
<>
6-
TODO{' '}
7-
<a href='https://github.com/diffplug/gitcasso/issues/79' className='underline'>
6+
TODO{" "}
7+
<a
8+
href="https://github.com/diffplug/gitcasso/issues/79"
9+
className="underline"
10+
>
811
#79
912
</a>
1013
: show text, url, and preview info for every link in the draft

src/components/BadgePopups/OpenTabPopup.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import type { BadgePopupProps } from '@/components/Badge'
2-
import { openOrFocusComment } from '@/entrypoints/popup/popup'
1+
import type { BadgePopupProps } from "@/components/Badge"
2+
import { openOrFocusComment } from "@/entrypoints/popup/popup"
33

44
export function OpenTabPopup({ row }: BadgePopupProps) {
55
const handleClick = () => {
@@ -9,8 +9,8 @@ export function OpenTabPopup({ row }: BadgePopupProps) {
99
return (
1010
<button
1111
onClick={handleClick}
12-
className='w-full cursor-pointer text-left hover:bg-opacity-80'
13-
type='button'
12+
className="w-full cursor-pointer text-left hover:bg-opacity-80"
13+
type="button"
1414
>
1515
<p>Tab is already open.</p>
1616
<p>Click to activate.</p>

src/components/BadgePopups/TextPreview.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
import type { BadgePopupProps } from '@/components/Badge'
1+
import type { BadgePopupProps } from "@/components/Badge"
22

33
export function TextPreview({ row: _row }: BadgePopupProps) {
44
return (
55
<>
6-
TODO{' '}
7-
<a href='https://github.com/diffplug/gitcasso/issues/82' className='underline'>
6+
TODO{" "}
7+
<a
8+
href="https://github.com/diffplug/gitcasso/issues/82"
9+
className="underline"
10+
>
811
#82
912
</a>
1013
: show the syntax-highlighted markdown of the latest draft

src/components/BadgePopups/TimePreview.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
import type { BadgePopupProps } from '@/components/Badge'
1+
import type { BadgePopupProps } from "@/components/Badge"
22

33
export function TimePreview({ row: _row }: BadgePopupProps) {
44
return (
55
<>
6-
TODO{' '}
7-
<a href='https://github.com/diffplug/gitcasso/issues/83' className='underline'>
6+
TODO{" "}
7+
<a
8+
href="https://github.com/diffplug/gitcasso/issues/83"
9+
className="underline"
10+
>
811
#83
912
</a>
1013
: show the revision history of the comment

0 commit comments

Comments
 (0)