mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
style: fix up lint
This commit is contained in:
@@ -28,7 +28,7 @@ import { OVERLOAD_SEPARATOR } from '~/util/constants';
|
||||
import { fetchMember } from '~/util/fetchMember';
|
||||
import { findMember } from '~/util/model';
|
||||
|
||||
export const revalidate = 3_600;
|
||||
export const revalidate = 86_400;
|
||||
|
||||
export interface ItemRouteParams {
|
||||
item: string;
|
||||
|
||||
@@ -12,7 +12,7 @@ import { resolveItemURI } from '~/components/documentation/util';
|
||||
import { N_RECENT_VERSIONS, PACKAGES } from '~/util/constants';
|
||||
import { Providers } from './providers';
|
||||
|
||||
export const revalidate = 3_600;
|
||||
export const revalidate = 0;
|
||||
|
||||
const Header = dynamic(async () => import('~/components/Header'));
|
||||
const Footer = dynamic(async () => import('~/components/Footer'));
|
||||
|
||||
@@ -7,7 +7,7 @@ import { fetchVersions } from '~/app/docAPI';
|
||||
import { buttonVariants } from '~/styles/Button';
|
||||
import { PACKAGES } from '~/util/constants';
|
||||
|
||||
export const revalidate = 3_600;
|
||||
export const revalidate = 86_400;
|
||||
|
||||
export default async function Page({ params }: { params: { package: string } }) {
|
||||
if (!PACKAGES.includes(params.package)) {
|
||||
|
||||
@@ -87,7 +87,7 @@ export function TSDoc({ item, tsdoc }: { readonly item: ApiItem; readonly tsdoc:
|
||||
version={
|
||||
resolved?.package
|
||||
? // eslint-disable-next-line unicorn/better-regex
|
||||
item.getAssociatedPackage()?.dependencies?.[resolved.package]?.replace(/[~^]/, '')
|
||||
item.getAssociatedPackage()?.dependencies?.[resolved.package]?.replace(/[~^]/, '')
|
||||
: undefined
|
||||
}
|
||||
>
|
||||
|
||||
@@ -84,7 +84,7 @@ export class ApiCallSignature extends ApiTypeParameterListMixin(
|
||||
const parent: DeclarationReference = this.parent
|
||||
? this.parent.canonicalReference
|
||||
: // .withMeaning() requires some kind of component
|
||||
DeclarationReference.empty().addNavigationStep(Navigation.Members as any, '(parent)');
|
||||
DeclarationReference.empty().addNavigationStep(Navigation.Members as any, '(parent)');
|
||||
return parent.withMeaning(Meaning.CallSignature as any).withOverloadIndex(this.overloadIndex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ export class ApiConstructSignature extends ApiTypeParameterListMixin(
|
||||
const parent: DeclarationReference = this.parent
|
||||
? this.parent.canonicalReference
|
||||
: // .withMeaning() requires some kind of component
|
||||
DeclarationReference.empty().addNavigationStep(Navigation.Members as any, '(parent)');
|
||||
DeclarationReference.empty().addNavigationStep(Navigation.Members as any, '(parent)');
|
||||
return parent.withMeaning(Meaning.ConstructSignature as any).withOverloadIndex(this.overloadIndex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ export class ApiConstructor extends ApiParameterListMixin(ApiProtectedMixin(ApiR
|
||||
const parent: DeclarationReference = this.parent
|
||||
? this.parent.canonicalReference
|
||||
: // .withMeaning() requires some kind of component
|
||||
DeclarationReference.empty().addNavigationStep(Navigation.Members as any, '(parent)');
|
||||
DeclarationReference.empty().addNavigationStep(Navigation.Members as any, '(parent)');
|
||||
return parent.withMeaning(Meaning.Constructor as any).withOverloadIndex(this.overloadIndex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ export class ApiIndexSignature extends ApiParameterListMixin(
|
||||
const parent: DeclarationReference = this.parent
|
||||
? this.parent.canonicalReference
|
||||
: // .withMeaning() requires some kind of component
|
||||
DeclarationReference.empty().addNavigationStep(Navigation.Members as any, '(parent)');
|
||||
DeclarationReference.empty().addNavigationStep(Navigation.Members as any, '(parent)');
|
||||
return parent.withMeaning(Meaning.IndexSignature as any).withOverloadIndex(this.overloadIndex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -252,7 +252,7 @@ export class ApiNodeJSONEncoder {
|
||||
parentKey: item.parent.containerKey,
|
||||
parentName: item.parent.displayName,
|
||||
path: generatePath(item.parent.getHierarchy(), version),
|
||||
}
|
||||
}
|
||||
: null,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ export function generatePath(items: readonly ApiItem[], version: string) {
|
||||
|
||||
return path.includes('@discordjs/')
|
||||
? path.replace(/@discordjs\/(?<package>.*)\/(?<member>.*)?/, `$<package>/${version}/$<member>`)
|
||||
: path.replace(/(?<oackage>.*)\/(?<member>.*)?/, `$<package>/${version}/$<member>`);
|
||||
: path.replace(/(?<package>.*)\/(?<member>.*)?/, `$<package>/${version}/$<member>`);
|
||||
}
|
||||
|
||||
export function resolveDocComment(item: ApiDeclaredItem) {
|
||||
|
||||
@@ -853,7 +853,7 @@ export class ExportAnalyzer {
|
||||
? TypeScriptInternals.getModeForUsageLocation(
|
||||
importOrExportDeclaration.getSourceFile(),
|
||||
importOrExportDeclaration.moduleSpecifier,
|
||||
)
|
||||
)
|
||||
: undefined;
|
||||
const resolvedModule: ts.ResolvedModuleFull | undefined = TypeScriptInternals.getResolvedModule(
|
||||
importOrExportDeclaration.getSourceFile(),
|
||||
|
||||
@@ -563,7 +563,7 @@ export class ApiModelGenerator {
|
||||
?.map((param) => ` * @param ${param.name} - ${this._fixLinkTags(param.description) ?? ''}\n`)
|
||||
.join('') ?? ''
|
||||
} */`,
|
||||
).docComment
|
||||
).docComment
|
||||
: apiItemMetadata.tsdocComment;
|
||||
const releaseTag: ReleaseTag = apiItemMetadata.effectiveReleaseTag;
|
||||
const isProtected: boolean = (astDeclaration.modifierFlags & ts.ModifierFlags.Protected) !== 0;
|
||||
@@ -650,10 +650,10 @@ export class ApiModelGenerator {
|
||||
jsDoc.deprecated
|
||||
? ` * @deprecated ${
|
||||
typeof jsDoc.deprecated === 'string' ? this._fixLinkTags(jsDoc.deprecated) : jsDoc.deprecated
|
||||
}\n`
|
||||
}\n`
|
||||
: ''
|
||||
} */`,
|
||||
).docComment
|
||||
).docComment
|
||||
: apiItemMetadata.tsdocComment;
|
||||
const releaseTag: ReleaseTag = apiItemMetadata.effectiveReleaseTag;
|
||||
const isAbstract: boolean = (ts.getCombinedModifierFlags(classDeclaration) & ts.ModifierFlags.Abstract) !== 0;
|
||||
@@ -723,7 +723,7 @@ export class ApiModelGenerator {
|
||||
?.map((param) => ` * @param ${param.name} - ${this._fixLinkTags(param.description) ?? ''}\n`)
|
||||
.join('') ?? ''
|
||||
} */`,
|
||||
).docComment
|
||||
).docComment
|
||||
: apiItemMetadata.tsdocComment;
|
||||
const releaseTag: ReleaseTag = apiItemMetadata.effectiveReleaseTag;
|
||||
const sourceLocation: ISourceLocation = this._getSourceLocation(constructSignature);
|
||||
@@ -861,10 +861,10 @@ export class ApiModelGenerator {
|
||||
jsDoc.deprecated
|
||||
? ` * @deprecated ${
|
||||
typeof jsDoc.deprecated === 'string' ? this._fixLinkTags(jsDoc.deprecated) : jsDoc.deprecated
|
||||
}\n`
|
||||
}\n`
|
||||
: ''
|
||||
} */`,
|
||||
).docComment
|
||||
).docComment
|
||||
: apiItemMetadata.tsdocComment;
|
||||
const releaseTag: ReleaseTag = apiItemMetadata.effectiveReleaseTag;
|
||||
const sourceLocation: ISourceLocation = this._getSourceLocation(functionDeclaration);
|
||||
@@ -983,10 +983,10 @@ export class ApiModelGenerator {
|
||||
jsDoc.deprecated
|
||||
? ` * @deprecated ${
|
||||
typeof jsDoc.deprecated === 'string' ? this._fixLinkTags(jsDoc.deprecated) : jsDoc.deprecated
|
||||
}\n`
|
||||
}\n`
|
||||
: ''
|
||||
} */`,
|
||||
).docComment
|
||||
).docComment
|
||||
: apiItemMetadata.tsdocComment;
|
||||
const releaseTag: ReleaseTag = apiItemMetadata.effectiveReleaseTag;
|
||||
const sourceLocation: ISourceLocation = this._getSourceLocation(interfaceDeclaration);
|
||||
@@ -1063,10 +1063,10 @@ export class ApiModelGenerator {
|
||||
jsDoc.deprecated
|
||||
? ` * @deprecated ${
|
||||
typeof jsDoc.deprecated === 'string' ? this._fixLinkTags(jsDoc.deprecated) : jsDoc.deprecated
|
||||
}\n`
|
||||
}\n`
|
||||
: ''
|
||||
} */`,
|
||||
).docComment
|
||||
).docComment
|
||||
: apiItemMetadata.tsdocComment;
|
||||
const releaseTag: ReleaseTag = apiItemMetadata.effectiveReleaseTag;
|
||||
if (releaseTag === ReleaseTag.Internal || releaseTag === ReleaseTag.Alpha) {
|
||||
@@ -1155,10 +1155,10 @@ export class ApiModelGenerator {
|
||||
jsDoc.deprecated
|
||||
? ` * @deprecated ${
|
||||
typeof jsDoc.deprecated === 'string' ? this._fixLinkTags(jsDoc.deprecated) : jsDoc.deprecated
|
||||
}\n`
|
||||
}\n`
|
||||
: ''
|
||||
} */`,
|
||||
).docComment
|
||||
).docComment
|
||||
: apiItemMetadata.tsdocComment;
|
||||
const releaseTag: ReleaseTag = apiItemMetadata.effectiveReleaseTag;
|
||||
const isOptional: boolean = (astDeclaration.astSymbol.followedSymbol.flags & ts.SymbolFlags.Optional) !== 0;
|
||||
@@ -1225,8 +1225,8 @@ export class ApiModelGenerator {
|
||||
const isStatic: boolean = astDeclaration
|
||||
? (astDeclaration.modifierFlags & ts.ModifierFlags.Static) !== 0
|
||||
: parentApiItem.kind === ApiItemKind.Class || parentApiItem.kind === ApiItemKind.Interface
|
||||
? (jsDoc as DocgenPropertyJson).scope === 'static'
|
||||
: false;
|
||||
? (jsDoc as DocgenPropertyJson).scope === 'static'
|
||||
: false;
|
||||
const containerKey: string = ApiProperty.getContainerKey(name, isStatic);
|
||||
|
||||
let apiProperty: ApiProperty | undefined = parentApiItem.tryGetMemberByKey(containerKey) as ApiProperty;
|
||||
@@ -1266,10 +1266,10 @@ export class ApiModelGenerator {
|
||||
'deprecated' in jsDoc && jsDoc.deprecated
|
||||
? ` * @deprecated ${
|
||||
typeof jsDoc.deprecated === 'string' ? this._fixLinkTags(jsDoc.deprecated) : jsDoc.deprecated
|
||||
}\n`
|
||||
}\n`
|
||||
: ''
|
||||
} */`,
|
||||
).docComment
|
||||
).docComment
|
||||
: apiItemMetadata.tsdocComment;
|
||||
const releaseTag: ReleaseTag = apiItemMetadata.effectiveReleaseTag;
|
||||
const isOptional: boolean = (astDeclaration.astSymbol.followedSymbol.flags & ts.SymbolFlags.Optional) !== 0;
|
||||
@@ -1341,10 +1341,10 @@ export class ApiModelGenerator {
|
||||
'deprecated' in jsDoc && jsDoc.deprecated
|
||||
? ` * @deprecated ${
|
||||
typeof jsDoc.deprecated === 'string' ? this._fixLinkTags(jsDoc.deprecated) : jsDoc.deprecated
|
||||
}\n`
|
||||
}\n`
|
||||
: ''
|
||||
} */`,
|
||||
).docComment
|
||||
).docComment
|
||||
: apiItemMetadata.tsdocComment;
|
||||
const releaseTag: ReleaseTag = apiItemMetadata.effectiveReleaseTag;
|
||||
const isOptional: boolean = (astDeclaration.astSymbol.followedSymbol.flags & ts.SymbolFlags.Optional) !== 0;
|
||||
@@ -1420,7 +1420,7 @@ export class ApiModelGenerator {
|
||||
.join('')
|
||||
: ''
|
||||
} */`,
|
||||
).docComment
|
||||
).docComment
|
||||
: apiItemMetadata.tsdocComment;
|
||||
const releaseTag: ReleaseTag = apiItemMetadata.effectiveReleaseTag;
|
||||
const sourceLocation: ISourceLocation = this._getSourceLocation(typeAliasDeclaration);
|
||||
@@ -1554,7 +1554,7 @@ export class ApiModelGenerator {
|
||||
'deprecated' in jsDoc && jsDoc.deprecated
|
||||
? ` * @deprecated ${
|
||||
typeof jsDoc.deprecated === 'string' ? this._fixLinkTags(jsDoc.deprecated) : jsDoc.deprecated
|
||||
}\n`
|
||||
}\n`
|
||||
: ''
|
||||
} */`,
|
||||
).docComment;
|
||||
|
||||
@@ -164,7 +164,7 @@ export class Documentation {
|
||||
file: member.sources?.[0]?.fileName,
|
||||
line: member.sources?.[0]?.line,
|
||||
path: dirname(member.sources?.[0]?.fileName ?? ''),
|
||||
};
|
||||
};
|
||||
|
||||
if (prop!.name) {
|
||||
info.push(`member of "${prop!.name}"`);
|
||||
|
||||
@@ -29,7 +29,7 @@ export class DocumentedConstructor extends DocumentedItem<Constructor | Declarat
|
||||
params: signature.parameters
|
||||
? (signature as SignatureReflection).parameters?.map((param) =>
|
||||
new DocumentedParam(param, this.config).serialize(),
|
||||
)
|
||||
)
|
||||
: undefined,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ export class DocumentedEvent extends DocumentedItem<DeclarationReflection | Even
|
||||
},
|
||||
this.config,
|
||||
).serialize(),
|
||||
]
|
||||
]
|
||||
: undefined,
|
||||
returnsDescription:
|
||||
signature.comment?.blockTags
|
||||
|
||||
@@ -57,7 +57,7 @@ export class DocumentedMethod extends DocumentedItem<DeclarationReflection | Met
|
||||
params: signature.parameters
|
||||
? (signature as SignatureReflection).parameters?.map((param) =>
|
||||
new DocumentedParam(param, this.config).serialize(),
|
||||
)
|
||||
)
|
||||
: undefined,
|
||||
returns: signature.type
|
||||
? [
|
||||
@@ -74,7 +74,7 @@ export class DocumentedMethod extends DocumentedItem<DeclarationReflection | Met
|
||||
},
|
||||
this.config,
|
||||
).serialize(),
|
||||
]
|
||||
]
|
||||
: undefined,
|
||||
returnsDescription:
|
||||
signature.comment?.blockTags
|
||||
@@ -113,7 +113,7 @@ export class DocumentedMethod extends DocumentedItem<DeclarationReflection | Met
|
||||
{ names: param.type.names, description: param.description, nullable: param.nullable },
|
||||
this.config,
|
||||
).serialize(),
|
||||
)
|
||||
)
|
||||
: undefined,
|
||||
meta: new DocumentedItemMeta(data.meta, this.config).serialize(),
|
||||
};
|
||||
|
||||
@@ -66,7 +66,7 @@ export class DocumentedTypeDef extends DocumentedItem<DeclarationReflection | Ty
|
||||
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
||||
.trim() || undefined,
|
||||
type: [[[(child.type as LiteralType | undefined)?.value]]],
|
||||
}))
|
||||
}))
|
||||
: undefined,
|
||||
};
|
||||
}
|
||||
@@ -99,7 +99,7 @@ export class DocumentedTypeDef extends DocumentedItem<DeclarationReflection | Ty
|
||||
type: child.type
|
||||
? new DocumentedVarType({ names: [parseType(child.type)] }, this.config).serialize()
|
||||
: child.kindString === 'Method'
|
||||
? new DocumentedVarType(
|
||||
? new DocumentedVarType(
|
||||
{
|
||||
names: [
|
||||
parseType({
|
||||
@@ -114,8 +114,8 @@ export class DocumentedTypeDef extends DocumentedItem<DeclarationReflection | Ty
|
||||
.trim(),
|
||||
},
|
||||
this.config,
|
||||
).serialize()
|
||||
: undefined,
|
||||
).serialize()
|
||||
: undefined,
|
||||
}));
|
||||
|
||||
return {
|
||||
@@ -185,7 +185,7 @@ export class DocumentedTypeDef extends DocumentedItem<DeclarationReflection | Ty
|
||||
},
|
||||
this.config,
|
||||
).serialize(),
|
||||
]
|
||||
]
|
||||
: undefined,
|
||||
returnsDescription:
|
||||
sig?.comment?.blockTags
|
||||
|
||||
@@ -93,10 +93,10 @@ export class DiscordAPIError extends Error {
|
||||
const nextKey = otherKey.startsWith('_')
|
||||
? key
|
||||
: key
|
||||
? Number.isNaN(Number(otherKey))
|
||||
? Number.isNaN(Number(otherKey))
|
||||
? `${key}.${otherKey}`
|
||||
: `${key}[${otherKey}]`
|
||||
: otherKey;
|
||||
: otherKey;
|
||||
|
||||
if (typeof val === 'string') {
|
||||
yield val;
|
||||
|
||||
Reference in New Issue
Block a user