Include a description after the "@ts-ignore" directive to explain why the @ts-ignore is necessary. The description must be 3 characters or longer
975 this.uiLayer.addChild(this.currentTarget);
976 } else if (this.lastTargetSet === "Custom") {
977 const customcomponent = this.__viewManagerDelegate.customComponentManager.getCustomComponent(this.lastTargetType);
978 // @ts-ignore 979 const params = Registry.featureDefaults[this.lastTargetSet][this.lastTargetType];
980 params.position = this.lastTargetPosition;
981 params.color = Colors.getDefaultFeatureColor(this.lastTargetType, this.__viewManagerDelegate.currentLayer);
Include a description after the "@ts-ignore" directive to explain why the @ts-ignore is necessary. The description must be 3 characters or longer
911 if (feature instanceof EdgeFeature) {
912 newPaperFeature = DXFObjectRenderer2D.renderEdgeFeature(feature);
913 newPaperFeature.selected = selected;
914 // @ts-ignore 915 this.paperFeatures[newPaperFeature.featureID] = newPaperFeature;
916 console.log(newPaperFeature);
917 this.insertEdgeFeatures(newPaperFeature);
Include a description after the "@ts-ignore" directive to explain why the @ts-ignore is necessary. The description must be 3 characters or longer
153 const items = paper.project.selectedItems;
154 if (items && items.length > 0) {
155 for (let i = 0; i < items.length; i++) {
156 // @ts-ignore 157 this.__viewManagerDelegate.removeFeatureByID(items[i].featureID);
158 }
159
Include a description after the "@ts-ignore" directive to explain why the @ts-ignore is necessary. The description must be 3 characters or longer
125 const output = [];
126 const items = paper.project.selectedItems;
127 for (let i = 0; i < items.length; i++) {
128 // @ts-ignore 129 output.push(this.__viewManagerDelegate.getFeatureByID(items[i].featureID));
130 }
131 return output;
Description
TypeScript provides several directive comments that can be used to alter how it processes files. Using these to suppress TypeScript Compiler Errors reduces the effectiveness of TypeScript overall.
However, if you must keep them, you can add an explanation next to your directives.
The directive comments supported by TypeScript are:
// @ts-expect-error
// @ts-ignore
// @ts-nocheck
// @ts-check
Bad Practice
// @ts-ignore
user.login()
Recommended
// @ts-ignore - this is ok because <reason>
user.login()