Skip to content

Commit

Permalink
style: fix up lint
Browse files Browse the repository at this point in the history
  • Loading branch information
iCrawl committed Dec 19, 2023
1 parent 171cb18 commit d869d9b
Show file tree
Hide file tree
Showing 18 changed files with 44 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
Expand Down
2 changes: 1 addition & 1 deletion apps/website/src/app/docs/packages/[package]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
2 changes: 1 addition & 1 deletion apps/website/src/components/documentation/tsdoc/TSDoc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
>
Expand Down
2 changes: 1 addition & 1 deletion packages/api-extractor-model/src/model/ApiCallSignature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
2 changes: 1 addition & 1 deletion packages/api-extractor-model/src/model/ApiConstructor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
2 changes: 1 addition & 1 deletion packages/api-extractor-utils/src/ApiNodeJSONEncoder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ export class ApiNodeJSONEncoder {
parentKey: item.parent.containerKey,
parentName: item.parent.displayName,
path: generatePath(item.parent.getHierarchy(), version),
}
}
: null,
};
}
Expand Down
2 changes: 1 addition & 1 deletion packages/api-extractor-utils/src/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion packages/api-extractor/src/analyzer/ExportAnalyzer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,7 @@ export class ExportAnalyzer {
? TypeScriptInternals.getModeForUsageLocation(
importOrExportDeclaration.getSourceFile(),
importOrExportDeclaration.moduleSpecifier,
)
)
: undefined;
const resolvedModule: ts.ResolvedModuleFull | undefined = TypeScriptInternals.getResolvedModule(
importOrExportDeclaration.getSourceFile(),
Expand Down
40 changes: 20 additions & 20 deletions packages/api-extractor/src/generators/ApiModelGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -1420,7 +1420,7 @@ export class ApiModelGenerator {
.join('')
: ''
} */`,
).docComment
).docComment
: apiItemMetadata.tsdocComment;
const releaseTag: ReleaseTag = apiItemMetadata.effectiveReleaseTag;
const sourceLocation: ISourceLocation = this._getSourceLocation(typeAliasDeclaration);
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion packages/docgen/src/documentation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}"`);
Expand Down
2 changes: 1 addition & 1 deletion packages/docgen/src/types/constructor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
}
Expand Down
2 changes: 1 addition & 1 deletion packages/docgen/src/types/event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export class DocumentedEvent extends DocumentedItem<DeclarationReflection | Even
},
this.config,
).serialize(),
]
]
: undefined,
returnsDescription:
signature.comment?.blockTags
Expand Down
6 changes: 3 additions & 3 deletions packages/docgen/src/types/method.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
? [
Expand All @@ -74,7 +74,7 @@ export class DocumentedMethod extends DocumentedItem<DeclarationReflection | Met
},
this.config,
).serialize(),
]
]
: undefined,
returnsDescription:
signature.comment?.blockTags
Expand Down Expand Up @@ -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(),
};
Expand Down
10 changes: 5 additions & 5 deletions packages/docgen/src/types/typedef.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
}
Expand Down Expand Up @@ -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({
Expand All @@ -114,8 +114,8 @@ export class DocumentedTypeDef extends DocumentedItem<DeclarationReflection | Ty
.trim(),
},
this.config,
).serialize()
: undefined,
).serialize()
: undefined,
}));

return {
Expand Down Expand Up @@ -185,7 +185,7 @@ export class DocumentedTypeDef extends DocumentedItem<DeclarationReflection | Ty
},
this.config,
).serialize(),
]
]
: undefined,
returnsDescription:
sig?.comment?.blockTags
Expand Down
4 changes: 2 additions & 2 deletions packages/rest/src/lib/errors/DiscordAPIError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

1 comment on commit d869d9b

@vercel
Copy link

@vercel vercel bot commented on d869d9b Dec 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.