Commit Graph

33351 Commits

Author SHA1 Message Date
csigs
90b1321baa LEGO: Merge pull request 49098
LEGO: Merge pull request 49098
2022-05-13 03:59:47 -07:00
TypeScript Bot
d53b16ba0a Update package-lock.json 2022-05-13 06:09:16 +00:00
Jake Bailey
92894d36af Make watch/FS testing code friendlier for project loading in module transformation (#49087) 2022-05-12 16:43:44 -07:00
Jack Works
b689cd0aa9 feat: support error when comparing with object/array literals (#45978)
* feat: support error when comparing with object/array literals

* chore: include regexp, function and class literal

* chore: include regexp, function and class literal

* test: update baseline

* fix: baseline
2022-05-12 15:45:22 -07:00
Anton Gilgur
da00ba67ed fix: getDefaultLibFilePath should normalize __dirname (#49051)
- this currently causes a bug on Windows with mixed path separators
  - it returns a POSIX backslash path for __dirname, and then adds a
    forward slash from the directorySeparator, causing mixed separators
    - TS uses `/` internally and lets the host convert if needed, so
      I assume this should be normalized to all forward slashses instead
  - example of the bug from my tests:
    ```
    Expected: "D:\\a\\rollup-plugin-typescript2\\rollup-plugin-typescript2\\node_modules\\typescript\\lib\\lib.d.ts"
    Received: "D:\\a\\rollup-plugin-typescript2\\rollup-plugin-typescript2\\node_modules\\typescript\\lib/lib.d.ts"
    ```

- every other use of __dirname in the codebase seems to be normalized
  except for this one
  - could use normalizeSlashes for this, but I figure combinePaths is
    more appropriate since that will handle it and combine properly as
    well without any `+ directorySeparator +` stuff
2022-05-12 13:21:56 -07:00
csigs
1ba609660b LEGO: Merge pull request 49081
LEGO: Merge pull request 49081
2022-05-12 04:28:47 -07:00
Oleksandr T
c300fea325 fix(7410): allow using JSXElement as JSXAttributeValue (#47994) 2022-05-11 14:47:35 -07:00
Andrew Branch
5c2febfe02 Allow referencing type-only exports as namespace members in ImportTypes and TypeQueries (#49056)
* Allow referencing type-only exports as namespace members in ImportTypes and TypeQueries

* Add extra test case

* ;; -> ;

* undefined -> false

Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
2022-05-11 11:44:59 -07:00
csigs
3c87170604 LEGO: Merge pull request 49069
LEGO: Merge pull request 49069
2022-05-11 08:29:06 -07:00
TypeScript Bot
cfbb517f35 Update package-lock.json 2022-05-11 06:07:52 +00:00
Daniel Rosenwasser
7a3c31f9f9 Accepted es2020Intl baseline. 2022-05-11 00:07:29 +00:00
Daniel Rosenwasser
3e24f14871 Merge pull request #49029 from DavidSouther/fix/44466-contextual-keyword-assertion
fix(44466): Fixes parsing contextual keyword casts as arrow functions
2022-05-10 16:37:49 -07:00
Andrew Branch
08b1cce595 Add regression test for #46192 (#49057) 2022-05-10 16:27:46 -07:00
Justin Grant
8bf45a4f93 fix: update types for RTF.p.formatToParts() result (#46508)
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
2022-05-10 16:06:08 -07:00
Sheetal Nandi
6ee549075b Identify when file name is matched by default include spec (#49040)
Fixes #43679
2022-05-10 10:34:03 -07:00
mstssk
fcd80db0c6 fix(48912): fractionalSecondDigits is 1, 2 or 3. (#49042) 2022-05-10 09:22:50 -07:00
csigs
0cd551d56a LEGO: Merge pull request 49044
LEGO: Merge pull request 49044
2022-05-10 03:58:37 -07:00
Mateusz Burzyński
9236e39374 Fixed an issue with contextual type for intersection properties (#48668)
* 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
2022-05-09 16:03:48 -07:00
Devon Govett
17431eab46 Add missing source property to Intl formatRangeToParts methods (#48754) 2022-05-09 15:57:42 -07:00
Zzzen
604e5fca55 Add JSDoc's @inheritDoc Support for Static Class Members for TypeScript (#46719)
* Add JSDoc's @inheritDoc Support for Static Class Members for TypeScript

* use public api

* fix

* add tests

* simplify implementation

* extract comments from inherticDoc
2022-05-09 15:57:27 -07:00
Oleksandr T
69214c0e56 fix(49001): handle missing imports in addMissingMember QF (#49009) 2022-05-09 15:52:15 -07:00
ryohei.udagawa
c1c3ebcadf fix: fractionalSecondDigits configure (#49014) 2022-05-09 15:24:24 -07:00
Oleksandr T
aa48a37e09 fix(48673): allow Find All References on access modifier for constructor (#48813) 2022-05-09 14:56:56 -07:00
James
d6e483b8da fix(48887) exposing rest helper functions externally (#48888)
* fix(48887) exposing rest helper functions externally

* fixing baseline + adding hint about how to fix baseline

* Update src/harness/harnessIO.ts

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2022-05-09 14:25:05 -07:00
Ron Buckton
e2bd89b309 Report error for invalid 'this' type during 'await' (#48946) 2022-05-09 13:58:36 -07:00
Andrew Branch
f3f0a3f394 Fix module specifier generation crash from typesVersions (#49035) 2022-05-09 12:48:24 -07:00
Wesley Wigham
f84ec3e8b4 Fix type parameter comparability to consistently allow comparisons on unconstrained type parameters (#48861)
* Fix type parameter comparability to consistently allow comparisons on unconstrained type parameters

* Less elaboration, non-strict-mode fix
2022-05-09 12:22:00 -07:00
David Souther
e9d39bd95f Remove spurious lookAhead, as this fn is already in a lookAhead 2022-05-09 10:53:58 -07:00
David Souther
958adfc9d8 Use all modifiers test 2022-05-09 10:41:02 -07:00
David Souther
3dd9ef43ce fix(44466): Fixes parsing contextual keyword casts as arrow functions 2022-05-09 10:22:22 -07:00
csigs
1071240907 LEGO: Merge pull request 49016
LEGO: Merge pull request 49016
2022-05-08 08:08:33 -07:00
csigs
53343dd94d LEGO: Merge pull request 49010
LEGO: Merge pull request 49010
2022-05-07 05:42:49 -07:00
TypeScript Bot
bc161c0dd8 Update package-lock.json 2022-05-07 06:06:49 +00:00
Daniel Rosenwasser
94391dc9b5 Bump version to 4.8. 2022-05-07 00:22:34 +00:00
Ryan Cavanaugh
1a4643bdce Flag resolution mode assertions in non-nightly builds (#49002)
* Flag resolution mode assertions in non-nightly builds

* Add checker check
2022-05-06 16:31:40 -07:00
Jake Bailey
8d0393d227 Fix missing parsingContext restore at return in parseDelimitedList (#48999) 2022-05-06 13:36:27 -07:00
Andrew Branch
2ffe6864b1 Respect importModuleSpecifierEnding inside node_modules packages (#48995)
* Respect importModuleSpecifierEnding inside node_modules packages

* Add tests for missing package.json
2022-05-06 12:58:12 -07:00
Jake Bailey
4765355e71 Fix more tests missing 'it' call in 'describe' (#48994) 2022-05-06 11:09:42 -07:00
Kenta Moriuchi
4a0b083c69 Add ES2022 Intl.Segmenter type (#48800)
* Add `Intl.Segmenter` type

* Update baseline

* Fix useless generics

* Fix indent size

* Fix `ResolvedSegmenterOptions`
2022-05-05 17:09:06 -07:00
Andrew Casey
58114cf387 Harden combineProjectOutputForReferences against empty results (#48978)
Getting an empty result doesn't seem expected, but a deeper fix doesn't make sense until #48619 is merged.

Fixes #48963
2022-05-05 13:52:34 -07:00
Andrew Branch
4680b54616 Clear ExportMapCache on cancellation requested (#48979) 2022-05-05 13:42:30 -07:00
Oleksandr T
f8a09bee6f fix(48878): return errorType on invalid nodes in getTypeAtLocation (#48967) 2022-05-05 13:07:32 -07:00
Wesley Wigham
8e433cda3d Allow export map entries to remap back to input files for a program (#47925)
* 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
2022-05-05 12:53:56 -07:00
Sheetal Nandi
1e157ef1b2 Fix node16 tests (#48974) 2022-05-05 11:45:05 -07:00
Daniel Rosenwasser
eb1a8b14cc Remove some unused baselines. (#48964) 2022-05-05 10:33:52 -07:00
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 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>
2022-05-05 09:35:15 -07:00
Nathan Shively-Sanders
46e8306050 Skip ambient modules in globalThis (#48938)
* 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.
2022-05-05 09:33:32 -07:00
Jake Bailey
7d60dc1f5d Revert "feat(47595): allow using private fields in type queries" (#48959) 2022-05-04 16:50:30 -07:00
Andrew Branch
e26bc8a117 Skip missing nodes in formatting (#48953) 2022-05-04 15:07:34 -07:00
Jake Bailey
f579f3307e Revert "Don't treat a colon in a conditional expression branch as part of an arrow function" (#48940) 2022-05-04 15:01:05 -07:00