Skip to content

Commit

Permalink
Fix lint errors introduced by updated eslint etc
Browse files Browse the repository at this point in the history
  • Loading branch information
eyelidlessness committed Dec 18, 2024
1 parent 1066d74 commit 70fb0fb
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 9 deletions.
1 change: 1 addition & 0 deletions packages/common/src/test/assertions/dom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ export const expectEqualNode = (actual: Node, expected: Node) => {
} else if (isCommentNode(expected)) {
expectEqualComment(actual, expected);
} else {
// eslint-disable-next-line @typescript-eslint/no-base-to-string -- Intentional fallback
throw new Error(`Unhandled expected node: ${String(expected)}`);
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ export type ExpectExtension =
| TypedExpectExtension
| UntypedExpectExtension;

export type ExpectExtensionRecord<MethodName extends string> = {
[K in MethodName]: ExpectExtension;
};
export type ExpectExtensionRecord<MethodName extends string> = Readonly<
Record<MethodName, ExpectExtension>
>;

// prettier-ignore
export type DeriveStaticVitestExpectExtension<
Expand Down
5 changes: 5 additions & 0 deletions packages/scenario/src/answer/ExpectedApproximateUOMAnswer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export abstract class UOMValue implements CustomInspectable {

constructor(readonly unitValue: number) {}

[Symbol.toPrimitive](hint: 'string'): string;
[Symbol.toPrimitive](hint: ToPrimitiveHint = 'default'): number | string {
const { unitValue } = this;

Expand All @@ -48,6 +49,10 @@ export abstract class UOMValue implements CustomInspectable {

return `${baseResult}${String(errorTolerance)} ${uom})`;
}

toString(): string {
return this[Symbol.toPrimitive]('string');
}
}

export class ExpectedApproximateUOMAnswer<
Expand Down
2 changes: 1 addition & 1 deletion packages/web-forms/e2e/build/style.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ test('Build includes component-defined styles', async ({ page }) => {
// variable, in OdkWebForm.vue.
const colors = ['rgb(255, 0, 0)', 'rgb(0, 255, 0)', 'rgb(0, 0, 255)'];

for await (const color of colors) {
for (const color of colors) {
await expect(page.locator('body')).not.toHaveCSS('background-color', color);

await page.locator('html').evaluate((pageRoot, gray200) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/web-forms/e2e/build/wf-preview.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ test('Web Forms Preview: demo forms load', async ({ context, page }) => {

expect(formPreviewLinks.length).toBeGreaterThan(0);

for await (const link of formPreviewLinks) {
for (const link of formPreviewLinks) {
const [previewPage] = await Promise.all([context.waitForEvent('page'), link.click()]);

await previewPage.waitForSelector(
Expand Down
2 changes: 1 addition & 1 deletion packages/web-forms/tests/components/FormPanel.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { globalMountOptions } from '../helpers';

const mountComponent = (props: PanelProps) => {
return mount(FormPanel, {
props, // eslint-disable-line @typescript-eslint/no-unsafe-assignment
props,
global: globalMountOptions,
});
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ class GeoJSONSecondaryInstanceFeaturePropertyElement extends StaticElement {
const { id = propertiesId } = feature;

if (id !== undefined) {
// eslint-disable-next-line @typescript-eslint/no-base-to-string -- Intentional fallback, we don't know what this is and it could be any permutation of JSON
yield new this(parent, 'id', String(id));
}

Expand Down
7 changes: 4 additions & 3 deletions packages/xforms-engine/src/parse/xpath/semantic-analysis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -396,9 +396,10 @@ const findConstantExpressionNode = (expression: string): ConstantExpressionSynta
}
};

type BrandedExpression<Expression extends string, Brand extends symbol> = Expression & {
readonly [K in Brand]: true;
};
// prettier-ignore
type BrandedExpression<Expression extends string, Brand extends symbol> =
& Expression
& Readonly<Record<Brand, true>>;

const CONSTANT_EXPRESSION = Symbol('CONSTANT_EXPRESSION');
type CONSTANT_EXPRESSION = typeof CONSTANT_EXPRESSION;
Expand Down

0 comments on commit 70fb0fb

Please sign in to comment.