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

@@ -18,11 +18,8 @@ function findPackageJSON(
if (depth === 0) return undefined;
const attemptedPath = resolve(dir, './package.json');
try {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const pkg = require(attemptedPath);
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
if (pkg.name !== packageName) throw new Error('package.json does not match');
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
return pkg;
} catch {
return findPackageJSON(resolve(dir, '..'), packageName, depth - 1);
@@ -36,12 +33,10 @@ function findPackageJSON(
*/
function version(name: string): string {
try {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const pkg =
name === '@discordjs/voice'
? require('../../package.json')
: findPackageJSON(dirname(require.resolve(name)), name, 3);
// eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-member-access
return pkg?.version ?? 'not found';
} catch {
return 'not found';