Skip to content

Commit

Permalink
Update to ts-eslint@8
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerrit0 committed Aug 9, 2024
1 parent 48545c1 commit 254e8ad
Show file tree
Hide file tree
Showing 20 changed files with 101 additions and 98 deletions.
4 changes: 4 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ const config = {
},
],

// This can probably be turned back on in 0.27, when the component hierarchy goes away
"@typescript-eslint/no-unsafe-function-type": "off",

// This one is just annoying since it complains at incomplete code
"no-empty": "off",

Expand Down Expand Up @@ -58,6 +61,7 @@ const config = {
"@typescript-eslint/no-unsafe-return": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-empty-object-type": "off",

// Really annoying, doesn't provide any value.
"@typescript-eslint/no-empty-function": "off",
Expand Down
130 changes: 62 additions & 68 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"puppeteer": "^22.12.1",
"ts-node": "^10.9.2",
"typescript": "5.5.2",
"typescript-eslint": "^7.14.1"
"typescript-eslint": "^8.0.1"
},
"files": [
"/bin",
Expand Down
2 changes: 1 addition & 1 deletion src/lib/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ import {
import { loadShikiMetadata } from "./utils/highlighter";
import { ValidatingFileRegistry, FileRegistry } from "./models/FileRegistry";

// eslint-disable-next-line @typescript-eslint/no-var-requires
// eslint-disable-next-line @typescript-eslint/no-require-imports
const packageInfo = require("../../package.json") as {
version: string;
peerDependencies: { typescript: string };
Expand Down
2 changes: 1 addition & 1 deletion src/lib/internationalization/internationalization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export class Internationalization {
);
try {
return new Map(
// eslint-disable-next-line @typescript-eslint/no-var-requires
// eslint-disable-next-line @typescript-eslint/no-require-imports
Object.entries(require(`./locales/${lang}.${ext}`)),
);
} catch {
Expand Down
10 changes: 4 additions & 6 deletions src/lib/internationalization/translatable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -544,20 +544,18 @@ type TranslationConstraint = [
// Compiler errors here which says a property is missing indicates that the value on translatable
// is not a literal string. It should be so that TypeDoc's placeholder replacement detection
// can validate that all placeholders have been specified.
const _validateLiteralStrings: {
({}) satisfies {
[K in keyof typeof translatable as string extends (typeof translatable)[K]
? K
: never]: never;
} = {};
_validateLiteralStrings;
};

// Compiler errors here which says a property is missing indicates that the key on translatable
// contains a placeholder _0/_1, etc. but the value does not match the expected constraint.
const _validatePlaceholdersPresent: {
translatable satisfies {
[K in keyof typeof translatable]: K extends `${string}_1${string}`
? TranslationConstraint[2]
: K extends `${string}_0${string}`
? TranslationConstraint[1]
: TranslationConstraint[0];
} = translatable;
_validatePlaceholdersPresent;
};
6 changes: 4 additions & 2 deletions src/lib/output/plugins/JavascriptIndexPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,12 @@ export class JavascriptIndexPlugin extends RendererComponent {
reflection.signatures?.forEach(
(s) => s.comment && comments.push(s.comment),
);
reflection.getSignature?.comment &&
if (reflection.getSignature?.comment) {
comments.push(reflection.getSignature.comment);
reflection.setSignature?.comment &&
}
if (reflection.setSignature?.comment) {
comments.push(reflection.setSignature.comment);
}
}

if (!comments.length) {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/serialization/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import type { ModelToObject } from "./schema";
* Additionally, each {@link Serializer} plugin must define a predicate that instructs the group
* it belongs to.
*/
export interface SerializerComponent<T extends {}> {
export interface SerializerComponent<T extends object> {
/**
* The priority this serializer should be executed with.
* A higher priority means the {@link Serializer} will be applied earlier.
Expand Down
2 changes: 1 addition & 1 deletion src/lib/serialization/serializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class Serializer extends EventDispatcher<SerializerEvents> {
*/
projectRoot!: string;

addSerializer<T extends {}>(serializer: SerializerComponent<T>): void {
addSerializer<T extends object>(serializer: SerializerComponent<T>): void {
insertPrioritySorted(this.serializers, serializer);
}

Expand Down
2 changes: 1 addition & 1 deletion src/lib/utils/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export interface Component<E extends Record<keyof E, unknown[]> = {}>
export interface ComponentClass<
T extends Component,
O extends ComponentHost = ComponentHost,
> extends Function {
> {
new (owner: O): T;
}

Expand Down
Loading

0 comments on commit 254e8ad

Please sign in to comment.