This commit updates the type of `RelativeTimeFormatPart` to clarify that
the `unit` prop is always singular, unlike the plural or singular values
that are accepted as inputs.
This also changes `RelativeTimeFormatPart` to be a discriminated
union type because the `unit` prop is only present if the `type` prop's
value is not "literal".
Fixes#46245
* Add a failing test case for contextual type not provided for functions comming from a property with intersection type
* Fixed an issue with contextual type for intersection properties
* Fixed how type of a property of a contextual type is being computed when intersections with indexers are used
* Add JSDoc's @inheritDoc Support for Static Class Members for TypeScript
* use public api
* fix
* add tests
* simplify implementation
* extract comments from inherticDoc
* 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 2a6dec475a.
* Revert "Allow toplevel return only in non-ESM JS files"
This reverts commit 6291ae3ba2.
* Revert "Keep Disallowing return in ambient locations"
This reverts commit 714ea8e524.
* Revert "No error in toplevel script files"
This reverts commit 2056e13d52.
* 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