* Add a basic dev container
Adds a basic dev container. This basic development environment has tools like gulp installed
* Update CONTRIBUTING.md
* Move development container seciton to be first tip
* Spaces to tabs and remove comments
Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
* No did-you-mean-to-call error on casts
I chose to do the ad-hoc check rather than yet another tree walk.
1. It's faster to run and easier to read.
2. This error came from looking at real code. It happened twice, so I
think the best estimate for other uses that happened zero times is in
fact zero.
3. I couldn't think of other places to put the cast, given the
restrictions on `testedNode` just before the new code.
* Skip parentheses
I chose to do the ad-hoc check rather than yet another tree walk.
1. It's faster to run and easier to read.
2. This error came from looking at real code. It happened twice, so I
think the best estimate for other uses that happened zero times is in
fact zero.
3. I couldn't think of other places to put the cast, given the
restrictions on `testedNode` just before the new code.
e350c357 (#40228) introduced a subtle bug: it switched the flags to an
alias, dropping `SymbolFlags.Property` --- and that makes
`symbolIsValue()` get to the `resolveAlias(symbol)` call, which leads to
`getPropertyOfType()` with`resolved.callSignatures`+`constructSignatures`
being `undefined`. So initialize them in `setStructuredTypeMembers`
before calling `getNamedMembers()`.
Fixes#42350
The original error message on the last line I have added to in
functionParameterArityMismatch.ts was
No overload expects 5 arguments, but overloads do exist that expect
either 4 or Infinity arguments.
even if we do not define a function that takes Infinity arguments.
This PR changes it to this:
Expected 0-6 arguments, but got 5 or more.
I feel it is still a bit strange but much more understandable.
Fixes#42418
* Allow only package names as plugin names
* Remove extra argument following merge from master branch.
* kipped -> Skipped
Co-authored-by: Sheetal Nandi <shkamat@microsoft.com>
Make `tracing` either `undefined` or the same namespace as before.
Switching all calls to `tracing?.___` means that there is no cost for
a call or the arguments when tracing is not used. Comparing two runs
without tracing (27 runs, drop 5+5, avg rest) I get:
master:
42.59s user 1.00s system 165% cpu 26.372 total
changed:
42.01s user 0.982 system 165% cpu 26.039 total
(Makes it all private, so no api changes.)
* Commonjs module:create synthetic exports symbol
Previously, the `module` identifier in commonjs modules got a synthetic
type with a single property `exports`. The exports property reused the
file's symbol, which, for a module file, gives the correct exported
properties.
However, the name of this symbol was still the filename of the file, not
`exports`. This PR creates a synthetic symbol for `exports` by copying
in a similar way to esModuleInterop's `default` symbol in
`resolveESModuleSymbol` (although the intent there is to strip off
signatures from the symbol).
* correct parent of synthetic symbol
* Signature help: support non-trailing rest parameters
In signature help, the first rest parameter will always be the *last*
'current' parameter (disregarding types). Previously, the signature help
current-parameter highlight was only correct for trailing rest
parameters. However, with tuple types, you can now create non-trailing
rest parameters. This PR now correctly highlights non-trailing rest
parameters as the last 'current' parameter.
For example, `names` should be the current parameter in all the calls
below:
```ts
declare function loading(...args: [...names: string[], allCaps: boolean, extra: boolean]): void;
leading(/**/
leading('one', /**/
leading('one', 'two', /**/
```
And, because signature help doesn't do real overload resolution, `names`
is also the current parameter for other calls:
```ts
leading(1, 2, 3, 'ill-typed', /**/
leading('fine', true, /**/
```
* Change 'variadic' to 'rest'
* fix missed rename
* use single, original tuple instead
* Revert "use single, original tuple instead"
This reverts commit f0896f32ea.
* Improve sig help of trailing rest too
1. Trailing rest keeps highlight at end instead of going off the end.
2. Non-trailing rest disable highlight entirely (by putting the index
one past the end).
* update API baselines
* Exclude primitive types from union subtype reduction in most cases
* Accept new baselines
* Minor fixes
* Less aggressive checking of assertion function calls that don't affect control flow
* Accept new baselines
* Test when config file extends is incorrectly computed
Test for #40720
* Keep extended config's raw file, include, exclude relative to itself and correct it when setting extending options
Fixes#40720