* Allow export map entries to remap back to input files for a program
* Fix file casing issues on windows
* Implement abiguity error, doesnt quite work
* Refine selection logic in error case to use getCommonSourceDirectory, add more tests
* No error on toplevel return in JS
Turns out it's only an error in modules.
It's possible to keep this error on the list of "OK for JS" errors and
make the checker code stop issuing it for JS scripts only. However, I
don't think the error is valuable enough to do that.
Fixes#48224
* Restore 'return' statement.
* Update Baselines and/or Applied Lint Fixes
* Re-add missing baselines
* No error in toplevel script files
Only issue "no top-level return" error for modules, not scripts,
regardless of whether it's TS or JS.
* Keep Disallowing return in ambient locations
* Allow toplevel return only in non-ESM JS files
* Add test of toplevel return in JS script
* Revert "Add test of toplevel return in JS script"
This reverts commit 2a6dec475a35ec104915000984ffb79452cb7350.
* Revert "Allow toplevel return only in non-ESM JS files"
This reverts commit 6291ae3ba2df305d287f02223d634e21808fd15a.
* Revert "Keep Disallowing return in ambient locations"
This reverts commit 714ea8e524ff1129d94679df78f7790534222980.
* Revert "No error in toplevel script files"
This reverts commit 2056e13d5294a4d923b3f7c8e43dbc72f595afc6.
* restore orphaned baseline
Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
Co-authored-by: TypeScript Bot <typescriptbot@microsoft.com>
* Skip ambient modules in globalThis
Previously, globalThis mistakenly included ambient modules, even though
these are not values:
```ts
declare module "ambientModule" {
export type typ = 1
export var val: typ
}
type Oops = (typeof globalThis)[\"ambientModule\"]
```
This PR adds ambient modules to the kinds of things that are skipped
when constructing `globalThis`' properties, along with block-scoped
variables.
* Skip only modules with every declaration ambient
The modules are required to have at least one declaration so that our
treatment of `globalThis` stays the same, and
`globalThis.globalThis.globalThis` remains legal.
* Remove Node12, add Node16.
* Accepted baselines.
* Refactor checking for top-level await, give a better error message in CJS files.
* Accepted baselines.
* Stop erroring on JSON module imports in node ESM since they're no longer experimental.
* Accepted baselines.
* More refactoring, do the same checks for for-await loops.
* Accepted baselines.
* Adjust phrasing to permit for-await on CJS error.
* Accepted baselines.
* Accepted baselines.
* Fix lints.
* WIP
* fix cross-project renaming logic
* only use configure if prefix opt is defined
* refactor skipAlias into stopAtAlias
* fix stopAtAlias
* update another stopAtAlias location
* Fix jsdoc of some `DataView` method.
* Add author by 'Fix jsdoc of some `DataView` method'.
* Fix jsdoc of some `DataView` method.
change 'written' to 'read' by `getXXX` methods, and remove 'otherwise' by every method which has `littleEndian` param.
* Fix jsdoc of some `DataView` method in `es2020.bigint.d.ts`.
change 'written' to 'read' by `getXXX` methods, and remove 'otherwise' by every method which has `littleEndian` param.
processChildNodes needs to skip processing when the node array is
outside the target range, just like processChildNode already does for a
single node.
Fixes#48006
* Added unit test
* Added baseline test
* Dirty solution
* Code refactoring and improvements
* Added more test cases
* Refactor to use flatMap
* Added utility function to get all Nodes with JSDocs
* Minor improvements
* Use recursion to check all tree levels
* Removed unit test
* Removed previous changes
* Updated resolveEntityName call
* Updated dontResolveAlias clause
* Updated symbol flags
* Updated baseline
* Fix dont resolve alias problem
* Updated tests
* Add failing test
* Block auto-import module specifiers including node_modules path
* Eagerly resolve module specifiers in completions in nodenext so failures can be filtered
* Add completion info flags for telemetry
* Update API baseline
* Update completions baselines
* Fix missed boolean flip
* Fix remaining tests
* change error message on Promise
* fix(46570): Unhelpful Promise type argument hint in JS file
* refactor: Reword void Promise message for JSDoc type hint to provide better feedback
Co-authored-by: Osa <osaimola@gmail.com>
By copying the kludge in @typedef. @callback's order is simpler, so the
kludge is simpler. However, it's wrong here, and in @typedef. Parsing
tag comments is normally supposed to happen at the end of a tag, but in
@callback and @typedef happens *before* parsing the nested
@param/@property tags.
I still need to figure out what a real fix is -- but for the beta,
copying the existing crash-avoidance kludge from @typedef is best
anyway. I added a test case for typedefs for future use as well.