Skip to content

Commit 68bd0a8

Browse files
committed
Linting
1 parent 3eca5c5 commit 68bd0a8

3 files changed

Lines changed: 8 additions & 12 deletions

File tree

demo/js/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ export const app = (window.app = createApp({
193193
} else if (preview.buildVolume && !settings.value.drawBuildVolume) {
194194
preview.buildVolume = undefined;
195195
}
196-
preview.boundingBoxColor = drawBoundingBox.value ? settings.value.boundingBoxColor ?? 'magenta' : undefined;
196+
preview.boundingBoxColor = drawBoundingBox.value ? (settings.value.boundingBoxColor ?? 'magenta') : undefined;
197197
});
198198

199199
watchEffect(() => {

src/indexers.ts

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export class NonApplicableIndexer extends Error {}
1111
* @remarks
1212
* Indexers organize paths into different structures (layers, tools, etc.)
1313
*/
14-
export class Indexer {
14+
export abstract class Indexer {
1515
/** The indexes being managed by this indexer */
1616
protected indexes: unknown;
1717

@@ -28,18 +28,15 @@ export class Indexer {
2828
* @param path - Path to sort
2929
* @throws Error if not implemented in subclass
3030
*/
31-
sortIn(path: Path): void {
32-
path;
33-
throw new Error('Method not implemented.');
34-
}
31+
abstract sortIn(path: Path): void;
3532
}
3633

3734
/**
3835
* Indexer that organizes paths by travel type (extrusion vs travel moves)
3936
*/
4037
export class TravelTypeIndexer extends Indexer {
4138
/** Indexes containing arrays of paths for each travel type */
42-
protected declare indexes: Record<string, Path[]>;
39+
declare protected indexes: Record<string, Path[]>;
4340

4441
/**
4542
* Creates a new TravelTypeIndexer
@@ -79,7 +76,7 @@ export class LayersIndexer extends Indexer {
7976
static readonly DEFAULT_TOLERANCE = 0.05;
8077

8178
/** Array of layers being managed */
82-
protected declare indexes: Layer[];
79+
declare protected indexes: Layer[];
8380

8481
/** Tolerance for layer height differences */
8582
private tolerance: number;
@@ -146,7 +143,7 @@ export class LayersIndexer extends Indexer {
146143
*/
147144
export class ToolIndexer extends Indexer {
148145
/** 2D array of paths indexed by tool number */
149-
protected declare indexes: Path[][];
146+
declare protected indexes: Path[][];
150147

151148
/**
152149
* Creates a new ToolIndexer
@@ -162,7 +159,6 @@ export class ToolIndexer extends Indexer {
162159
*/
163160
sortIn(path: Path): void {
164161
if (path.travelType === PathType.Extrusion) {
165-
this.indexes;
166162
this.indexes[path.tool] = this.indexes[path.tool] || [];
167163
if (this.indexes[path.tool] === undefined) {
168164
this.indexes[path.tool] = [];

src/webgl-preview.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -497,9 +497,9 @@ export class WebGLPreview {
497497
* @private
498498
*/
499499
private updateClippingPlanes() {
500-
const minZ = !this._startLayer ? 0 : this.job.layers[this._startLayer - 1]?.z ?? 0;
500+
const minZ = !this._startLayer ? 0 : (this.job.layers[this._startLayer - 1]?.z ?? 0);
501501

502-
const maxZ = !this._endLayer ? Infinity : this.job.layers[this._endLayer - 1]?.z ?? Infinity;
502+
const maxZ = !this._endLayer ? Infinity : (this.job.layers[this._endLayer - 1]?.z ?? Infinity);
503503

504504
this.updateClippingPlanesForShaderMaterials(minZ, maxZ);
505505
this.updateLineClipping(minZ, maxZ);

0 commit comments

Comments
 (0)