From 5bbd7b1d71a4c0019e04ffed7560e87e616e5457 Mon Sep 17 00:00:00 2001 From: Yehuda Katz Date: Thu, 4 May 2023 18:57:34 -0700 Subject: [PATCH] Fix lint --- build/debug.js | 2 +- packages/@glimmer/syntax/test/support.ts | 17 ++++++++++++++++- packages/@glimmer/vm/tsconfig.json | 2 +- tsconfig.build.json | 3 ++- tsconfig.json | 2 +- 5 files changed, 21 insertions(+), 5 deletions(-) diff --git a/build/debug.js b/build/debug.js index 225ed23076..bcba305a04 100644 --- a/build/debug.js +++ b/build/debug.js @@ -4,7 +4,7 @@ const fs = require('fs'); const toml = require('toml'); const prettier = require('prettier'); -const { normalizeAll, buildEnum, buildMetas, strip } = require('../dist/@glimmer/debug'); +const { normalizeAll, buildEnum, buildMetas, strip } = require('@glimmer/debug'); function parse(file) { let opcodes = fs.readFileSync(file, { encoding: 'utf8' }); diff --git a/packages/@glimmer/syntax/test/support.ts b/packages/@glimmer/syntax/test/support.ts index 38fce21d58..110e6f1a34 100644 --- a/packages/@glimmer/syntax/test/support.ts +++ b/packages/@glimmer/syntax/test/support.ts @@ -11,7 +11,7 @@ function normalizeValue(obj: T): T { if (Array.isArray(obj)) { return obj.map(normalizeValue) as T; } else { - return Object.fromEntries( + return fromEntries( entries(obj).flatMap(([key, value]) => key === 'loc' ? [] : [[key, normalizeValue(value)]] ) @@ -22,6 +22,21 @@ function normalizeValue(obj: T): T { } } +// convert entries ([string, unknown][]) into a record +type FromEntries = { + [K in T[number] as K[0]]: Extract[1]; +}; + +function fromEntries(entries: T): FromEntries { + let out: any = {}; + + for (let [key, value] of entries) { + out[key as string] = value; + } + + return out as FromEntries; +} + export function astEqual( actual: any | null | undefined, expected: any | null | undefined, diff --git a/packages/@glimmer/vm/tsconfig.json b/packages/@glimmer/vm/tsconfig.json index 444404f867..cf644ec2e4 100644 --- a/packages/@glimmer/vm/tsconfig.json +++ b/packages/@glimmer/vm/tsconfig.json @@ -27,5 +27,5 @@ "skipLibCheck": true }, - "include": ["lib/**/*.ts", "index.ts"] + "include": ["lib/**/*.ts", "index.ts", "**/fixtures/**/*"] } diff --git a/tsconfig.build.json b/tsconfig.build.json index 25535ac21e..fd738a1790 100644 --- a/tsconfig.build.json +++ b/tsconfig.build.json @@ -19,5 +19,6 @@ "server/**/*", "packages/build-utils/@glimmer/**/*", "./*.js" - ] + ], + "exclude": ["**/fixtures/**/*"] } diff --git a/tsconfig.json b/tsconfig.json index f3a9d28150..326530dc28 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -33,5 +33,5 @@ "skipLibCheck": true }, "include": ["packages/**/*.ts", "packages/interfaces/**/*.d.ts"], - "exclude": ["dist", "ts-dist", "**/dist", "tmp", "node_modules", ".vscode"] + "exclude": ["dist", "ts-dist", "**/dist", "tmp", "node_modules", ".vscode", "**/fixtures/**/*"] }