24026 Commits

Author SHA1 Message Date
csigs
48e96f56be
LEGO: Merge pull request 46447
LEGO: Merge pull request 46447
2021-10-20 04:31:11 -07:00
Jack Bates
248d478956
Remove defaultValueDescription: "n/a" from options (#46280)
* Remove defaultValueDescription: "n/a" from options

* CommandLineOption type <-> defaultValueDescription

* Require defaultValueDescription of number/boolean options
2021-10-19 15:19:19 -07:00
csigs
53fa2a6494
LEGO: Merge pull request 46430
LEGO: Merge pull request 46430
2021-10-19 10:13:07 -07:00
Anders Hejlsberg
56b6279818
Improve logic for choosing between co- and contra-variant inferences (#46392)
* Improve logic for choosing between co- and contra-variant inferences

* Add tests
2021-10-19 09:58:10 -07:00
csigs
fd6552a3c2
LEGO: Merge pull request 46424
LEGO: Merge pull request 46424
2021-10-19 04:15:18 -07:00
Eli Barzilay
556098ed50 Avoid hard-wired build-tree paths
Instead, search for stuff up the directory tree, with the main
functionality being to look for `Gulpfile.js` and assume the resulting
directory is the root.

(Unfortunatley, this is implemented twice, one in `scripts` and another
in `src`.  It's not possible to use a single implementation for both
since that would require assuming a directory structure which this is
intended to avoid.)

Also, in `scripts/build/projects.js`, abstracdt common exec
functionality into a local helper, and use full paths based on the above
search instead of assuming relative paths assuming CWD being in the
project root.
2021-10-18 17:43:45 -04:00
csigs
605788d4ab
LEGO: Merge pull request 46415
LEGO: Merge pull request 46415
2021-10-18 10:29:16 -07:00
Nathan Shively-Sanders
8d715ff53e
Error on mapped type w/properties (#46346)
* Error on mapped types with properties

1. Error on properties of type literals with computed properties whose name is a
binary expression with `in`, because that's a good sign of a mapped
type.
2. Parse following properties on mapped types, and error on them.
3. Stop checking computed property names in (1) to avoid producing
errors based on misinterpreting mapped type syntax as an expression.

* add comment in types.ts

* Update API again

* Check interfaces and classes too

* Add missed check in updateMappedTypeNode
2021-10-18 09:00:00 -07:00
Eli Barzilay
39ff1568e9 Changes to enable the module conversion script
* shorthand -> long for `factory` since the typeformer script doesn't
  know how to handle it.

* Use setter to change `ts.sys` (similar to #35399).

* Fix `loggedIO` with empty namespaces to indicate dependency
  (similar to 50603eda).

* Move `Map` / `Set` stuff from `core.ts` to `corePublic.ts` since the
  types are there.
2021-10-16 08:12:59 -04:00
Sidharth Vinod
dfb40549fc
fix: ES6 Modules => ES Modules in error messages (#46378)
* fix: ES6 Modules => ES Modules in error messages

* chore: Rename test file names

* chore: Rename function names
2021-10-15 14:51:14 -07:00
Nathan Shively-Sanders
6a75689a25
Import assertion: do no parse } if { is not present (#46388)
Previously, import assertion parsing would try to parse both { and },
even if both were missing. If both were missing, the error for } could
occur past the end of the file, causing an assertion.

Fixes #46364
2021-10-15 13:26:46 -07:00
Oleksandr T
7582b1bbae
fix(45799): skip checking arguments used as a key in object literals (#45814) 2021-10-15 10:34:57 -07:00
Andrew Branch
b1f39a705e
Fix React auto-import blocking component imports in --preserve (#46368) 2021-10-15 09:31:47 -07:00
Wesley Wigham
2c7b13b830
Fix explainFiles on files under nodenext with types references (#46367)
* Fix explainFiles on files under nodenext with types references

* Fix explainFiles crash on module nodenext
2021-10-14 17:00:55 -07:00
Nathan Shively-Sanders
d16d7779a8
No error for markdown links in @see (#46348)
This only shows up in checkJS files, but should still be ignored.
2021-10-14 15:22:59 -07:00
Oleksandr T
80e1a29248
fix(46305): omit converting jsx (react-jsx) spread attributes to Object.assign for ES2018 and up (#46317) 2021-10-14 14:23:50 -07:00
Anders Hejlsberg
8718df3dc1
Fix stack overflow in JSX discriminated union logic (#46354)
* Use getContextFreeTypeOfExpression to avoid circularities

* Add regression test
2021-10-14 10:11:44 -07:00
Sidharth Vinod
5185ef55e3
fix(suggestion): Remove 80001 from cjs/cts files. (#46270)
* fix(suggestion): Remove 80001 from cjs/cts files.

* tests: Cover more cases in a single file.

* tests: Cover more cases in a single file.
2021-10-14 09:55:59 -07:00
Wesley Wigham
1c5d4e1740
Pass symbol under inspection into checkIndexConstraints (#46350) 2021-10-13 17:04:33 -07:00
Wesley Wigham
ac345849e3
Set impliedNodeFormat on sourceFiles maufactured in watch mode (#46349) 2021-10-13 17:04:13 -07:00
LowR
cd0434aa76
fix(39744): make template literals more spec compliant (#45304)
* fix(39744): make template literals more spec compliant

* Add evaluation test for template literals

* Add test for template literals with source map
2021-10-13 12:03:31 -07:00
Anders Hejlsberg
0d2aeb7c65
Improve checks for infinitely expanding recursive conditional types (#46326)
* Improve checks for infinitely expanding recursive conditional types

* Accept new baselines

* Add regression tests

* Remove 'export' modifier

* Accept new baselines
2021-10-13 07:08:01 -07:00
Wesley Wigham
713afe2227
Set import mode on synthetic imports (#46327) 2021-10-12 16:23:37 -07:00
Yuya Tanaka
9e2fc16c32
Improve perf of unions with many primitives (#45220) 2021-10-12 16:07:21 -07:00
Oleksandr T
44deb84460
fix(45336): add a blank line before the comment expression to avoid disrupting return statement (#46287) 2021-10-11 16:41:49 -07:00
Andrew Branch
64b8172f06
Auto-imports: fix some exports being incorrectly stored as re-exports of others due to key conflict (#45792)
* Ensure symbol key unique when target is a local symbol exported elsewhere

* Add test

* Support targets without declarations

* Best key yet

* A-ha moment

* Clean up types

* Update API

* Update unit test
2021-10-08 15:20:12 -07:00
csigs
613c43287b
LEGO: Merge pull request 46264
LEGO: Merge pull request 46264
2021-10-07 16:14:04 -07:00
Wesley Wigham
82822fc1e9
Use a binary search when looking for the token at a given position (#46250) 2021-10-07 15:06:18 -07:00
csigs
bbd9ff51f5
LEGO: Merge pull request 46260
LEGO: Merge pull request 46260
2021-10-07 10:13:49 -07:00
Nathan Shively-Sanders
8c270757b2
In plain JS files, only suggestion did-you-mean errors (#46151)
They will have code fixes, and are tuned for high precision. Others are
not.
2021-10-07 08:41:06 -07:00
csigs
fbff13105a
LEGO: Merge pull request 46255
LEGO: Merge pull request 46255
2021-10-07 04:15:20 -07:00
csigs
08361e3d3c
LEGO: Merge pull request 46248
LEGO: Merge pull request 46248
2021-10-06 16:14:13 -07:00
Wesley Wigham
7108646713
Fix extension automatic script kind detection for new extensions (#46205)
* Fix extension script kind detection for new extensions

* Accept (correct) changes to existing baselines affected by correct ScriptKind detection
2021-10-06 13:23:54 -07:00
Wesley Wigham
ed9c522fd6
Accept new moduleResolution options on commandline (#46239) 2021-10-06 13:17:27 -07:00
csigs
cb158e7eb6
LEGO: Merge pull request 46238
LEGO: Merge pull request 46238
2021-10-06 10:14:06 -07:00
Wesley Wigham
1cee9731d2
Properly support scoped package self name lookups (#46212) 2021-10-05 12:41:44 -07:00
Wesley Wigham
47cd4d3ecf
Only set package data map under watch mode (#46211) 2021-10-05 11:13:26 -07:00
Wesley Wigham
a0cf126513
Limit package.json realpath lookup to only successful resolutions (#46209) 2021-10-05 10:24:08 -07:00
chenjigeng
d60747f043
Feat/quick fix for types (#42126)
* feat: add quick fix for types

* feat: add test case for quick fix of types

* feat: add did-you-mean error when Cannot_find_name_0 and Cannot_find_namespace_0

* feat: add Cannot_find_namespace_0_Did_you_mean_1 error and only suggest when resolve type

* feat: update baselines

* feat: update baselines

* feat: update baselines

* chore: fix style problem

* Always suggest spelling corrections

* suggest primitives instead of their wrappers

* Add primitives to suggestions

Instead of altering wrappers to look like primitives.

* add semicolons

* revert unneeded change

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2021-10-05 08:14:16 -07:00
csigs
5423501c37
LEGO: Merge pull request 46203
LEGO: Merge pull request 46203
2021-10-04 10:14:44 -07:00
csigs
66182554c8
LEGO: Merge pull request 46179
LEGO: Merge pull request 46179
2021-10-02 22:14:20 -07:00
csigs
f3cc868499
LEGO: Merge pull request 46178
LEGO: Merge pull request 46178
2021-10-02 16:14:17 -07:00
csigs
33581aedbd
LEGO: Merge pull request 46173
LEGO: Merge pull request 46173
2021-10-02 04:15:28 -07:00
csigs
49fbeefcf1
LEGO: Merge pull request 46170
LEGO: Merge pull request 46170
2021-10-01 22:17:03 -07:00
csigs
a6af833d14
LEGO: Merge pull request 46168
LEGO: Merge pull request 46168
2021-10-01 16:14:26 -07:00
Or Ouziel
b2d2f085e2
improve response time of invalid rename attempts (#46158)
* improve response time in invalid rename attempts

* account for simplifiedResult and revert unrelated change
2021-10-01 15:07:54 -07:00
Wesley Wigham
a02a7ab8e9
Follow and respect export maps when generating module specifiers (#46159)
* Follow and respect export maps when generating module specifiers

* Type baseline updates from master merge
2021-10-01 13:54:07 -07:00
csigs
9ed49b6ba7
LEGO: Merge pull request 46161
LEGO: Merge pull request 46161
2021-10-01 10:13:58 -07:00
Orta Therox
1a000c8422
Fix main (#46160) 2021-10-01 09:50:00 -07:00
Wesley Wigham
ccc19092ff
Modify synthetic default generation code for dual-mode module resolution (#46156) 2021-10-01 09:18:44 -07:00