Skip to content

Commit 69301ab

Browse files
committed
fix: lints
1 parent 7850644 commit 69301ab

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

app-config-extensions/src/index.test.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,6 @@ describe('$if directive', () => {
121121
});
122122

123123
it('doesnt evaluate the else branch', async () => {
124-
const failDirective = forKey('$fail', () => () => {
125-
throw new Error();
126-
});
127-
128124
const source = new LiteralSource({
129125
$if: {
130126
$check: true,
@@ -139,10 +135,6 @@ describe('$if directive', () => {
139135
});
140136

141137
it('doesnt evaluate the other branch', async () => {
142-
const failDirective = forKey('$fail', () => () => {
143-
throw new Error();
144-
});
145-
146138
const source = new LiteralSource({
147139
$if: {
148140
$check: false,

app-config-extensions/src/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ export function tryDirective(): ParsingExtension {
5252
.addProperty('$fallback', SchemaBuilder.fromJsonSchema({}))
5353
.addBoolean('$unsafe', {}, false),
5454
(value) => async (parse) => {
55+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
5556
const { $value, $fallback, $unsafe } = value;
5657

5758
try {
@@ -80,14 +81,14 @@ export function ifDirective(): ParsingExtension {
8081
.addProperty('$then', SchemaBuilder.fromJsonSchema({}))
8182
.addProperty('$else', SchemaBuilder.fromJsonSchema({})),
8283
(value) => async (parse) => {
84+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
8385
const { $check, $then, $else } = value;
8486
const condition = (await parse($check)).toJSON();
8587

8688
if (condition) {
8789
return parse($then, { shouldFlatten: true });
88-
} else {
89-
return parse($else, { shouldFlatten: true });
9090
}
91+
return parse($else, { shouldFlatten: true });
9192
},
9293
{ lazy: true },
9394
),

0 commit comments

Comments
 (0)