Commit 650c056
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 2a6dec4.
* Revert "Allow toplevel return only in non-ESM JS files"
This reverts commit 6291ae3.
* Revert "Keep Disallowing return in ambient locations"
This reverts commit 714ea8e.
* Revert "No error in toplevel script files"
This reverts commit 2056e13.
* restore orphaned baseline
Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
Co-authored-by: TypeScript Bot <typescriptbot@microsoft.com>1 parent 46e8306 commit 650c056
File tree
6 files changed
+1
-297
lines changed- src/compiler
- tests/baselines/reference
6 files changed
+1
-297
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
913 | 913 | | |
914 | 914 | | |
915 | 915 | | |
916 | | - | |
917 | 916 | | |
918 | 917 | | |
919 | 918 | | |
| |||
Lines changed: 0 additions & 47 deletions
This file was deleted.
Lines changed: 0 additions & 99 deletions
This file was deleted.
Lines changed: 0 additions & 72 deletions
This file was deleted.
Lines changed: 0 additions & 74 deletions
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
104 | 103 | | |
105 | 104 | | |
106 | | - | |
| 105 | + | |
107 | 106 | | |
108 | 107 | | |
109 | 108 | | |
| |||
515 | 514 | | |
516 | 515 | | |
517 | 516 | | |
518 | | - | |
519 | | - | |
520 | 517 | | |
0 commit comments