Skip to content

Commit

Permalink
[bindgen] Upgraded eslint plugins + adding prettier as a dep (#7299)
Browse files Browse the repository at this point in the history
* Upgraded eslint-*-prettier + prettier as a dep

* Update CHANGELOG.md

* Upgrading @typescript-eslint and eslint itself too

* Comitting the --fix

* Update CHANGELOG.md

Co-authored-by: Kenneth Geisshirt <[email protected]>

---------

Co-authored-by: Kenneth Geisshirt <[email protected]>
  • Loading branch information
kraenhansen and kneth authored Jan 31, 2024
1 parent f7edd47 commit 1a8c84c
Show file tree
Hide file tree
Showing 5 changed files with 196 additions and 152 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
* Expressions in `CHECK()` macros are printed to better; strings are quoted and null strings are printed as NULL instead of no output.
* Refactored version resolution for the `build-apple-device.sh` script. ([#7263](https://github.com/realm/realm-core/pull/7263))
* Remove SyncUser::binding_context() and related things, which were not actually used by any SDKs.
* (bindgen) Upgrade `eslint-config-prettier` & `eslint-plugin-prettier` and add a missing peer dependency on `prettier`.

----------------------------------------------

Expand Down
15 changes: 12 additions & 3 deletions bindgen/src/bound-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,10 @@ export class RRef extends WrapperType {
}

export class Arg {
constructor(public name: string, public type: Type) {
constructor(
public name: string,
public type: Type,
) {
assert(!name.startsWith("_"), `argument "${name}" starts with a '_', but that is reserved`);
}

Expand Down Expand Up @@ -220,7 +223,10 @@ export class Func extends TypeBase {

export class Template extends TypeBase {
readonly kind = "Template";
constructor(public name: string, public args: Type[]) {
constructor(
public name: string,
public args: Type[],
) {
super();
}

Expand Down Expand Up @@ -483,7 +489,10 @@ export class Opaque extends NamedType {
}

export class Enumerator {
constructor(public name: string, public value: number) {}
constructor(
public name: string,
public value: number,
) {}
}

export class Enum extends NamedType {
Expand Down
11 changes: 9 additions & 2 deletions bindgen/src/cpp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,10 @@ export class CppFunc {
}

export class CppMemInit {
constructor(public readonly name: string, public val: string) {}
constructor(
public readonly name: string,
public val: string,
) {}

init() {
return `${this.name}(${this.val})`;
Expand All @@ -125,7 +128,11 @@ export interface CppCtorProps extends CppFuncProps {

export class CppCtor extends CppMethod {
public mem_inits: CppMemInit[] = [];
constructor(public readonly name: string, public args: CppVar[], public _props: CppCtorProps = {}) {
constructor(
public readonly name: string,
public args: CppVar[],
public _props: CppCtorProps = {},
) {
super(name, "", args, _props);
if (_props.mem_inits) this.mem_inits = _props.mem_inits;
}
Expand Down
Loading

0 comments on commit 1a8c84c

Please sign in to comment.