From 921cda6b17f7c5bf39a9e31373d299e1f085faa6 Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Thu, 23 Jan 2025 13:24:11 -0500 Subject: [PATCH] Run lint:fix --- .vscode/extensions.json | 2 +- .vscode/settings.json | 27 ++---- bin/update-package-json.mts | 1 - glimmer-vm.code-workspace | 94 +++++++++---------- guides/workspace/vscode.md | 2 - .../lib/components/emberish-curly.ts | 12 +-- .../lib/modes/rehydration/delegate.ts | 2 +- .../partial-rehydration-delegate.ts | 6 +- .../integration-tests/lib/snapshot.ts | 1 - .../test/compiler/compile-options-test.ts | 12 ++- .../test/ember-component-test.ts | 1 - .../test/partial-rehydration-test.ts | 2 +- .../test/strict-mode-test.ts | 2 +- ...ment-less-helper-paren-less-invoke-test.ts | 9 +- .../test/syntax/general-errors-test.ts | 8 +- .../test/syntax/if-unless-test.ts | 8 +- .../test/syntax/named-blocks-test.ts | 8 +- .../test/syntax/yield-keywords-test.ts | 8 +- .../test/updating-modifiers-test.ts | 2 +- .../test/updating-svg-test.ts | 7 +- .../lib/passes/2-encoding/expressions.ts | 7 +- packages/@glimmer/compiler/lib/shared/list.ts | 7 +- packages/@glimmer/constants/lib/immediate.ts | 5 +- packages/@glimmer/debug-util/index.ts | 2 +- .../@glimmer/debug/lib/dism/operand-types.ts | 5 +- packages/@glimmer/debug/lib/dism/operands.ts | 1 - packages/@glimmer/debug/lib/render/styles.ts | 2 +- .../lib/opcode-builder/helpers/resolution.ts | 30 ++++-- .../lib/compiled/opcodes/expressions.ts | 2 +- .../@glimmer/runtime/lib/dom/operations.ts | 2 +- packages/@glimmer/runtime/lib/environment.ts | 2 +- packages/@glimmer/runtime/lib/modifiers/on.ts | 2 +- packages/@glimmer/runtime/lib/vm/append.ts | 2 +- packages/@glimmer/syntax/lib/source/source.ts | 6 +- .../@glimmer/syntax/lib/v1/public-builders.ts | 2 +- packages/@glimmer/syntax/lib/v2/normalize.ts | 2 +- packages/@glimmer/tsconfig.test.json | 22 +---- packages/@glimmer/util/lib/debug-steps.ts | 2 +- tsconfig.json | 17 +--- 39 files changed, 176 insertions(+), 158 deletions(-) diff --git a/.vscode/extensions.json b/.vscode/extensions.json index d63f6664ce..4416b29e7c 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -9,4 +9,4 @@ "esbenp.prettier-vscode", "dnut.rewrap-revived" ] -} \ No newline at end of file +} diff --git a/.vscode/settings.json b/.vscode/settings.json index 51c26d26cf..9f9b7345d5 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -10,9 +10,7 @@ }, "editor.defaultFormatter": "esbenp.prettier-vscode", "editor.formatOnSave": false, - "editor.rulers": [ - 100 - ] + "editor.rulers": [100] }, "[json][jsonc][markdown][yaml]": { "editor.codeActionsOnSave": { @@ -33,7 +31,7 @@ { "color": "#aaaaaa66", "column": 80 - }, + } ], "eslint.codeAction.showDocumentation": { "enable": true @@ -48,12 +46,7 @@ "eslint.problems.shortenToSingleLine": true, "eslint.runtime": "node", "eslint.useFlatConfig": true, - "eslint.validate": [ - "javascript", - "typescript", - "json", - "jsonc" - ], + "eslint.validate": ["javascript", "typescript", "json", "jsonc"], "eslint.workingDirectories": [ { "pattern": "." @@ -126,15 +119,9 @@ } }, "inline-bookmarks.expert.custom.words.mapping": { - "audit": [ - "@audit(\\s|$)" - ], - "fixme": [ - "@fixme(\\s|$)" - ], - "warn": [ - "@premerge(\\s|$)" - ], + "audit": ["@audit(\\s|$)"], + "fixme": ["@fixme(\\s|$)"], + "warn": ["@premerge(\\s|$)"], "bandaid": [ "@bandaid\\(until:[^)]+\\)(\\s|$)", "@bandaid(?=\\{@link [^}]+\\}(\\s|$))", @@ -161,4 +148,4 @@ "typescript.tsdk": "node_modules/typescript/lib", "typescript.updateImportsOnFileMove.enabled": "always", "typescript.reportStyleChecksAsWarnings": false -} \ No newline at end of file +} diff --git a/bin/update-package-json.mts b/bin/update-package-json.mts index e9f4d7f763..de914e0c32 100644 --- a/bin/update-package-json.mts +++ b/bin/update-package-json.mts @@ -1,4 +1,3 @@ - import { existsSync, readFileSync, writeFileSync } from 'node:fs'; import { resolve } from 'node:path'; diff --git a/glimmer-vm.code-workspace b/glimmer-vm.code-workspace index b4d56840e8..d528cb3829 100644 --- a/glimmer-vm.code-workspace +++ b/glimmer-vm.code-workspace @@ -2,184 +2,184 @@ "folders": [ { "name": "✨ glimmer-engine", - "path": "." + "path": ".", }, { "name": "glimmer-benchmark", - "path": "benchmark" + "path": "benchmark", }, { "name": "@glimmer-workspace/krausest", - "path": "benchmark/benchmarks/krausest" + "path": "benchmark/benchmarks/krausest", }, { "name": "@glimmer-workspace/bin", - "path": "bin" + "path": "bin", }, { "name": "📦 packages", - "path": "packages" + "path": "packages", }, { "name": "📦 @glimmer-workspace/benchmark-env", - "path": "packages/@glimmer-workspace/benchmark-env" + "path": "packages/@glimmer-workspace/benchmark-env", }, { "name": "📦 @glimmer-workspace/build-support", - "path": "packages/@glimmer-workspace/build" + "path": "packages/@glimmer-workspace/build", }, { "name": "📦 @glimmer-workspace/eslint-plugin", - "path": "packages/@glimmer-workspace/eslint-plugin" + "path": "packages/@glimmer-workspace/eslint-plugin", }, { "name": "📦 @glimmer-workspace/integration-tests", - "path": "packages/@glimmer-workspace/integration-tests" + "path": "packages/@glimmer-workspace/integration-tests", }, { "name": "📦 @glimmer-workspace/test-utils", - "path": "packages/@glimmer-workspace/test-utils" + "path": "packages/@glimmer-workspace/test-utils", }, { "name": "📦 @glimmer/compiler", - "path": "packages/@glimmer/compiler" + "path": "packages/@glimmer/compiler", }, { "name": "📦 @glimmer-test/compiler", - "path": "packages/@glimmer/compiler/test" + "path": "packages/@glimmer/compiler/test", }, { "name": "📦 @glimmer/debug", - "path": "packages/@glimmer/debug" + "path": "packages/@glimmer/debug", }, { "name": "📦 @glimmer/destroyable", - "path": "packages/@glimmer/destroyable" + "path": "packages/@glimmer/destroyable", }, { "name": "📦 @glimmer-test/destroyable", - "path": "packages/@glimmer/destroyable/test" + "path": "packages/@glimmer/destroyable/test", }, { "name": "📦 @glimmer/dom-change-list", - "path": "packages/@glimmer/dom-change-list" + "path": "packages/@glimmer/dom-change-list", }, { "name": "📦 @glimmer-test/dom-change-list", - "path": "packages/@glimmer/dom-change-list/test" + "path": "packages/@glimmer/dom-change-list/test", }, { "name": "📦 @glimmer/encoder", - "path": "packages/@glimmer/encoder" + "path": "packages/@glimmer/encoder", }, { "name": "📦 @glimmer/global-context", - "path": "packages/@glimmer/global-context" + "path": "packages/@glimmer/global-context", }, { "name": "📦 @glimmer/interfaces", - "path": "packages/@glimmer/interfaces" + "path": "packages/@glimmer/interfaces", }, { "name": "📦 @glimmer/local-debug-flags", - "path": "packages/@glimmer/local-debug-flags" + "path": "packages/@glimmer/local-debug-flags", }, { "name": "📦 @glimmer/manager", - "path": "packages/@glimmer/manager" + "path": "packages/@glimmer/manager", }, { "name": "📦 @glimmer-test/manager", - "path": "packages/@glimmer/manager/test" + "path": "packages/@glimmer/manager/test", }, { "name": "📦 @glimmer/node", - "path": "packages/@glimmer/node" + "path": "packages/@glimmer/node", }, { "name": "📦 @glimmer/opcode-compiler", - "path": "packages/@glimmer/opcode-compiler" + "path": "packages/@glimmer/opcode-compiler", }, { "name": "📦 @glimmer/owner", - "path": "packages/@glimmer/owner" + "path": "packages/@glimmer/owner", }, { "name": "📦 @glimmer-test/owner", - "path": "packages/@glimmer/owner/test" + "path": "packages/@glimmer/owner/test", }, { "name": "📦 @glimmer/program", - "path": "packages/@glimmer/program" + "path": "packages/@glimmer/program", }, { "name": "📦 @glimmer-test/program", - "path": "packages/@glimmer/program/test" + "path": "packages/@glimmer/program/test", }, { "name": "📦 @glimmer/reference", - "path": "packages/@glimmer/reference" + "path": "packages/@glimmer/reference", }, { "name": "📦 @glimmer-test/reference", - "path": "packages/@glimmer/reference/test" + "path": "packages/@glimmer/reference/test", }, { "name": "📦 @glimmer/runtime", - "path": "packages/@glimmer/runtime" + "path": "packages/@glimmer/runtime", }, { "name": "📦 @glimmer/syntax", - "path": "packages/@glimmer/syntax" + "path": "packages/@glimmer/syntax", }, { "name": "📦 @glimmer-test/syntax", - "path": "packages/@glimmer/syntax/test" + "path": "packages/@glimmer/syntax/test", }, { "name": "📦 @glimmer/util", - "path": "packages/@glimmer/util" + "path": "packages/@glimmer/util", }, { "name": "📦 @glimmer-test/util", - "path": "packages/@glimmer/util/test" + "path": "packages/@glimmer/util/test", }, { "name": "📦 @glimmer/validator", - "path": "packages/@glimmer/validator" + "path": "packages/@glimmer/validator", }, { "name": "📦 @glimmer-test/validator", - "path": "packages/@glimmer/validator/test" + "path": "packages/@glimmer/validator/test", }, { "name": "📦 @glimmer/vm", - "path": "packages/@glimmer/vm" + "path": "packages/@glimmer/vm", }, { "name": "📦 @glimmer/vm-babel-plugins", - "path": "packages/@glimmer/vm-babel-plugins" + "path": "packages/@glimmer/vm-babel-plugins", }, { "name": "📦 @glimmer/wire-format", - "path": "packages/@glimmer/wire-format" + "path": "packages/@glimmer/wire-format", }, { "name": "📦 @types/js-reporters", - "path": "packages/@types/js-reporters" + "path": "packages/@types/js-reporters", }, { "name": "📦 @types/puppeteer-chromium-resolver", - "path": "packages/@types/puppeteer-chromium-resolver" + "path": "packages/@types/puppeteer-chromium-resolver", }, { "name": "📦 @types/qunit", - "path": "packages/@types/qunit" - } + "path": "packages/@types/qunit", + }, ], "settings": { "typescript.tsc.autoDetect": "on", "typescript.tsdk": "node_modules/typescript/lib", - "typescript.tsserver.experimental.enableProjectDiagnostics": true - } + "typescript.tsserver.experimental.enableProjectDiagnostics": true, + }, } diff --git a/guides/workspace/vscode.md b/guides/workspace/vscode.md index 80b7290396..4d3842caf9 100644 --- a/guides/workspace/vscode.md +++ b/guides/workspace/vscode.md @@ -73,8 +73,6 @@ See [Standard Annotations](./workspace-management.md#standard-annotations) in `w ![fixme](./demos/fixme.png) - - ### NPM Dependency Links (`herrmannplatz.npm-dependency-links`) This extension will turn your dependencies and devDependencies in your `package.json` into links to diff --git a/packages/@glimmer-workspace/integration-tests/lib/components/emberish-curly.ts b/packages/@glimmer-workspace/integration-tests/lib/components/emberish-curly.ts index fe5244c30d..010301e013 100644 --- a/packages/@glimmer-workspace/integration-tests/lib/components/emberish-curly.ts +++ b/packages/@glimmer-workspace/integration-tests/lib/components/emberish-curly.ts @@ -53,15 +53,15 @@ export class EmberishCurlyComponent { public static positionalParams: string[] | string = []; public dirtinessTag: DirtyableTag = createTag(); - public declare layout: Template; - public declare name: string; + declare public layout: Template; + declare public name: string; public tagName: Nullable = null; public attributeBindings: Nullable = null; - public declare attrs: Attrs; - public declare element: Element; - public declare bounds: Bounds; + declare public attrs: Attrs; + declare public element: Element; + declare public bounds: Bounds; public parentView: Nullable = null; - public declare args: CapturedNamedArguments; + declare public args: CapturedNamedArguments; public _guid: string; diff --git a/packages/@glimmer-workspace/integration-tests/lib/modes/rehydration/delegate.ts b/packages/@glimmer-workspace/integration-tests/lib/modes/rehydration/delegate.ts index 6f92a1c15e..14855b933a 100644 --- a/packages/@glimmer-workspace/integration-tests/lib/modes/rehydration/delegate.ts +++ b/packages/@glimmer-workspace/integration-tests/lib/modes/rehydration/delegate.ts @@ -65,7 +65,7 @@ export class RehydrationDelegate implements RenderDelegate { public clientDoc: SimpleDocument; public serverDoc: SimpleDocument; - public declare rehydrationStats: RehydrationStats; + declare public rehydrationStats: RehydrationStats; private self: Nullable = null; diff --git a/packages/@glimmer-workspace/integration-tests/lib/modes/rehydration/partial-rehydration-delegate.ts b/packages/@glimmer-workspace/integration-tests/lib/modes/rehydration/partial-rehydration-delegate.ts index 71deab99b0..047a8d32d4 100644 --- a/packages/@glimmer-workspace/integration-tests/lib/modes/rehydration/partial-rehydration-delegate.ts +++ b/packages/@glimmer-workspace/integration-tests/lib/modes/rehydration/partial-rehydration-delegate.ts @@ -10,11 +10,7 @@ export class PartialRehydrationDelegate extends RehydrationDelegate { this.registerComponent('TemplateOnly', 'TemplateOnly', name, layout); } - renderComponentClientSide( - name: string, - args: Dict, - element: SimpleElement - ): RenderResult { + renderComponentClientSide(name: string, args: Dict, element: SimpleElement): RenderResult { let cursor = { element, nextSibling: null }; let context = this.clientContext; let tree = this.getElementBuilder(context.env, cursor) as DebugRehydrateTree; diff --git a/packages/@glimmer-workspace/integration-tests/lib/snapshot.ts b/packages/@glimmer-workspace/integration-tests/lib/snapshot.ts index 4d15170ef5..23eec8d87d 100644 --- a/packages/@glimmer-workspace/integration-tests/lib/snapshot.ts +++ b/packages/@glimmer-workspace/integration-tests/lib/snapshot.ts @@ -151,7 +151,6 @@ export function normalizeSnapshot( const normalizedOld: IndividualSnapshot[] = []; const normalizedNew: IndividualSnapshot[] = []; - while (true) { const nextOld = oldIterator.peek(); const nextNew = newIterator.peek(); diff --git a/packages/@glimmer-workspace/integration-tests/test/compiler/compile-options-test.ts b/packages/@glimmer-workspace/integration-tests/test/compiler/compile-options-test.ts index 43e5dfbcbc..c166e06c1d 100644 --- a/packages/@glimmer-workspace/integration-tests/test/compiler/compile-options-test.ts +++ b/packages/@glimmer-workspace/integration-tests/test/compiler/compile-options-test.ts @@ -214,17 +214,21 @@ module('[glimmer-compiler] precompile', ({ test }) => { test('when "this" in in locals, it compiles to GetLexicalSymbol', (assert) => { let target = { message: 'hello' }; let _wire: ReturnType; - (function() { + (function () { _wire = compile(`{{this.message}}`, ['this'], (source) => eval(source)); - }).call(target) + }).call(target); let wire = _wire!; assert.deepEqual(wire.scope?.(), [target]); - assert.deepEqual(wire.block[0], [[SexpOpcodes.Append,[SexpOpcodes.GetLexicalSymbol,0,["message"]]]]) + assert.deepEqual(wire.block[0], [ + [SexpOpcodes.Append, [SexpOpcodes.GetLexicalSymbol, 0, ['message']]], + ]); }); test('when "this" is not in locals, it compiles to GetSymbol', (assert) => { let wire = compile(`{{this.message}}`, [], (source) => eval(source)); assert.strictEqual(wire.scope, undefined); - assert.deepEqual(wire.block[0], [[SexpOpcodes.Append,[SexpOpcodes.GetSymbol,0,["message"]]]]) + assert.deepEqual(wire.block[0], [ + [SexpOpcodes.Append, [SexpOpcodes.GetSymbol, 0, ['message']]], + ]); }); }); diff --git a/packages/@glimmer-workspace/integration-tests/test/ember-component-test.ts b/packages/@glimmer-workspace/integration-tests/test/ember-component-test.ts index 26716bdd70..5f1c5f4c50 100644 --- a/packages/@glimmer-workspace/integration-tests/test/ember-component-test.ts +++ b/packages/@glimmer-workspace/integration-tests/test/ember-component-test.ts @@ -2160,7 +2160,6 @@ class CurlyBoundsTrackingTest extends CurlyTest { assert.ok(instance, 'instance is created'); - this.assertEmberishElement('span', {}, 'foo bar'); const { bounds, element } = instance.captured; diff --git a/packages/@glimmer-workspace/integration-tests/test/partial-rehydration-test.ts b/packages/@glimmer-workspace/integration-tests/test/partial-rehydration-test.ts index 47e2eb0d8a..da8b8061cc 100644 --- a/packages/@glimmer-workspace/integration-tests/test/partial-rehydration-test.ts +++ b/packages/@glimmer-workspace/integration-tests/test/partial-rehydration-test.ts @@ -10,7 +10,7 @@ import { stripTight, suite, test, -} from "@glimmer-workspace/integration-tests"; +} from '@glimmer-workspace/integration-tests'; export class PartialRehydrationTest extends RenderTest { static suiteName = 'partial rehydration'; diff --git a/packages/@glimmer-workspace/integration-tests/test/strict-mode-test.ts b/packages/@glimmer-workspace/integration-tests/test/strict-mode-test.ts index 02a6accbb7..998bc6a1a7 100644 --- a/packages/@glimmer-workspace/integration-tests/test/strict-mode-test.ts +++ b/packages/@glimmer-workspace/integration-tests/test/strict-mode-test.ts @@ -11,7 +11,7 @@ import { test, TestHelper, trackedObj, -} from "@glimmer-workspace/integration-tests"; +} from '@glimmer-workspace/integration-tests'; class GeneralStrictModeTest extends RenderTest { static suiteName = 'strict mode: general properties'; diff --git a/packages/@glimmer-workspace/integration-tests/test/syntax/argument-less-helper-paren-less-invoke-test.ts b/packages/@glimmer-workspace/integration-tests/test/syntax/argument-less-helper-paren-less-invoke-test.ts index 54f3c24c2d..18567ce548 100644 --- a/packages/@glimmer-workspace/integration-tests/test/syntax/argument-less-helper-paren-less-invoke-test.ts +++ b/packages/@glimmer-workspace/integration-tests/test/syntax/argument-less-helper-paren-less-invoke-test.ts @@ -1,4 +1,11 @@ -import { defineSimpleHelper, jitSuite, preprocess, RenderTest, syntaxErrorFor, test } from "@glimmer-workspace/integration-tests"; +import { + defineSimpleHelper, + jitSuite, + preprocess, + RenderTest, + syntaxErrorFor, + test, +} from '@glimmer-workspace/integration-tests'; class ArgumentLessHelperParenLessInvokeTest extends RenderTest { static suiteName = 'argument-less helper paren-less invoke'; diff --git a/packages/@glimmer-workspace/integration-tests/test/syntax/general-errors-test.ts b/packages/@glimmer-workspace/integration-tests/test/syntax/general-errors-test.ts index fc249cdc8d..71a4a91857 100644 --- a/packages/@glimmer-workspace/integration-tests/test/syntax/general-errors-test.ts +++ b/packages/@glimmer-workspace/integration-tests/test/syntax/general-errors-test.ts @@ -1,4 +1,10 @@ -import { jitSuite, preprocess, RenderTest, syntaxErrorFor, test } from "@glimmer-workspace/integration-tests"; +import { + jitSuite, + preprocess, + RenderTest, + syntaxErrorFor, + test, +} from '@glimmer-workspace/integration-tests'; class SyntaxErrors extends RenderTest { static suiteName = 'general syntax errors'; diff --git a/packages/@glimmer-workspace/integration-tests/test/syntax/if-unless-test.ts b/packages/@glimmer-workspace/integration-tests/test/syntax/if-unless-test.ts index 88089db16b..ee0dfd6ebc 100644 --- a/packages/@glimmer-workspace/integration-tests/test/syntax/if-unless-test.ts +++ b/packages/@glimmer-workspace/integration-tests/test/syntax/if-unless-test.ts @@ -1,4 +1,10 @@ -import { jitSuite, preprocess, RenderTest, syntaxErrorFor, test } from "@glimmer-workspace/integration-tests"; +import { + jitSuite, + preprocess, + RenderTest, + syntaxErrorFor, + test, +} from '@glimmer-workspace/integration-tests'; const types = ['if', 'unless']; diff --git a/packages/@glimmer-workspace/integration-tests/test/syntax/named-blocks-test.ts b/packages/@glimmer-workspace/integration-tests/test/syntax/named-blocks-test.ts index 6248b06af7..a860a260fc 100644 --- a/packages/@glimmer-workspace/integration-tests/test/syntax/named-blocks-test.ts +++ b/packages/@glimmer-workspace/integration-tests/test/syntax/named-blocks-test.ts @@ -1,4 +1,10 @@ -import { jitSuite, preprocess, RenderTest, syntaxErrorFor, test } from "@glimmer-workspace/integration-tests"; +import { + jitSuite, + preprocess, + RenderTest, + syntaxErrorFor, + test, +} from '@glimmer-workspace/integration-tests'; class NamedBlocksSyntaxErrors extends RenderTest { static suiteName = 'named blocks syntax errors'; diff --git a/packages/@glimmer-workspace/integration-tests/test/syntax/yield-keywords-test.ts b/packages/@glimmer-workspace/integration-tests/test/syntax/yield-keywords-test.ts index 002e931031..bd50f33648 100644 --- a/packages/@glimmer-workspace/integration-tests/test/syntax/yield-keywords-test.ts +++ b/packages/@glimmer-workspace/integration-tests/test/syntax/yield-keywords-test.ts @@ -1,4 +1,10 @@ -import { jitSuite, preprocess, RenderTest, syntaxErrorFor, test } from "@glimmer-workspace/integration-tests"; +import { + jitSuite, + preprocess, + RenderTest, + syntaxErrorFor, + test, +} from '@glimmer-workspace/integration-tests'; class NamedBlocksSyntaxErrors extends RenderTest { static suiteName = 'yield keywords syntax errors'; diff --git a/packages/@glimmer-workspace/integration-tests/test/updating-modifiers-test.ts b/packages/@glimmer-workspace/integration-tests/test/updating-modifiers-test.ts index 2d1a10646e..d0cfdb0a87 100644 --- a/packages/@glimmer-workspace/integration-tests/test/updating-modifiers-test.ts +++ b/packages/@glimmer-workspace/integration-tests/test/updating-modifiers-test.ts @@ -1,5 +1,5 @@ import type { SimpleElement } from '@glimmer/interfaces'; -import { jitSuite, RenderTest, test } from "@glimmer-workspace/integration-tests"; +import { jitSuite, RenderTest, test } from '@glimmer-workspace/integration-tests'; import { assert } from './support'; diff --git a/packages/@glimmer-workspace/integration-tests/test/updating-svg-test.ts b/packages/@glimmer-workspace/integration-tests/test/updating-svg-test.ts index 68371b8b2f..86ae5a160b 100644 --- a/packages/@glimmer-workspace/integration-tests/test/updating-svg-test.ts +++ b/packages/@glimmer-workspace/integration-tests/test/updating-svg-test.ts @@ -1,6 +1,11 @@ import type { SimpleElement } from '@glimmer/interfaces'; import { NS_HTML, NS_SVG, NS_XLINK } from '@glimmer/constants'; -import { assertNodeTagName, jitSuite, RenderTest, test } from "@glimmer-workspace/integration-tests"; +import { + assertNodeTagName, + jitSuite, + RenderTest, + test, +} from '@glimmer-workspace/integration-tests'; import { assert } from './support'; diff --git a/packages/@glimmer/compiler/lib/passes/2-encoding/expressions.ts b/packages/@glimmer/compiler/lib/passes/2-encoding/expressions.ts index d63f165284..d546aec4be 100644 --- a/packages/@glimmer/compiler/lib/passes/2-encoding/expressions.ts +++ b/packages/@glimmer/compiler/lib/passes/2-encoding/expressions.ts @@ -1,6 +1,11 @@ import type { PresentArray, WireFormat } from '@glimmer/interfaces'; import type { ASTv2 } from '@glimmer/syntax'; -import { assertPresentArray, isPresentArray, localAssert, mapPresentArray } from '@glimmer/debug-util'; +import { + assertPresentArray, + isPresentArray, + localAssert, + mapPresentArray, +} from '@glimmer/debug-util'; import { SexpOpcodes } from '@glimmer/wire-format'; import type * as mir from './mir'; diff --git a/packages/@glimmer/compiler/lib/shared/list.ts b/packages/@glimmer/compiler/lib/shared/list.ts index cee745652c..15b48a2aaf 100644 --- a/packages/@glimmer/compiler/lib/shared/list.ts +++ b/packages/@glimmer/compiler/lib/shared/list.ts @@ -80,8 +80,5 @@ export function OptionalList(value: readonly T[]): AnyOptionalList { export type AnyOptionalList = (PresentList | EmptyList) & OptionalList; -export type MapList> = L extends PresentList - ? PresentList - : L extends EmptyList - ? EmptyList - : never; +export type MapList> = + L extends PresentList ? PresentList : L extends EmptyList ? EmptyList : never; diff --git a/packages/@glimmer/constants/lib/immediate.ts b/packages/@glimmer/constants/lib/immediate.ts index 09723bba28..41d60652f7 100644 --- a/packages/@glimmer/constants/lib/immediate.ts +++ b/packages/@glimmer/constants/lib/immediate.ts @@ -79,7 +79,10 @@ export function encodeNegative(num: number) { export function decodeNegative(num: number) { if (LOCAL_DEBUG) { - localAssert(num % 1 === 0 && num < ~MAX_INT && num >= MIN_SMI, `Could not decode negative: ${num}`); + localAssert( + num % 1 === 0 && num < ~MAX_INT && num >= MIN_SMI, + `Could not decode negative: ${num}` + ); } return num | ~SIGN_BIT; diff --git a/packages/@glimmer/debug-util/index.ts b/packages/@glimmer/debug-util/index.ts index c90aab7d82..8309761d9d 100644 --- a/packages/@glimmer/debug-util/index.ts +++ b/packages/@glimmer/debug-util/index.ts @@ -1,4 +1,4 @@ -export { assertNever, deprecate,default as localAssert } from './lib/assert'; +export { assertNever, deprecate, default as localAssert } from './lib/assert'; export * from './lib/debug-brand'; export { default as debugToString } from './lib/debug-to-string'; export * from './lib/platform-utils'; diff --git a/packages/@glimmer/debug/lib/dism/operand-types.ts b/packages/@glimmer/debug/lib/dism/operand-types.ts index c66c0b066c..b300da224a 100644 --- a/packages/@glimmer/debug/lib/dism/operand-types.ts +++ b/packages/@glimmer/debug/lib/dism/operand-types.ts @@ -49,9 +49,8 @@ export function isOperandType(s: string): s is OperandType { export type OPERAND_TYPE = (typeof OPERAND_TYPES)[number]; export type NonNullableOperandType = Exclude; -export type NullableOperandType = Extract extends `${infer S}?` - ? S - : never; +export type NullableOperandType = + Extract extends `${infer S}?` ? S : never; export type OperandType = NonNullableOperandType | NullableOperandType | `${NullableOperandType}?`; export interface NormalizedOperand { diff --git a/packages/@glimmer/debug/lib/dism/operands.ts b/packages/@glimmer/debug/lib/dism/operands.ts index 2cb41745c9..8cbb7c3154 100644 --- a/packages/@glimmer/debug/lib/dism/operands.ts +++ b/packages/@glimmer/debug/lib/dism/operands.ts @@ -58,7 +58,6 @@ class Disassembler { add & NonNullableOperandType>( names: K[], dism: OperandDisassembler - ): Disassembler { const add = (name: K, dism: OperandDisassembler) => (this.#disms[name] = dism); for (const name of names) { diff --git a/packages/@glimmer/debug/lib/render/styles.ts b/packages/@glimmer/debug/lib/render/styles.ts index 51fc7da500..f970f9ba2c 100644 --- a/packages/@glimmer/debug/lib/render/styles.ts +++ b/packages/@glimmer/debug/lib/render/styles.ts @@ -46,7 +46,7 @@ export const STYLES = { export type StyleName = keyof typeof STYLES; -export function mergeStyle(a?: string , b?: string ): string | undefined { +export function mergeStyle(a?: string, b?: string): string | undefined { if (a && b) { return `${a}; ${b}`; } else { diff --git a/packages/@glimmer/opcode-compiler/lib/opcode-builder/helpers/resolution.ts b/packages/@glimmer/opcode-compiler/lib/opcode-builder/helpers/resolution.ts index 93608f32eb..6f599a2679 100644 --- a/packages/@glimmer/opcode-compiler/lib/opcode-builder/helpers/resolution.ts +++ b/packages/@glimmer/opcode-compiler/lib/opcode-builder/helpers/resolution.ts @@ -126,7 +126,10 @@ export function resolveComponent( let definition = resolver?.lookupComponent?.(name, owner) ?? null; if (import.meta.env.DEV && (typeof definition !== 'object' || definition === null)) { - localAssert(!meta.isStrictMode, 'Strict mode errors should already be handled at compile time'); + localAssert( + !meta.isStrictMode, + 'Strict mode errors should already be handled at compile time' + ); throw new Error( `Attempted to resolve \`${name}\`, which was expected to be a component, but nothing was found.` @@ -173,7 +176,10 @@ export function resolveHelper( let helper = resolver?.lookupHelper?.(name, owner) ?? null; if (import.meta.env.DEV && helper === null) { - localAssert(!meta.isStrictMode, 'Strict mode errors should already be handled at compile time'); + localAssert( + !meta.isStrictMode, + 'Strict mode errors should already be handled at compile time' + ); throw new Error( `Attempted to resolve \`${name}\`, which was expected to be a helper, but nothing was found.` @@ -218,7 +224,10 @@ export function resolveModifier( let modifier = resolver?.lookupBuiltInModifier?.(name) ?? null; if (import.meta.env.DEV && modifier === null) { - localAssert(!meta.isStrictMode, 'Strict mode errors should already be handled at compile time'); + localAssert( + !meta.isStrictMode, + 'Strict mode errors should already be handled at compile time' + ); throw new Error( `Attempted to resolve a modifier in a strict mode template, but it was not in scope: ${name}` @@ -236,7 +245,10 @@ export function resolveModifier( let modifier = resolver?.lookupModifier?.(name, owner) ?? null; if (import.meta.env.DEV && modifier === null) { - localAssert(!meta.isStrictMode, 'Strict mode errors should already be handled at compile time'); + localAssert( + !meta.isStrictMode, + 'Strict mode errors should already be handled at compile time' + ); throw new Error( `Attempted to resolve \`${name}\`, which was expected to be a modifier, but nothing was found.` @@ -289,7 +301,10 @@ export function resolveComponentOrHelper( let helper = constants.helper(definition as object, null, true); if (import.meta.env.DEV && helper === null) { - localAssert(!meta.isStrictMode, 'Strict mode errors should already be handled at compile time'); + localAssert( + !meta.isStrictMode, + 'Strict mode errors should already be handled at compile time' + ); throw new Error( // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- @fixme @@ -325,7 +340,10 @@ export function resolveComponentOrHelper( let helper = resolver?.lookupHelper?.(name, owner) ?? null; if (import.meta.env.DEV && helper === null) { - localAssert(!meta.isStrictMode, 'Strict mode errors should already be handled at compile time'); + localAssert( + !meta.isStrictMode, + 'Strict mode errors should already be handled at compile time' + ); throw new Error( `Attempted to resolve \`${name}\`, which was expected to be a component or helper, but nothing was found.` diff --git a/packages/@glimmer/runtime/lib/compiled/opcodes/expressions.ts b/packages/@glimmer/runtime/lib/compiled/opcodes/expressions.ts index bdb5498321..c27b0ca519 100644 --- a/packages/@glimmer/runtime/lib/compiled/opcodes/expressions.ts +++ b/packages/@glimmer/runtime/lib/compiled/opcodes/expressions.ts @@ -36,7 +36,7 @@ import { CheckNullable, CheckOr, } from '@glimmer/debug'; -import { debugToString,localAssert } from '@glimmer/debug-util'; +import { debugToString, localAssert } from '@glimmer/debug-util'; import { _hasDestroyableChildren, associateDestroyableChild, destroy } from '@glimmer/destroyable'; import { debugAssert, toBool } from '@glimmer/global-context'; import { getInternalHelperManager } from '@glimmer/manager'; diff --git a/packages/@glimmer/runtime/lib/dom/operations.ts b/packages/@glimmer/runtime/lib/dom/operations.ts index 15a6d7ee5c..3830fd1b33 100644 --- a/packages/@glimmer/runtime/lib/dom/operations.ts +++ b/packages/@glimmer/runtime/lib/dom/operations.ts @@ -27,7 +27,7 @@ const SVG_INTEGRATION_POINTS = { foreignObject: 1, desc: 1, title: 1 }; export const BLACKLIST_TABLE = Object.create(null) as Dict<1>; export class DOMOperations { - protected declare uselessElement: SimpleElement; // Set by this.setupUselessElement() in constructor + declare protected uselessElement: SimpleElement; // Set by this.setupUselessElement() in constructor constructor(protected document: SimpleDocument) { this.setupUselessElement(); diff --git a/packages/@glimmer/runtime/lib/environment.ts b/packages/@glimmer/runtime/lib/environment.ts index c92de78e45..547c49b383 100644 --- a/packages/@glimmer/runtime/lib/environment.ts +++ b/packages/@glimmer/runtime/lib/environment.ts @@ -12,7 +12,7 @@ import type { Transaction, TransactionSymbol, } from '@glimmer/interfaces'; -import { expect,localAssert } from '@glimmer/debug-util'; +import { expect, localAssert } from '@glimmer/debug-util'; import { ProgramImpl } from '@glimmer/program'; import { track, updateTag } from '@glimmer/validator'; diff --git a/packages/@glimmer/runtime/lib/modifiers/on.ts b/packages/@glimmer/runtime/lib/modifiers/on.ts index 3b5ef57cbe..8941cda0c5 100644 --- a/packages/@glimmer/runtime/lib/modifiers/on.ts +++ b/packages/@glimmer/runtime/lib/modifiers/on.ts @@ -13,7 +13,7 @@ import { CheckString, CheckUndefined, } from '@glimmer/debug'; -import { buildUntouchableThis,localAssert } from '@glimmer/debug-util'; +import { buildUntouchableThis, localAssert } from '@glimmer/debug-util'; import { registerDestructor } from '@glimmer/destroyable'; import { setInternalModifierManager } from '@glimmer/manager'; import { valueForRef } from '@glimmer/reference'; diff --git a/packages/@glimmer/runtime/lib/vm/append.ts b/packages/@glimmer/runtime/lib/vm/append.ts index 2075b07e21..071117d5e0 100644 --- a/packages/@glimmer/runtime/lib/vm/append.ts +++ b/packages/@glimmer/runtime/lib/vm/append.ts @@ -98,7 +98,7 @@ if (LOCAL_DEBUG) { get active(): BlockMetadata | null { const current = this.#active.at(-1); - return current ? this.#templates.get(current) ?? null : null; + return current ? (this.#templates.get(current) ?? null) : null; } register(handle: Handle, metadata: BlockMetadata): void { diff --git a/packages/@glimmer/syntax/lib/source/source.ts b/packages/@glimmer/syntax/lib/source/source.ts index fcb4a508e0..fbd2aaffd7 100644 --- a/packages/@glimmer/syntax/lib/source/source.ts +++ b/packages/@glimmer/syntax/lib/source/source.ts @@ -48,7 +48,6 @@ export class Source { return null; } - while (true) { let nextLine = this.source.indexOf('\n', seenChars); @@ -81,7 +80,10 @@ export class Source { if (import.meta.env.DEV) { let roundTrip = this.hbsPosFor(seenChars + column); localAssert(roundTrip !== null, `the returned offset failed to round-trip`); - localAssert(roundTrip.line === line, `the round-tripped line didn't match the original line`); + localAssert( + roundTrip.line === line, + `the round-tripped line didn't match the original line` + ); localAssert( roundTrip.column === column, `the round-tripped column didn't match the original column` diff --git a/packages/@glimmer/syntax/lib/v1/public-builders.ts b/packages/@glimmer/syntax/lib/v1/public-builders.ts index b90fec7e0f..95acee33fe 100644 --- a/packages/@glimmer/syntax/lib/v1/public-builders.ts +++ b/packages/@glimmer/syntax/lib/v1/public-builders.ts @@ -1,5 +1,5 @@ import type { Dict, Maybe, Nullable } from '@glimmer/interfaces'; -import { asPresentArray, deprecate, isPresentArray,localAssert } from '@glimmer/debug-util'; +import { asPresentArray, deprecate, isPresentArray, localAssert } from '@glimmer/debug-util'; import type { SourceLocation, SourcePosition } from '../source/location'; import type * as ASTv1 from './api'; diff --git a/packages/@glimmer/syntax/lib/v2/normalize.ts b/packages/@glimmer/syntax/lib/v2/normalize.ts index e09ad40e21..8333a6ccd2 100644 --- a/packages/@glimmer/syntax/lib/v2/normalize.ts +++ b/packages/@glimmer/syntax/lib/v2/normalize.ts @@ -1,5 +1,5 @@ import type { PresentArray } from '@glimmer/interfaces'; -import { asPresentArray, isPresentArray,localAssert } from '@glimmer/debug-util'; +import { asPresentArray, isPresentArray, localAssert } from '@glimmer/debug-util'; import { assign } from '@glimmer/util'; import type { diff --git a/packages/@glimmer/tsconfig.test.json b/packages/@glimmer/tsconfig.test.json index 1185952fc8..efeb32d1ad 100644 --- a/packages/@glimmer/tsconfig.test.json +++ b/packages/@glimmer/tsconfig.test.json @@ -1,12 +1,7 @@ { "compilerOptions": { "composite": true, - "lib": [ - "esnext", - "DOM", - "DOM.Iterable", - "ES2015.Iterable" - ], + "lib": ["esnext", "DOM", "DOM.Iterable", "ES2015.Iterable"], "allowJs": true, "inlineSources": true, "inlineSourceMap": true, @@ -27,19 +22,10 @@ "noPropertyAccessFromIndexSignature": true, "noUncheckedIndexedAccess": true, "skipLibCheck": true, - "types": [ - "qunit", - "node", - "vite/client" - ] + "types": ["qunit", "node", "vite/client"] }, - "include": [ - "./*/test/**/*" - ], - "exclude": [ - "./*/test/node_modules", - "**/fixtures" - ], + "include": ["./*/test/**/*"], + "exclude": ["./*/test/node_modules", "**/fixtures"], "references": [ { "path": "./tsconfig.json" diff --git a/packages/@glimmer/util/lib/debug-steps.ts b/packages/@glimmer/util/lib/debug-steps.ts index 6f774d05d7..bdd979af3b 100644 --- a/packages/@glimmer/util/lib/debug-steps.ts +++ b/packages/@glimmer/util/lib/debug-steps.ts @@ -1,6 +1,6 @@ /// -import { expect,localAssert } from '@glimmer/debug-util'; +import { expect, localAssert } from '@glimmer/debug-util'; import { LOCAL_DEBUG, LOCAL_TRACE_LOGGING } from '@glimmer/local-debug-flags'; import { LOCAL_LOGGER } from '../index'; diff --git a/tsconfig.json b/tsconfig.json index 6e36a2203c..5df27cdb99 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -18,13 +18,9 @@ "experimentalDecorators": true, "useDefineForClassFields": false, "outDir": "ts-dist", - "customConditions": [ - "@glimmer-vm/source" - ] + "customConditions": ["@glimmer-vm/source"] }, - "files": [ - "eslint.config.js" - ], + "files": ["eslint.config.js"], "include": [ ".meta-updater/**/*", "repo-metadata/**/*", @@ -41,10 +37,5 @@ "bin/**/*", "**/*.config.mts" ], - "exclude": [ - "ts-dist", - "**/dist/**", - "**/node_modules/**", - "**/fixtures/**" - ] -} \ No newline at end of file + "exclude": ["ts-dist", "**/dist/**", "**/node_modules/**", "**/fixtures/**"] +}