Updated switch indentation linting

This commit is contained in:
Lucas Dower 2022-04-13 20:04:19 +01:00
parent 520f31c981
commit 335f6ed984
5 changed files with 96 additions and 93 deletions

View File

@ -19,7 +19,7 @@
"object-curly-spacing": "off",
"max-len": "off",
"require-jsdoc": "off",
"indent": ["error", 4],
"indent": ["error", 4, { "SwitchCase": 1 }],
"no-multi-spaces": "off",
"no-array-constructor": "off",
"guard-for-in": "off",
@ -27,6 +27,9 @@
"no-trailing-spaces": "off",
"new-cap": "off",
"no-console": "warn",
"no-unused-vars": "warn"
"no-unused-vars": "warn",
"brace-style": [2, "1tbs", { "allowSingleLine": true }],
"block-spacing": [2, "always"],
"semi": "error"
}
}

View File

@ -119,18 +119,18 @@ export class VectorSpinboxElement extends LabelledElement<Vector3> {
const elementZV = document.getElementById(this._id + '-vz') as HTMLDivElement;
switch (this._dragging) {
case EAxis.X:
elementXK.classList.remove('spinbox-key-hover');
elementXV.classList.remove('spinbox-value-hover');
break;
case EAxis.Y:
elementYK.classList.remove('spinbox-key-hover');
elementYV.classList.remove('spinbox-value-hover');
break;
case EAxis.Z:
elementZK.classList.remove('spinbox-key-hover');
elementZV.classList.remove('spinbox-value-hover');
break;
case EAxis.X:
elementXK.classList.remove('spinbox-key-hover');
elementXV.classList.remove('spinbox-value-hover');
break;
case EAxis.Y:
elementYK.classList.remove('spinbox-key-hover');
elementYV.classList.remove('spinbox-value-hover');
break;
case EAxis.Z:
elementZK.classList.remove('spinbox-key-hover');
elementZV.classList.remove('spinbox-value-hover');
break;
}
this._dragging = EAxis.None;
});
@ -145,15 +145,15 @@ export class VectorSpinboxElement extends LabelledElement<Vector3> {
this._lastClientX = e.clientX;
switch (this._dragging) {
case EAxis.X:
this._value.x += deltaX;
break;
case EAxis.Y:
this._value.y += deltaX;
break;
case EAxis.Z:
this._value.z += deltaX;
break;
case EAxis.X:
this._value.x += deltaX;
break;
case EAxis.Y:
this._value.y += deltaX;
break;
case EAxis.Z:
this._value.z += deltaX;
break;
}
const elementXV = document.getElementById(this._id + '-vx') as HTMLDivElement;

View File

@ -70,15 +70,15 @@ export class NormalCorrectedRayVoxeliser extends IVoxeliser {
let voxelPosition: Vector3;
switch (ray.axis) {
case Axes.x:
voxelPosition = new Vector3(Math.round(intersection.x), intersection.y, intersection.z);
break;
case Axes.y:
voxelPosition = new Vector3(intersection.x, Math.round(intersection.y), intersection.z);
break;
case Axes.z:
voxelPosition = new Vector3(intersection.x, intersection.y, Math.round(intersection.z));
break;
case Axes.x:
voxelPosition = new Vector3(Math.round(intersection.x), intersection.y, intersection.z);
break;
case Axes.y:
voxelPosition = new Vector3(intersection.x, Math.round(intersection.y), intersection.z);
break;
case Axes.z:
voxelPosition = new Vector3(intersection.x, intersection.y, Math.round(intersection.z));
break;
}
voxelPosition.round();

View File

@ -60,15 +60,15 @@ export class RayVoxeliser extends IVoxeliser {
));
let voxelPosition: Vector3;
switch (ray.axis) {
case Axes.x:
voxelPosition = new Vector3(Math.round(intersection.x), intersection.y, intersection.z);
break;
case Axes.y:
voxelPosition = new Vector3(intersection.x, Math.round(intersection.y), intersection.z);
break;
case Axes.z:
voxelPosition = new Vector3(intersection.x, intersection.y, Math.round(intersection.z));
break;
case Axes.x:
voxelPosition = new Vector3(Math.round(intersection.x), intersection.y, intersection.z);
break;
case Axes.y:
voxelPosition = new Vector3(intersection.x, Math.round(intersection.y), intersection.z);
break;
case Axes.z:
voxelPosition = new Vector3(intersection.x, intersection.y, Math.round(intersection.z));
break;
}
let voxelColour: RGB;

View File

@ -205,58 +205,58 @@ async function buildAtlas() {
let faceData: { [face: string]: Texture } = {};
switch (modelData.parent) {
case parentModel.CubeAll:
faceData = {
up: { name: modelData.textures.all },
down: { name: modelData.textures.all },
north: { name: modelData.textures.all },
south: { name: modelData.textures.all },
east: { name: modelData.textures.all },
west: { name: modelData.textures.all },
};
break;
case parentModel.CubeColumn:
faceData = {
up: { name: modelData.textures.end },
down: { name: modelData.textures.end },
north: { name: modelData.textures.side },
south: { name: modelData.textures.side },
east: { name: modelData.textures.side },
west: { name: modelData.textures.side },
};
break;
case parentModel.Cube:
faceData = {
up: { name: modelData.textures.up },
down: { name: modelData.textures.down },
north: { name: modelData.textures.north },
south: { name: modelData.textures.south },
east: { name: modelData.textures.east },
west: { name: modelData.textures.west },
};
break;
case parentModel.TemplateSingleFace:
faceData = {
up: { name: modelData.textures.texture },
down: { name: modelData.textures.texture },
north: { name: modelData.textures.texture },
south: { name: modelData.textures.texture },
east: { name: modelData.textures.texture },
west: { name: modelData.textures.texture },
};
break;
case parentModel.TemplateGlazedTerracotta:
faceData = {
up: { name: modelData.textures.pattern },
down: { name: modelData.textures.pattern },
north: { name: modelData.textures.pattern },
south: { name: modelData.textures.pattern },
east: { name: modelData.textures.pattern },
west: { name: modelData.textures.pattern },
};
break;
default:
return;
case parentModel.CubeAll:
faceData = {
up: { name: modelData.textures.all },
down: { name: modelData.textures.all },
north: { name: modelData.textures.all },
south: { name: modelData.textures.all },
east: { name: modelData.textures.all },
west: { name: modelData.textures.all },
};
break;
case parentModel.CubeColumn:
faceData = {
up: { name: modelData.textures.end },
down: { name: modelData.textures.end },
north: { name: modelData.textures.side },
south: { name: modelData.textures.side },
east: { name: modelData.textures.side },
west: { name: modelData.textures.side },
};
break;
case parentModel.Cube:
faceData = {
up: { name: modelData.textures.up },
down: { name: modelData.textures.down },
north: { name: modelData.textures.north },
south: { name: modelData.textures.south },
east: { name: modelData.textures.east },
west: { name: modelData.textures.west },
};
break;
case parentModel.TemplateSingleFace:
faceData = {
up: { name: modelData.textures.texture },
down: { name: modelData.textures.texture },
north: { name: modelData.textures.texture },
south: { name: modelData.textures.texture },
east: { name: modelData.textures.texture },
west: { name: modelData.textures.texture },
};
break;
case parentModel.TemplateGlazedTerracotta:
faceData = {
up: { name: modelData.textures.pattern },
down: { name: modelData.textures.pattern },
north: { name: modelData.textures.pattern },
south: { name: modelData.textures.pattern },
east: { name: modelData.textures.pattern },
west: { name: modelData.textures.pattern },
};
break;
default:
return;
}
for (const face of faces) {