mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-23 07:07:09 -05:00
* 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 commit2a6dec475a. * Revert "Allow toplevel return only in non-ESM JS files" This reverts commit6291ae3ba2. * Revert "Keep Disallowing return in ambient locations" This reverts commit714ea8e524. * Revert "No error in toplevel script files" This reverts commit2056e13d52. * restore orphaned baseline Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com> Co-authored-by: TypeScript Bot <typescriptbot@microsoft.com>