Skip to content

Commit

Permalink
Modify and apply Prettier config ✨
Browse files Browse the repository at this point in the history
  • Loading branch information
wotschofsky committed Sep 28, 2024
1 parent f35a89f commit 786b819
Show file tree
Hide file tree
Showing 64 changed files with 208 additions and 210 deletions.
22 changes: 0 additions & 22 deletions .prettierrc.js

This file was deleted.

17 changes: 17 additions & 0 deletions .prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
semi: true
singleQuote: true
tabWidth: 2
useTabs: false
plugins:
- '@trivago/prettier-plugin-sort-imports'
- 'prettier-plugin-tailwindcss'
importOrder:
- '^node:(.*)$'
- '<THIRD_PARTY_MODULES>'
- '^@/components/ui/(.*)$'
- '^@/(.*)$'
- '^[./]'
importOrderSeparation: true
importOrderSortSpecifiers: true
importOrderGroupNamespaceSpecifiers: true
importOrderCaseInsensitive: true
2 changes: 1 addition & 1 deletion app/(landing)/_components/author-section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const AuthorSection: FC<AuthorSectionProps> = ({
<section
className={cn(
'flex items-center justify-center gap-4 font-medium',
className
className,
)}
{...props}
>
Expand Down
2 changes: 1 addition & 1 deletion app/(landing)/_components/sponsors-section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const SponsorsSection: FC<SponsorsSectionProps> = async ({
url.searchParams.set('ref', 'domain-digger');
return url.toString();
},
[]
[],
);

if (!env.GITHUB_TOKEN) {
Expand Down
6 changes: 3 additions & 3 deletions app/(landing)/opengraph-image.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ export const runtime = 'edge';
export const contentType = 'image/png';

const interRegularFontP = fetch(
new URL('https://fonts.bunny.net/inter/files/inter-latin-400-normal.woff')
new URL('https://fonts.bunny.net/inter/files/inter-latin-400-normal.woff'),
).then((res) => res.arrayBuffer());

const interBoldFontP = fetch(
new URL('https://fonts.bunny.net/inter/files/inter-latin-700-normal.woff')
new URL('https://fonts.bunny.net/inter/files/inter-latin-700-normal.woff'),
).then((res) => res.arrayBuffer());

const publicUrl =
Expand Down Expand Up @@ -187,7 +187,7 @@ export const handler = async () => {
weight: 700,
},
],
}
},
);
};

Expand Down
2 changes: 1 addition & 1 deletion app/_components/bookmarklet-link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const BookmarkletLink: FC = () => {
event.preventDefault();
setIsOpen(true);
},
[setIsOpen]
[setIsOpen],
);

const mouseDownHandler = useCallback<
Expand Down
2 changes: 1 addition & 1 deletion app/_components/feedback-prompt.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const FeedbackPrompt: FC = () => {

const [lastDismissed, setLastDismissed] = useLocalStorage(
'feedback-prompt.last-dismissed',
Date.now() - TIMEOUT_PERIOD + INITIAL_DELAY
Date.now() - TIMEOUT_PERIOD + INITIAL_DELAY,
);
const visible = Date.now() - lastDismissed > TIMEOUT_PERIOD;
const [dialogOpen, setDialogOpen] = useState(false);
Expand Down
18 changes: 9 additions & 9 deletions app/_components/search-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export const SearchForm: FC<SearchFormProps> = (props) => {
inputRef.current?.focus();
},
{ preventDefault: true },
[inputRef.current]
[inputRef.current],
);

const redirectUser = useCallback(
Expand All @@ -151,7 +151,7 @@ export const SearchForm: FC<SearchFormProps> = (props) => {

router.push(target);
},
[setState, router, pathname, props.subpage]
[setState, router, pathname, props.subpage],
);

const handleSubmit = useCallback(
Expand Down Expand Up @@ -181,12 +181,12 @@ export const SearchForm: FC<SearchFormProps> = (props) => {
return;
}
},
[setInvalid, setIpDetailsOpen, redirectUser, plausible]
[setInvalid, setIpDetailsOpen, redirectUser, plausible],
);

