* add two tests: Refactor: Remove braces from arrow function
* refactor: simplify test and add another test
* fix: copyTrailingAsLeadingComments in addOrRemoveBracesToArrowFunction
* test: add additional test
* fix: clean up changes
* fix: add check for newEdit
* fix: add function for semi colon modifier
* feat: grab all comments during refactor
* refactor: update addOrRemoveBraces logic
* fix: remove duplicate function call
* Update src/services/refactors/addOrRemoveBracesToArrowFunction.ts
* remove blank line
remove blank line
Co-authored-by: Jesse Trinity <42591254+jessetrinity@users.noreply.github.com>
* Add fastpath to isRelatedTo for type references
* Do not check intersections or unions to ignore propegating reference flags, properly set comparing jsx flag
* Re-remove unneeded check
* Just check for TypeFlags.Object
* Remove else clause
* Error on missing BigInt in ES2020 too.
Previously it was only on ESNext, but bigint ships in ES 2020.
There are no tests for this; passing `false` doesn't cause any tests to
fail at least.
* add tests
* Avoid circular reference in this-property assignments
To do this, don't check this-property assigments that have the
this-property of the lhs appearing somewhere on the rhs:
```js
class C {
m() {
this.x = 12
this.x = this.x + this.y
}
}
```
I tried suppressing the circularity error, but because we cache the
first type discovered for a property, this still results in an implicit
any for `x` in the previous example. It just doesn't have an error.
Fixes#35099
* Add test case + rename function
* Use isMatchingReference
Get the `declaration` container just once instead of in three places.
(Minor change: one place used to start looking from
`declaration.parent`, but that shouldn't make any difference.) Also,
don't pass it to the helper functions since they're local anyway.
This only applies in JS, where `@template` tags can apply to
initialisers of variable declarations:
```js
/**
* @template T
* @returns {(b: T) => T}
*/
const seq = a => b => b
```
Fixes#36201
* Consolidated extra property check with intersections
* Fix comment
* Add tests
* Properly propagate intersectionState
* Route property check through recursive type tracking logic
* Accept new baselines
* Skip check when apparent type of source is never
* Accept new baselines
* Only check when apparent type of source is a structured type