mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 12:03:31 +01:00
chore: fix leftover eslint exceptions
This commit is contained in:
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user