Skip to content

Commit fec555f

Browse files
authored
chore(core): Release by scope and update ESLint's member-ordering rule (#107)
1 parent a30ae44 commit fec555f

File tree

6 files changed

+33
-30
lines changed

6 files changed

+33
-30
lines changed

.eslintrc.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@
8181
"static-method",
8282
"abstract-method",
8383
"protected-method",
84-
"private-method",
85-
"public-method"
84+
"public-method",
85+
"private-method"
8686
],
8787
"interfaces": { "order": "alphabetically" },
8888
"typeLiterals": { "order": "alphabetically" }

packages/core/.releaserc.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
"main"
55
],
66
"plugins": [
7-
"@semantic-release/commit-analyzer",
7+
["@semantic-release/commit-analyzer", {
8+
"releaseRules": [{ "scope": "!core", "release": false }]
9+
}],
810
"@semantic-release/release-notes-generator",
911
"semantic-release-yarn",
1012
"@semantic-release/github"

packages/core/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"engines": {
2323
"node": ">=16"
2424
},
25+
"packageManager": "yarn@3.6.1",
2526
"scripts": {
2627
"build": "tsc -p tsconfig.prod.json",
2728
"check": "yarn compile && yarn test --forbid-only",

packages/core/src/lib/Assertion.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -95,18 +95,6 @@ export class Assertion<T> {
9595
return this.normalized();
9696
}
9797

98-
private proxyInverter(isInverted: boolean): ProxyHandler<this>["get"] {
99-
return (target, p) => {
100-
const key = isKeyOf(target, p) ? p : undefined;
101-
102-
if (key === "inverted") {
103-
return isInverted;
104-
}
105-
106-
return key ? target[key] : undefined;
107-
};
108-
}
109-
11098
/**
11199
* Check if the value matches the given predicate.
112100
*
@@ -535,4 +523,16 @@ export class Assertion<T> {
535523
message: `Expected <${prettify(this.actual)}> to be of type "${typeName}"`,
536524
});
537525
}
526+
527+
private proxyInverter(isInverted: boolean): ProxyHandler<this>["get"] {
528+
return (target, p) => {
529+
const key = isKeyOf(target, p) ? p : undefined;
530+
531+
if (key === "inverted") {
532+
return isInverted;
533+
}
534+
535+
return key ? target[key] : undefined;
536+
};
537+
}
538538
}

packages/core/src/lib/FunctionAssertion.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,6 @@ export class FunctionAssertion<T extends AnyFunction> extends Assertion<T> {
2828
super(actual);
2929
}
3030

31-
private captureError<X>(): X | typeof NoThrow {
32-
try {
33-
this.actual();
34-
return NoThrow;
35-
} catch (error) {
36-
return error as X;
37-
}
38-
}
39-
4031
/**
4132
* Check if the function throws when called. Optionally, you can check that
4233
* the thrown error is strictly equal to an `Error` instance by passing it as
@@ -192,4 +183,13 @@ export class FunctionAssertion<T extends AnyFunction> extends Assertion<T> {
192183
? new typeFactory.Factory(captured)
193184
: new Assertion(captured) as A;
194185
}
186+
187+
private captureError<X>(): X | typeof NoThrow {
188+
try {
189+
this.actual();
190+
return NoThrow;
191+
} catch (error) {
192+
return error as X;
193+
}
194+
}
195195
}

packages/core/src/lib/ObjectAssertion.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,6 @@ export class ObjectAssertion<T extends Struct> extends Assertion<T> {
1717
super(actual);
1818
}
1919

20-
private hasOwnProp(prop: PropertyKey | undefined): boolean {
21-
return prop !== undefined
22-
? Object.prototype.hasOwnProperty.call(this.actual, prop)
23-
: false;
24-
}
25-
2620
/**
2721
* Check if the object is empty. That is, when the object doesn't have any
2822
* properties.
@@ -458,4 +452,10 @@ export class ObjectAssertion<T extends Struct> extends Assertion<T> {
458452
invertedError,
459453
});
460454
}
455+
456+
private hasOwnProp(prop: PropertyKey | undefined): boolean {
457+
return prop !== undefined
458+
? Object.prototype.hasOwnProperty.call(this.actual, prop)
459+
: false;
460+
}
461461
}

0 commit comments

Comments
 (0)