const { suggestions } = useSuggestions(domain);
const [selectedSuggestion, setSelectedSuggestion] = useState<number | null>(
null
null,
);
useEffect(() => {
setSelectedSuggestion(null);
Expand All @@ -207,12 +207,12 @@ export const SearchForm: FC<SearchFormProps> = (props) => {
},
});
},
[domain, setDomain, redirectUser, plausible]
[domain, setDomain, redirectUser, plausible],
);

const handleInput = useCallback<ChangeEventHandler<HTMLInputElement>>(
(event) => setDomain(event.currentTarget.value),
[setDomain]
[setDomain],
);

const handleKeyDown = useCallback<KeyboardEventHandler<HTMLInputElement>>(
Expand Down Expand Up @@ -257,7 +257,7 @@ export const SearchForm: FC<SearchFormProps> = (props) => {
suggestions,
selectedSuggestion,
handleSelectSuggestion,
]
],
);

const handleFocus = useCallback(() => {
Expand All @@ -273,7 +273,7 @@ export const SearchForm: FC<SearchFormProps> = (props) => {
inputRef.current?.focus();
}
},
[setIpDetailsOpen, inputRef]
[setIpDetailsOpen, inputRef],
);

return (
Expand Down Expand Up @@ -336,7 +336,7 @@ export const SearchForm: FC<SearchFormProps> = (props) => {
key={value}
className={cn(
'flex cursor-pointer items-center rounded-lg px-2 py-1 text-sm hover:bg-muted/50',
{ 'bg-muted/50': selectedSuggestion === index }
{ 'bg-muted/50': selectedSuggestion === index },
)}
onClick={() => handleSelectSuggestion(value)}
>
Expand Down
10 changes: 5 additions & 5 deletions app/api/internal/resolve/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const handler = async (request: Request) => {
headers: {
'Content-Type': 'application/json',
},
}
},
);
}

Expand All @@ -44,7 +44,7 @@ export const handler = async (request: Request) => {
headers: {
'Content-Type': 'application/json',
},
}
},
);
}

Expand All @@ -59,7 +59,7 @@ export const handler = async (request: Request) => {
headers: {
'Content-Type': 'application/json',
},
}
},
);
}

Expand All @@ -75,7 +75,7 @@ export const handler = async (request: Request) => {
headers: {
'Content-Type': 'application/json',
},
}
},
);
}
}
Expand All @@ -89,7 +89,7 @@ export const handler = async (request: Request) => {
: new GoogleDoHResolver();
const response = await resolver.resolveRecordTypes(
domain,
types as RecordType[]
types as RecordType[],
);

return Response.json(response);
Expand Down
4 changes: 2 additions & 2 deletions app/api/ip-details/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export async function GET(request: Request) {
headers: {
'Content-Type': 'application/json',
},
}
},
);
}

Expand Down Expand Up @@ -64,6 +64,6 @@ export async function GET(request: Request) {
'Cache-Control': 'public, max-age=600, s-maxage=1800',
'Content-Type': 'application/json',
},
}
},
);
}
4 changes: 2 additions & 2 deletions app/api/whois-summary/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export async function GET(request: Request) {
headers: {
'Content-Type': 'application/json',
},
}
},
);
}

Expand Down Expand Up @@ -44,7 +44,7 @@ export async function GET(request: Request) {
headers: {
'Content-Type': 'application/json',
},
}
},
);
}
}
2 changes: 1 addition & 1 deletion app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const FeedbackPrompt = dynamic(
() => import('./_components/feedback-prompt').then((m) => m.FeedbackPrompt),
{
ssr: false,
}
},
);

