* When calculating spreads, merge empty object into nonempty object to produce partial object to reduce complexity
* Actually accept remainder of baselines
* Limit simplification to single prop or partial types
* Normalize type references before relating them in isRelatedTo
* Add comments
* Accept new baselines
* Add regression tests
* Accept new baselines
* Use aliases when available in error reporting
* Accept new baselines
* Emit defineProperty calls before param prop assignments
Note that I restricted this to --useDefineForClassFields is true.
Nothing changes when it's off. I think this is the correct fix for a
patch release.
However, in principal there's nothing wrong with moving parameter
property initialisation after property declaration initialisation. It
would be Extremely Bad and Wrong to rely on this working:
```ts
class C {
p = this.q // what is q?
constructor(public q: number) { }
}
```
But today it does, and probably somebody relies on it without knowing.
* Put parameter property initialiser into defineProperty's value
* Combine ES5/ESNext into one test
* useDefineForClassFields skips emit of ambient properties
Previously:
```ts
class C {
declare p
}
```
would incorrectly emit
```js
class C {
constructor() {
Object.defineProperty(this, "p", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
}
}
```
when useDefineForClassFields was turned on (for targets <ESNext).
* Fix bug for ESNext as well
This moves the check earlier in the pipeline.
* update baselines
* Fix up quotation marks in error messages in JavaScript files.
* Accepted baselines.
* Typescript -> TypeScript
* Accepted baselines.
* Migrate syntactic diagnostics tests to baselining tests.
* Accepted baselines.
* Update diagnosticMessages.json
* Removed markers.
* Add ability to baseline both semantic and syntactic diagnostics.
* Fix up broken diagnostics when using a server LS.
* Accepted baselines.
* Lints.
* Fake up sourcefile objects in the tsserver session client instead.
* Fewer allocations.
* Add inference priority level for conditional types in contravariant positions
* Accept new API baselines
* Add regression tests
* Accept new baselines
* Add preceding semicolon on await insertion when parentheses are included
* Just start with precedingToken
* Fix semicolon formatter regression
* Delete test with debatable expected behavior
* Lint after control flow changes
* Added more tests.
* Accepted baselines.
* Work better with any parameter type.
* Accepted baselines.
* Use the actual indexed expression.
* Add tests that exhibit bad stringification.
* Accepted baselines.
* Short-circuit stringification on 'undefined'.
* Accepted baselines.
* Remove space.
* Accepted baselines.
* Add "use before defined" diagnostic
* Make "use before defined" diagnostic as related information to TS2454
* Add baseline tests for "use before defined"
* Add test for type alias union with undefined for "use before defined" diagnostic
* Update baselines
* Use empty object for invalid package json contents instead of undefined
Fixes#34726
* Behave as if package json doesnt exist in case of invalid json in package json
* Propagate 'undefined' instead of the optional type marker at an optional chain boundary
* Update src/compiler/types.ts
Co-Authored-By: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
* Fix alias naming and structure bugs in js declarations
* Add another test case and change condition for ns merge to require signature or export content
* Fix typo in comment
* Add isIntersectionConstituent to relation key
isIntersectionConstituent controls whether relation checking performs
excess property and common property checks. It is possible to fail a
relation check with excess property checks turned on, cache the result,
and then skip a relation check with excess property checks that would
have succeeded. #33133 provides an example of such a program.
Fixes#33133 the right way, so I reverted the fix at #33213Fixes#34762 (by reverting #33213)
Fixes#33944 -- I added the test from #34646
* Update comments in test
* resolve require with entity name postfix
For example, `require("x").c`. This is the value equivalent of
`import("x").a.b.c`, but the syntax tree is not as nicely designed for
this purpose.
Fixes#34802
* Add bug number to test
* Add optional chain test
* Fix incorrectly looking for position in call/new expression arguments when looking for indentation of type arguments
Fixes#32487
* Update src/services/formatting/smartIndenter.ts
Co-Authored-By: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>