chore: fix leftover eslint exceptions

This commit is contained in:
iCrawl
2022-09-01 21:26:09 +02:00
parent edadb9fe5d
commit 3b7ba4062e
80 changed files with 141 additions and 337 deletions

View File

@@ -47,16 +47,13 @@ export const getStaticPaths: GetStaticPaths = async () => {
let versions: string[] = [];
if (process.env.NEXT_PUBLIC_LOCAL_DEV) {
const res = await readFile(join(cwd(), '..', packageName, 'docs', 'docs.api.json'), 'utf8');
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
data = JSON.parse(res);
} else {
const response = await fetch(`https://docs.discordjs.dev/api/info?package=${packageName}`);
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
versions = await response.json();
for (const version of versions) {
const res = await fetch(`https://docs.discordjs.dev/docs/${packageName}/${version}.api.json`);
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
data = [...data, await res.json()];
}
}
@@ -142,11 +139,9 @@ export const getStaticProps: GetStaticProps = async ({ params }) => {
let data;
if (process.env.NEXT_PUBLIC_LOCAL_DEV) {
const res = await readFile(join(cwd(), '..', packageName, 'docs', 'docs.api.json'), 'utf8');
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
data = JSON.parse(res);
} else {
const res = await fetch(`https://docs.discordjs.dev/docs/${packageName}/${branchName}.api.json`);
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
data = await res.json();
}

View File

@@ -38,7 +38,6 @@ export const getStaticProps: GetStaticProps = async ({ params }) => {
try {
const res = await fetch(`https://docs.discordjs.dev/api/info?package=${packageName ?? 'builders'}`);
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const data: string[] = await res.json();
if (!data.length) {