export const viewport: Viewport = {
Expand Down
4 changes: 2 additions & 2 deletions app/lookup/[domain]/(dns)/_components/dns-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const DnsTable: FC<DnsTableProps> = ({ records, subvalues }) => (
}

const sortedRecords = response.records.toSorted((a, b) =>
naturalCompare(a.data, b.data)
naturalCompare(a.data, b.data),
);

return (
Expand All @@ -49,7 +49,7 @@ export const DnsTable: FC<DnsTableProps> = ({ records, subvalues }) => (
'text-sm text-muted-foreground underline decoration-dotted underline-offset-4',
'plausible-event-name=Trace:+Click',
`plausible-event-domain=${sortedRecords[0].name}`,
`plausible-event-type=${recordType}`
`plausible-event-type=${recordType}`,
)}
>
View Trace
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const LocationSelector: FC<LocationSelectorProps> = ({
props: { location: value },
});
},
[router, pathname, searchParams, plausible]
[router, pathname, searchParams, plausible],
);

return (
Expand Down
8 changes: 4 additions & 4 deletions app/lookup/[domain]/(dns)/_components/record-row.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const RecordRow: FC<RecordRowProps> = ({
? match.slice(0, -1)
: match;
return <DomainLink domain={normalizedMatch} />;
}
},
);
}

Expand All @@ -45,7 +45,7 @@ export const RecordRow: FC<RecordRowProps> = ({
interpolatedValue = reactStringReplace(
interpolatedValue,
domain,
(match) => <IpLink value={match} />
(match) => <IpLink value={match} />,
);
}

Expand All @@ -54,7 +54,7 @@ export const RecordRow: FC<RecordRowProps> = ({
interpolatedValue = reactStringReplace(
interpolatedValue,
domain,
(match) => <IpLink value={match} />
(match) => <IpLink value={match} />,
);
}

Expand All @@ -70,7 +70,7 @@ export const RecordRow: FC<RecordRowProps> = ({
<TableCell
className={cn(
'whitespace-normal break-words pr-0',
subvalues ? 'py-1' : 'py-4'
subvalues ? 'py-1' : 'py-4',
)}
>
{interpolatedValue}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const ResolverSelector: FC<ResolverSelectorProps> = ({
props: { resolver: value },
});
},
[router, pathname, searchParams, plausible]
[router, pathname, searchParams, plausible],
);

return (
Expand Down
6 changes: 3 additions & 3 deletions app/lookup/[domain]/(dns)/_components/stacked-record.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const StackedRecord: FC<StackedRecordProps> = ({
? match.slice(0, -1)
: match;
return <DomainLink domain={normalizedMatch} />;
}
},
);
}

Expand All @@ -46,7 +46,7 @@ export const StackedRecord: FC<StackedRecordProps> = ({
interpolatedValue = reactStringReplace(
interpolatedValue,
domain,
(match) => <IpLink value={match} />
(match) => <IpLink value={match} />,
);
}

Expand All @@ -55,7 +55,7 @@ export const StackedRecord: FC<StackedRecordProps> = ({
interpolatedValue = reactStringReplace(
interpolatedValue,
domain,
(match) => <IpLink value={match} />
(match) => <IpLink value={match} />,
);
}

Expand Down
6 changes: 3 additions & 3 deletions app/lookup/[domain]/(dns)/opengraph-image.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ export const runtime = 'edge';
export const contentType = 'image/png';

const interRegularFontP = fetch(
new URL('https://fonts.bunny.net/inter/files/inter-latin-400-normal.woff')
new URL('https://fonts.bunny.net/inter/files/inter-latin-400-normal.woff'),
).then((res) => res.arrayBuffer());

const interBoldFontP = fetch(
new URL('https://fonts.bunny.net/inter/files/inter-latin-700-normal.woff')
new URL('https://fonts.bunny.net/inter/files/inter-latin-700-normal.woff'),
).then((res) => res.arrayBuffer());

const publicUrl =
Expand Down Expand Up @@ -187,7 +187,7 @@ export const handler = async ({ params }: { params: { domain: string } }) => {
weight: 700,
},
],
}
},
);
};

Expand Down
Loading

0 comments on commit 786b819

Please sign in to comment.