In plain JS files, only suggestion did-you-mean errors (#46151)

They will have code fixes, and are tuned for high precision. Others are
not.
This commit is contained in:
Nathan Shively-Sanders
2021-10-07 08:41:06 -07:00
committed by GitHub
parent fbff13105a
commit 8c270757b2
2 changed files with 11 additions and 1 deletions

View File

@@ -28454,7 +28454,7 @@ namespace ts {
if (relatedInfo) {
addRelatedInfo(resultDiagnostic, relatedInfo);
}
addErrorOrSuggestion(!isUncheckedJS, resultDiagnostic);
addErrorOrSuggestion(!isUncheckedJS || errorInfo.code !== Diagnostics.Property_0_may_not_exist_on_type_1_Did_you_mean_2.code, resultDiagnostic);
}
function containerSeemsToBeEmptyDomElement(containingType: Type) {

View File

@@ -0,0 +1,10 @@
/// <reference path='fourslash.ts' />
// @allowjs: true
// @noEmit: true
// @filename: noSuggestionWithoutDidYouMean.js
//// let a = {};
//// console.log(a.apple);
verify.noErrors()
verify.getSuggestionDiagnostics([])