prefer-const rule for TS / manual fixes

This commit is contained in:
Val Erastov 2022-08-15 21:15:55 -07:00
parent 50289f3288
commit 0956f0647a
4 changed files with 8 additions and 10 deletions

View file

@ -26,7 +26,9 @@
"max-len": "off",
"no-console": "off",
"no-extra-boolean-cast": "off",
"prefer-const": "error",
"prefer-const": ["error", {
"destructuring": "all"
}],
"no-var": "error",
"no-empty": "off",
"no-fallthrough": "off",

View file

@ -13,14 +13,14 @@ export const STANDARD_BASES = Object.freeze({
});
export function BasisForPlane(normal: UnitVector, alignY: UnitVector = AXIS.Y, alignZ: UnitVector = AXIS.Z): [UnitVector, UnitVector, UnitVector] {
let alignPlane, x, y;
let alignPlane;
if (Math.abs(normal.dot(alignY)) < 0.5) {
alignPlane = normal.cross(alignY);
} else {
alignPlane = normal.cross(alignZ);
}
y = alignPlane.cross(normal);
x = y.cross(normal);
const y = alignPlane.cross(normal);
const x = y.cross(normal);
return [x, y, normal];
}

View file

@ -60,8 +60,6 @@ export const ExtrudeOperation: OperationDescriptor<ExtrudeParams> = {
const sketchId = face.id;
const sketch = ctx.sketchStorageService.readSketch(sketchId);
let sweepSources: FaceRef[];
if (!sketch) {
if (face instanceof MBrepFace) {
oci.prism("FaceTool", face, ...extrusionVector.data());
@ -78,7 +76,7 @@ export const ExtrudeOperation: OperationDescriptor<ExtrudeParams> = {
csys.origin._minus(extrusionVector);
extrusionVector._scale(2);
}
sweepSources = occ.utils.sketchToFaces(sketch, csys)
const sweepSources = occ.utils.sketchToFaces(sketch, csys)
const productionAnalyzer = new FromSketchProductionAnalyzer(sweepSources);

View file

@ -31,8 +31,6 @@ export const RevolveOperation: OperationDescriptor<RevolveParams> = {
const sketchId = face.id;
const sketch = ctx.sketchStorageService.readSketch(sketchId);
let sweepSources: FaceRef[];
if (!sketch) {
if (face instanceof MBrepFace) {
const args = ["FaceTool", face, ...params.axis.origin.data(), ...params.axis.direction.data(), params.angle];
@ -46,7 +44,7 @@ export const RevolveOperation: OperationDescriptor<RevolveParams> = {
const csys = face.csys;
sweepSources = occ.utils.sketchToFaces(sketch, csys)
const sweepSources = occ.utils.sketchToFaces(sketch, csys)
const productionAnalyzer = new FromSketchProductionAnalyzer(sweepSources);