Skip to content

Commit

Permalink
Make linter great again
Browse files Browse the repository at this point in the history
  • Loading branch information
kneth committed Feb 8, 2024
1 parent 6c25df5 commit b01469f
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 5 deletions.
14 changes: 12 additions & 2 deletions packages/realm/bindgen/src/js-passes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,12 @@ function addSharedPtrMethods(spec: BoundSpec) {
}

class CustomProperty extends Property {
constructor(on: Class, public readonly name: string, type: Type, public call: MethodCallSig) {
constructor(
on: Class,
public readonly name: string,
type: Type,
public call: MethodCallSig,
) {
assert(name.startsWith("$"));
super(on, "DOLLAR_" + name.slice(1), type);
}
Expand All @@ -82,7 +87,12 @@ class CustomProperty extends Property {
}

class CustomInstanceMethod extends InstanceMethod {
constructor(on: Class, public name: string, sig: Func, public call: MethodCallSig) {
constructor(
on: Class,
public name: string,
sig: Func,
public call: MethodCallSig,
) {
assert(name.startsWith("$"));
const unique_name = "DOLLAR_" + name.slice(1);
super(on, name, unique_name, unique_name, sig);
Expand Down
6 changes: 5 additions & 1 deletion packages/realm/bindgen/src/templates/jsi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@ function tryWrap(body: string) {
}

class CppJsiFunc extends CppFunc {
constructor(private addon: JsiAddon, name: string, props?: CppFuncProps) {
constructor(
private addon: JsiAddon,
name: string,
props?: CppFuncProps,
) {
super(name, "jsi::Value", jsi_callback_args, props);
}

Expand Down
1 change: 1 addition & 0 deletions packages/realm/bindgen/src/templates/node-wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { TemplateContext } from "@realm/bindgen/context";
import { doJsPasses } from "../js-passes";
import { eslint } from "../eslint-formatter";

// eslint-disable-next-line @typescript-eslint/no-unused-vars
export function generate({ rawSpec, spec: boundSpec, file }: TemplateContext): void {
const spec = doJsPasses(boundSpec);
const reactLines = [];
Expand Down
6 changes: 5 additions & 1 deletion packages/realm/bindgen/src/templates/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ function tryWrap(body: string) {
}

class CppNodeFunc extends CppFunc {
constructor(private addon: NodeAddon, name: string, props?: CppFuncProps) {
constructor(
private addon: NodeAddon,
name: string,
props?: CppFuncProps,
) {
super(name, "Napi::Value", [node_callback_info], props);
}

Expand Down
5 changes: 5 additions & 0 deletions packages/realm/src/Realm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -906,6 +906,7 @@ export class Realm {
* Deletes the provided Realm object, or each one inside the provided collection.
* @param subject - The Realm object to delete, or a collection containing multiple Realm objects to delete.
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
delete(subject: AnyRealmObject | AnyRealmObject[] | AnyList | AnyResults | any): void {
assert.inTransaction(this, "Can only delete objects within a transaction.");
assert.object(subject, "subject");
Expand Down Expand Up @@ -1597,6 +1598,7 @@ export declare namespace Realm {
export type CountOptions = CountOptionsType;
export type DeleteEvent<T extends Document> = DeleteEventType<T>;
export type DeleteResult = DeleteResultType;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export type Document<IdType = any> = DocumentType<IdType>;
export type DocumentKey<IdType> = DocumentKeyType<IdType>;
export type DocumentNamespace = DocumentNamespaceType;
Expand Down Expand Up @@ -1639,6 +1641,7 @@ export declare namespace Realm {
export type Set<T> = Realm.Set<T>;
export type Dictionary<T> = Realm.Dictionary<T>;
export type Mixed = unknown;
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export type LinkingObjects<ObjectTypeT, LinkingPropertyName> = Realm.Results<ObjectTypeT>;
}
}
Expand Down Expand Up @@ -1815,6 +1818,7 @@ declare global {
export type CountOptions = CountOptionsType;
export type DeleteEvent<T extends Document> = DeleteEventType<T>;
export type DeleteResult = DeleteResultType;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export type Document<IdType = any> = DocumentType<IdType>;
export type DocumentKey<IdType> = DocumentKeyType<IdType>;
export type DocumentNamespace = DocumentNamespaceType;
Expand Down Expand Up @@ -1857,6 +1861,7 @@ declare global {
export type Set<T> = Realm.Set<T>;
export type Dictionary<T> = Realm.Dictionary<T>;
export type Mixed = unknown;
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export type LinkingObjects<ObjectTypeT, LinkingPropertyName> = Realm.Results<ObjectTypeT>;
}
}
Expand Down
1 change: 1 addition & 0 deletions packages/realm/src/Unmanaged.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
//
////////////////////////////////////////////////////////////////////////////

// eslint-disable-next-line @typescript-eslint/no-unused-vars
import { Collection, Dictionary, List, RealmObject } from "./internal";
import { AnyRealmObject } from "./Object";

Expand Down
2 changes: 1 addition & 1 deletion packages/realm/src/app-services/App.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ export class App<
constructor(configOrId: AppConfiguration | string) {
const config: AppConfiguration = typeof configOrId === "string" ? { id: configOrId } : configOrId;
assert.object(config, "config");
const { id, baseUrl, app, timeout, multiplexSessions = true, baseFilePath, metadata, fetch } = config;
const { id, baseUrl, timeout, multiplexSessions = true, baseFilePath, metadata, fetch } = config;
assert.string(id, "id");
if (timeout !== undefined) {
assert.number(timeout, "timeout");
Expand Down
1 change: 1 addition & 0 deletions packages/realm/src/tests/schema-transform.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ describe("schema transform", () => {
linkOriginPropertyName: "",
isPrimary: false,
isIndexed: false,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
columnKey: { value: 0n } as any,
...bindingSchema,
});
Expand Down

0 comments on commit b01469f

Please sign in to comment.