* Determines whether a did-you-mean error should be a suggestion in an unchecked JS file. * Only applies to unchecked JS files without checkJS, // @ts-check or // @ts-nocheck * It does not suggest when the suggestion: * - Is from a global file that is different from the re
(node, suggestion, excludeClasses)
| 74737 | * - (optionally) Is a class, or is a this.x property access expression |
| 74738 | */ |
| 74739 | function isUncheckedJSSuggestion(node, suggestion, excludeClasses) { |
| 74740 | var file = ts.getSourceFileOfNode(node); |
| 74741 | if (file) { |
| 74742 | if (compilerOptions.checkJs === undefined && file.checkJsDirective === undefined && (file.scriptKind === 1 /* ScriptKind.JS */ || file.scriptKind === 2 /* ScriptKind.JSX */)) { |
| 74743 | var declarationFile = ts.forEach(suggestion === null || suggestion === void 0 ? void 0 : suggestion.declarations, ts.getSourceFileOfNode); |
| 74744 | return !(file !== declarationFile && !!declarationFile && isGlobalSourceFile(declarationFile)) |
| 74745 | && !(excludeClasses && suggestion && suggestion.flags & 32 /* SymbolFlags.Class */) |
| 74746 | && !(!!node && excludeClasses && ts.isPropertyAccessExpression(node) && node.expression.kind === 108 /* SyntaxKind.ThisKeyword */); |
| 74747 | } |
| 74748 | } |
| 74749 | return false; |
| 74750 | } |
| 74751 | function getFlowTypeOfAccessExpression(node, prop, propType, errorNode, checkMode) { |
| 74752 | // Only compute control flow type if this is a property access expression that isn't an |
| 74753 | // assignment target, and the referenced property was declared as a variable, property, |
no test coverage detected