From 098e38141e5337d19ce4a03eff5970fec98ee2da Mon Sep 17 00:00:00 2001 From: pixelzoom Date: Tue, 25 Apr 2023 11:10:24 -0600 Subject: [PATCH] improve descriptions for ts-expect-error, https://github.com/phetsims/graphing-lines/issues/139 --- js/linegame/view/ChallengeGraphNode.ts | 4 ++-- js/linegame/view/GraphPointSlopeNode.ts | 8 ++++---- js/linegame/view/GraphSlopeInterceptNode.ts | 8 ++++---- js/linegame/view/GraphTwoPointsNode.ts | 4 ++-- js/linegame/view/MakeTheEquationNode.ts | 4 ++-- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/js/linegame/view/ChallengeGraphNode.ts b/js/linegame/view/ChallengeGraphNode.ts index f3991a66..4b369d9f 100644 --- a/js/linegame/view/ChallengeGraphNode.ts +++ b/js/linegame/view/ChallengeGraphNode.ts @@ -76,12 +76,12 @@ export default class ChallengeGraphNode extends GraphNode { this.answerPointNode.translation = challenge.modelViewTransform.modelToViewXY( challenge.answer.x1, challenge.answer.y1 ); // guess - // @ts-expect-error Property + // @ts-expect-error guessProperty is Property this.guessLineNode = new LineNode( challenge.guessProperty, challenge.graph, challenge.modelViewTransform ); this.guessPointNode = new PlottedPointNode( pointRadius, LineGameConstants.GUESS_COLOR ); // optional slope tool - // @ts-expect-error Property + // @ts-expect-error guessProperty is Property this.slopeToolNode = ( options.slopeToolEnabled ) ? new SlopeToolNode( challenge.guessProperty, challenge.modelViewTransform ) : null; // Rendering order: lines behind points, guess behind answer diff --git a/js/linegame/view/GraphPointSlopeNode.ts b/js/linegame/view/GraphPointSlopeNode.ts index 5b2a4021..e60b8230 100644 --- a/js/linegame/view/GraphPointSlopeNode.ts +++ b/js/linegame/view/GraphPointSlopeNode.ts @@ -33,15 +33,15 @@ export default class GraphPointSlopeNode extends ChallengeGraphNode { const pointSlopeParameterRange = new PointSlopeParameterRange(); const x1RangeProperty = new Property( challenge.graph.xRange ); const y1RangeProperty = new Property( challenge.graph.yRange ); - // @ts-expect-error Property + // @ts-expect-error guessProperty is Property const riseRangeProperty = new Property( pointSlopeParameterRange.rise( challenge.guessProperty.value, challenge.graph ) ); - // @ts-expect-error Property + // @ts-expect-error guessProperty is Property const runRangeProperty = new Property( pointSlopeParameterRange.run( challenge.guessProperty.value, challenge.graph ) ); const manipulatorRadius = challenge.modelViewTransform.modelToViewDeltaX( LineGameConstants.MANIPULATOR_RADIUS ); // point manipulator - // @ts-expect-error Property + // @ts-expect-error guessProperty is Property const pointManipulator = new X1Y1Manipulator( manipulatorRadius, challenge.guessProperty, x1RangeProperty, y1RangeProperty, challenge.modelViewTransform, true /* constantSlope */ ); const pointIsVariable = ( challenge.manipulationMode === ManipulationMode.POINT || challenge.manipulationMode === ManipulationMode.POINT_SLOPE ); if ( pointIsVariable ) { @@ -49,7 +49,7 @@ export default class GraphPointSlopeNode extends ChallengeGraphNode { } // slope manipulator - // @ts-expect-error Property + // @ts-expect-error guessProperty is Property const slopeManipulator = new SlopeManipulator( manipulatorRadius, challenge.guessProperty, riseRangeProperty, runRangeProperty, challenge.modelViewTransform ); const slopeIsVariable = ( challenge.manipulationMode === ManipulationMode.SLOPE || challenge.manipulationMode === ManipulationMode.POINT_SLOPE ); if ( slopeIsVariable ) { diff --git a/js/linegame/view/GraphSlopeInterceptNode.ts b/js/linegame/view/GraphSlopeInterceptNode.ts index 20b34d03..8bfc285e 100644 --- a/js/linegame/view/GraphSlopeInterceptNode.ts +++ b/js/linegame/view/GraphSlopeInterceptNode.ts @@ -31,16 +31,16 @@ export default class GraphSlopeInterceptNode extends ChallengeGraphNode { // dynamic ranges const parameterRange = new SlopeInterceptParameterRange(); - // @ts-expect-error Property + // @ts-expect-error guessProperty is Property const riseRangeProperty = new Property( parameterRange.rise( challenge.guessProperty.value, challenge.graph ) ); - // @ts-expect-error Property + // @ts-expect-error guessProperty is Property const runRangeProperty = new Property( parameterRange.run( challenge.guessProperty.value, challenge.graph ) ); const y1RangeProperty = new Property( challenge.graph.yRange ); const manipulatorRadius = challenge.modelViewTransform.modelToViewDeltaX( LineGameConstants.MANIPULATOR_RADIUS ); // intercept manipulator - // @ts-expect-error Property + // @ts-expect-error guessProperty is Property const yInterceptManipulator = new YInterceptManipulator( manipulatorRadius, challenge.guessProperty, y1RangeProperty, challenge.modelViewTransform ); const interceptIsVariable = ( challenge.manipulationMode === ManipulationMode.INTERCEPT || challenge.manipulationMode === ManipulationMode.SLOPE_INTERCEPT ); if ( interceptIsVariable ) { @@ -48,7 +48,7 @@ export default class GraphSlopeInterceptNode extends ChallengeGraphNode { } // slope manipulator - // @ts-expect-error Property + // @ts-expect-error guessProperty is Property const slopeManipulator = new SlopeManipulator( manipulatorRadius, challenge.guessProperty, riseRangeProperty, runRangeProperty, challenge.modelViewTransform ); const slopeIsVariable = ( challenge.manipulationMode === ManipulationMode.SLOPE || challenge.manipulationMode === ManipulationMode.SLOPE_INTERCEPT ); if ( slopeIsVariable ) { diff --git a/js/linegame/view/GraphTwoPointsNode.ts b/js/linegame/view/GraphTwoPointsNode.ts index 5138a7e4..faeff28f 100644 --- a/js/linegame/view/GraphTwoPointsNode.ts +++ b/js/linegame/view/GraphTwoPointsNode.ts @@ -29,11 +29,11 @@ export default class GraphTwoPointsNode extends ChallengeGraphNode { const manipulatorRadius = challenge.modelViewTransform.modelToViewDeltaX( LineGameConstants.MANIPULATOR_RADIUS ); - // @ts-expect-error Property + // @ts-expect-error guessProperty is Property const x1y1Manipulator = new X1Y1Manipulator( manipulatorRadius, challenge.guessProperty, new Property( challenge.graph.xRange ), new Property( challenge.graph.yRange ), challenge.modelViewTransform, false /* constantSlope */ ); - // @ts-expect-error Property + // @ts-expect-error guessProperty is Property const x2y2Manipulator = new X2Y2Manipulator( manipulatorRadius, challenge.guessProperty, new Property( challenge.graph.xRange ), new Property( challenge.graph.yRange ), challenge.modelViewTransform ); diff --git a/js/linegame/view/MakeTheEquationNode.ts b/js/linegame/view/MakeTheEquationNode.ts index 900b40ac..6fd4bbc5 100644 --- a/js/linegame/view/MakeTheEquationNode.ts +++ b/js/linegame/view/MakeTheEquationNode.ts @@ -53,9 +53,9 @@ export default class MakeTheEquationNode extends ChallengeNode { answerBoxNode.visible = false; // Guess - // @ts-expect-error Property + // @ts-expect-error guessProperty is Property const guessColor: Color | string = challenge.guessProperty.value.color; - // @ts-expect-error Property + // @ts-expect-error guessProperty is Property const guessEquationNode = createInteractiveEquationNode( challenge.equationForm, challenge.manipulationMode, challenge.guessProperty, challenge.graph, GLConstants.INTERACTIVE_EQUATION_FONT_SIZE, guessColor ); const guessBoxNode = new EquationBoxNode( GraphingLinesStrings.yourEquation, guessColor, boxSize, guessEquationNode );