* Enable path completions for node12/nodenext
* Explicitly pull path completions from export maps when available
* Explicitly handle pattern exports by stopping up to the star
* Checker:Remove block-scoped duplicate declaration errors in plain JS
Previously they were issued in mergeSymbol, not they are not issued.
* fix semicolon lint
* Fix error term of declaration in modules
* fix test
* change error code of "An import declaration can only be used at the top level of a module."
* Separate js and ts files for export errors in module.
* Change non-top-level error in namespace
* format
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
* WIP: pass in checkmode to getNarrowableTypeForReference
* add tests
* another pass through new check mode argument
* rename new check mode
* only use rest flag for rest elements in objects
* add and update tests
* change check mode flag name
* restore package-lock.json
* fix comments
* get rid of fourslash tests
* fix caching in checkExpressionCached when checkMode is not normal
* Don't distinguish between object and array rest elements
* get rid of undefined check mode
* don't make includeOptionality into checkmode flag
1. During name resolution, `@param` and `@return` tags should walk up
through the jsdoc comment and then jump to the host function. Previously they
did not, which would cause them to not resolve type parameters bound in
the scope of a host that was not a sibling of the comment. The example
from #46618 is a prototype method:
```js
/**
* @template {T}
* @param {T} t
*/
C.prototype.m = function (t) {
}
```
2. During name resolution, prototype methods are supposed to resolve
types both from the host function's location and from the containing
class' location. The containing class lookup happens in a separate call
to `resolveName`. Previously, the code that finds the containing class
only worked for the above style of comment, which is on the outer
ExpressionStatement, but not for the below style, which is on the
function expression itself:
```js
C.prototype.m =
/**
* @template {T}
* @param {T} t
*/
function (t) {
}
```
* Do symbol name filtering before cache rehydration
* Fix typo
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
* Update test
* Fix variable clobbered in merge conflict
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
* Fix @link https:// formatting
Also improve .d.ts formatting of `@link`,`@linkcode`,`@linkplain`.
Fixes#46734
1. Previously, `@link` incorrectly put a space between "https" and "://"
when formatting jsdoc for editors. Now it does not.
2. When fixing the same output for .d.ts, I discovered that all `@link` tags
were formatted as `@link`, even if they were `@linkcode` or
`@linkplain`. I fixed that too.
* semicolon lint
TestRunner was already using it, but upstream projects (e.g. Compiler) were not, causing TestRunner to re-parse and re-bind all upstream files in (at least) editor scenarios), slowing down initial project load.
In local testing, this cut a find-all-refs call in checker.ts from 5s to 2.5s.