Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update deps * Add tests * Add changelog
- Loading branch information
1 parent
f1e0f63
commit 06065bf
Showing
10 changed files
with
114 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#### Support TypeScript 4.3 (#10945 by @sosukesuzuki) | ||
|
||
##### [`override` modifiers in class elements](https://devblogs.microsoft.com/typescript/announcing-typescript-4-3-rc/#override-and-the-noimplicitoverride-flag) | ||
|
||
```ts | ||
class Foo extends { | ||
override method() {} | ||
} | ||
``` | ||
|
||
##### [static index signatures (`[key: KeyType]: ValueType`) in classes](https://devblogs.microsoft.com/typescript/announcing-typescript-4-3-rc/#static-index-signatures) | ||
|
||
```ts | ||
class Foo { | ||
static [key: string]: Bar; | ||
} | ||
``` | ||
|
||
##### [`get` / `set` in type declarations](https://devblogs.microsoft.com/typescript/announcing-typescript-4-3-rc/#separate-write-types-on-properties) | ||
|
||
```ts | ||
interface Foo { | ||
set foo(value); | ||
get foo(): string; | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
tests/format/typescript/override-modifiers/__snapshots__/jsfmt.spec.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`override-modifier.ts format 1`] = ` | ||
====================================options===================================== | ||
parsers: ["typescript"] | ||
printWidth: 80 | ||
| printWidth | ||
=====================================input====================================== | ||
class MyClass extends BaseClass { | ||
override show() {} | ||
public override show() {} | ||
override size = 5; | ||
override readonly size = 5; | ||
} | ||
=====================================output===================================== | ||
class MyClass extends BaseClass { | ||
override show() {} | ||
public override show() {} | ||
override size = 5; | ||
override readonly size = 5; | ||
} | ||
================================================================================ | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
run_spec(__dirname, ["typescript"]); |
File renamed without changes.
39 changes: 39 additions & 0 deletions
39
tests/format/typescript/type-member-get-set/__snapshots__/jsfmt.spec.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`type-member-get-set.ts format 1`] = ` | ||
====================================options===================================== | ||
parsers: ["typescript"] | ||
printWidth: 80 | ||
| printWidth | ||
=====================================input====================================== | ||
interface Foo { | ||
get foo(): string; | ||
set bar(v); | ||
} | ||
type Foo = { | ||
get foo(): string; | ||
set bar(v); | ||
} | ||
interface Foo { | ||
set bar(foo: string); | ||
} | ||
=====================================output===================================== | ||
interface Foo { | ||
get foo(): string; | ||
set bar(v); | ||
} | ||
type Foo = { | ||
get foo(): string; | ||
set bar(v); | ||
}; | ||
interface Foo { | ||
set bar(foo: string); | ||
} | ||
================================================================================ | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
run_spec(__dirname, ["typescript"]); |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters