Skip to content

Commit 6f96981

Browse files
committed
chore: fix lint errors
1 parent db0cfa4 commit 6f96981

12 files changed

Lines changed: 23 additions & 25 deletions

File tree

biome.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
"!**/pnpm-lock.yaml",
2828
"!**/CHANGELOG.md",
2929
"!docs/superpowers/specs/dist-snapshot.txt",
30-
"!docs/superpowers/specs/dist-package.json.snapshot"
30+
"!docs/superpowers/specs/dist-package.json.snapshot",
31+
"!audit.html"
3132
]
3233
},
3334
"formatter": {

packages/shadow-objects-e2e/vite.config.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import {readdirSync} from 'fs';
2-
import {basename, dirname, resolve} from 'path';
3-
import {fileURLToPath} from 'url';
1+
import {readdirSync} from 'node:fs';
2+
import {basename, dirname, resolve} from 'node:path';
3+
import {fileURLToPath} from 'node:url';
44
import {defineConfig} from 'vite';
55

66
const projectRoot = dirname(fileURLToPath(import.meta.url));

packages/shadow-objects-testing/test/emit-helper/emit-helper.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ describe('ShadowObjectCreationAPI.emit helper', () => {
2222
afterEach(() => {
2323
ComponentContext.get().clear();
2424
const localEnv = document.getElementById('localEnv');
25-
if (localEnv && localEnv.shadowEnv) {
25+
if (localEnv?.shadowEnv) {
2626
localEnv.shadowEnv.destroy();
2727
}
2828
});

packages/shadow-objects/src/elements/ShaePropElement.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ export class ShaePropElement extends HTMLElement {
226226

227227
case 'int[]':
228228
case 'integer[]':
229-
value = value.split(/\s+/).map((v) => parseInt(v));
229+
value = value.split(/\s+/).map((v) => parseInt(v, 10));
230230
break;
231231

232232
case 'hex[]':

packages/shadow-objects/src/in-the-dark/Kernel.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,8 +334,8 @@ describe('Kernel', () => {
334334
]);
335335

336336
expect(capturedProps).toBeDefined();
337-
expect(value(capturedProps!['foo'])).toBe('valueA');
338-
expect(value(capturedProps!['bar'])).toBe('valueB');
337+
expect(value(capturedProps!.foo)).toBe('valueA');
338+
expect(value(capturedProps!.bar)).toBe('valueB');
339339

340340
kernel.destroy();
341341
});

packages/shadow-objects/src/in-the-dark/Registry.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ const addRoutes = (set: Set<string>, routes: string[] | Set<string>) => {
2323

2424
const addConstructors = (entry: RegistryEntry | null | undefined, constructors: Set<ShadowObjectConstructor>) => {
2525
if (entry != null) {
26-
for (const constructor of entry.constructors) {
27-
constructors.add(constructor);
26+
for (const c of entry.constructors) {
27+
constructors.add(c);
2828
}
2929
}
3030
};
@@ -40,11 +40,11 @@ export class Registry {
4040
readonly #routes = new Map<string, Set<string>>();
4141
readonly #truthyPropRoutes = new Map<string, {routes: Set<string>; token?: string}>();
4242

43-
define(token: string, constructor: ShadowObjectConstructor) {
43+
define(token: string, constructa: ShadowObjectConstructor) {
4444
if (this.#registry.has(token)) {
45-
appendTo(this.#registry.get(token)!.constructors, constructor);
45+
appendTo(this.#registry.get(token)!.constructors, constructa);
4646
} else {
47-
this.#registry.set(token, {token, constructors: [constructor]});
47+
this.#registry.set(token, {token, constructors: [constructa]});
4848
}
4949
}
5050

packages/shadow-objects/src/in-the-dark/ShadowObject.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export function ShadowObject(options: ShadowObjectDecoratorOptions) {
2929
* If you don't want to use the decorator, you can simply call this method instead.
3030
*/
3131
export const shadowObjects = {
32-
define(token: string, constructor: ShadowObjectConstructor, registry?: Registry) {
33-
Registry.get(registry).define(token, constructor);
32+
define(token: string, constructa: ShadowObjectConstructor, registry?: Registry) {
33+
Registry.get(registry).define(token, constructa);
3434
},
3535
};

packages/shadow-objects/src/in-the-dark/importModule.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ export async function importModule(
2121
const {registry} = kernel;
2222

2323
if (module.define) {
24-
for (const [token, constructor] of Object.entries(module.define)) {
25-
registry.define(token, constructor as ShadowObjectConstructor);
24+
for (const [token, constructa] of Object.entries(module.define)) {
25+
registry.define(token, constructa as ShadowObjectConstructor);
2626
}
2727
}
2828

@@ -33,7 +33,7 @@ export async function importModule(
3333
}
3434

3535
await (module.initialize?.({
36-
define: (token, constructor) => registry.define(token, constructor as ShadowObjectConstructor),
36+
define: (token, constructa) => registry.define(token, constructa as ShadowObjectConstructor),
3737
kernel,
3838
registry,
3939
}) ?? Promise.resolve());

packages/shadow-objects/src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ export type ShadowObjectType = EventizedObject;
187187
export type NamespaceType = string | symbol;
188188

189189
export type ShadowObjectsModuleInitializer = (shadowObjects: {
190-
define: (token: string, constructor: ShadowObjectConstructor | ShadowObjectConstructorFunc) => void;
190+
define: (token: string, constructa: ShadowObjectConstructor | ShadowObjectConstructorFunc) => void;
191191
kernel: Kernel;
192192
registry: Registry;
193193
}) => Promise<void>;

packages/shadow-objects/src/utils/FrameLoop.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ export class FrameLoop {
66
static OnFrame = Symbol('onFrame');
77

88
#rafID = 0;
9-
#subscriptionCount = 0;
109

1110
constructor() {
1211
if (gUniqInstance) return gUniqInstance;
@@ -23,8 +22,6 @@ export class FrameLoop {
2322

2423
on(this as FrameLoop, FrameLoop.OnFrame, target);
2524

26-
this.#subscriptionCount++;
27-
2825
return () => {
2926
this.stop(target);
3027
};

0 commit comments

Comments
 (0)