Nathan Shively-Sanders 650c056fa0
No error on toplevel return in JS (#48874)
* 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>
2022-05-05 09:35:15 -07:00
..
2022-05-02 06:37:43 -07:00
2020-11-11 18:42:12 -08:00