mirror of
https://github.com/outline/outline.git
synced 2026-11-21 21:44:30 +03:00
* chore: Reduce no-explicit-any warnings in server directory Tightens types across test response bodies, decorator signatures, the TestServer wrapper, base class generics, and presenter Record types. Where any is genuinely load-bearing (Sequelize model generics, PropertyDescriptor decorator returns, plugin-registered template classes, Fix mixin), keeps any with a targeted eslint-disable plus reason rather than masking the constraint. Cuts server-only no-explicit-any warnings from 162 to 70. * fix: groups test asserts on first response instead of second Caught by Copilot review on the no-explicit-any cleanup. Also fixes the pre-existing getChangsetSkipped → getChangesetSkipped typo surfaced while reviewing nearby decorator code.
23 lines
662 B
TypeScript
23 lines
662 B
TypeScript
import { DeletedAt } from "sequelize-typescript";
|
|
import IdModel from "./IdModel";
|
|
|
|
class ParanoidModel<
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- mirrors Model base; tightening to object resolves Attributes<M> to never inside Sequelize helpers.
|
|
TModelAttributes extends object = any,
|
|
TCreationAttributes extends object = TModelAttributes,
|
|
> extends IdModel<TModelAttributes, TCreationAttributes> {
|
|
@DeletedAt
|
|
deletedAt: Date | null;
|
|
|
|
/**
|
|
* Whether the model has been deleted.
|
|
*
|
|
* @returns True if the model has been deleted
|
|
*/
|
|
get isDeleted() {
|
|
return !!this.deletedAt;
|
|
}
|
|
}
|
|
|
|
export default ParanoidModel;
|