Skip to content

Commit 60c724f

Browse files
committed
fix(*): lint errors
1 parent cd774d0 commit 60c724f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/util/discordDocs.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ export function resolveResourceFromDocsURL(link: string) {
2525
// https://raw.githubusercontent.com/discord/discord-api-docs/main/docs/resources/user.mdx
2626

2727
type Route = {
28-
verb: string;
2928
path: string;
29+
verb: string;
3030
};
3131

3232
type ParsedSection = {
@@ -43,7 +43,7 @@ function cleanLine(line: string) {
4343
}
4444

4545
function formatRoutePath(path: string) {
46-
return path.replaceAll(/\[(.*?)\]\(.*?\)/g, '$1');
46+
return path.replaceAll(/\[(.*?)]\(.*?\)/g, '$1');
4747
}
4848

4949
const IGNORE_LINE_PREFIXES = ['>', '---', '|', '!'];
@@ -105,10 +105,10 @@ export function parseSections(content: string): ParsedSection[] {
105105
if (line.startsWith('<Route')) {
106106
const match = /<Route method="(?<verb>\w{3,6})">\/(?<path>.*)<\/Route>/.exec(line);
107107

108-
if (match) {
108+
if (match?.groups) {
109109
section.route = {
110-
verb: match.groups?.['verb']!,
111-
path: formatRoutePath(match.groups?.['path']!),
110+
verb: match.groups.verb!,
111+
path: formatRoutePath(match.groups.path!),
112112
};
113113
}
114114

@@ -133,7 +133,7 @@ export function findRelevantDocsSection(query: string, docsMd: string) {
133133
for (const section of sections) {
134134
const anchor = `#${section.headline.toLowerCase().replaceAll(' ', '-').replaceAll(':', '')}`;
135135

136-
if (anchor == query) {
136+
if (anchor === query) {
137137
return section;
138138
}
139139
}

0 commit comments

Comments
 (0)