Skip to content

Commit 4ca7e4a

Browse files
Rename to tsd - fixes #5
1 parent 8425861 commit 4ca7e4a

File tree

7 files changed

+23
-23
lines changed

7 files changed

+23
-23
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"name": "tsd-check",
2+
"name": "tsd",
33
"version": "0.6.0",
44
"description": "Check TypeScript type definitions",
55
"license": "MIT",
6-
"repository": "SamVerschueren/tsd-check",
6+
"repository": "SamVerschueren/tsd",
77
"author": {
88
"name": "Sam Verschueren",
99
"email": "[email protected]",

readme.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# tsd-check [![Build Status](https://travis-ci.org/SamVerschueren/tsd-check.svg?branch=master)](https://travis-ci.org/SamVerschueren/tsd-check)
1+
# tsd [![Build Status](https://travis-ci.org/SamVerschueren/tsd.svg?branch=master)](https://travis-ci.org/SamVerschueren/tsd)
22

33
> Check TypeScript type definitions
44
55

66
## Install
77

88
```
9-
$ npm install tsd-check
9+
$ npm install tsd
1010
```
1111

1212

@@ -32,19 +32,19 @@ concat('foo', 'bar');
3232
concat(1, 2);
3333
```
3434

35-
Running `npx tsd-check` as a command will verify that the type definition works correctly.
35+
Running `npx tsd` as a command will verify that the type definition works correctly.
3636

3737
Let's add some extra [assertions](#assertions). We can assert the return type of our function call to match a certain type.
3838

3939
```ts
40-
import {expectType} from 'tsd-check';
40+
import {expectType} from 'tsd';
4141
import concat from '.';
4242

4343
expectType<string>(concat('foo', 'bar'));
4444
expectType<string>(concat(1, 2));
4545
```
4646

47-
The `tsd-check` command will succeed again.
47+
The `tsd` command will succeed again.
4848

4949
We change our implementation and type definition to return a `number` when both inputs are of type `number`.
5050

@@ -57,7 +57,7 @@ declare const concat: {
5757
export default concat;
5858
```
5959

60-
If we don't change the test file and we run the `tsd-check` command again, the test will fail.
60+
If we don't change the test file and we run the `tsd` command again, the test will fail.
6161

6262
<img src="screenshot.png" width="1330">
6363

@@ -66,7 +66,7 @@ If we don't change the test file and we run the `tsd-check` command again, the t
6666
If your method returns a `Promise`, you can use top-level `await` to resolve the value instead of wrapping it in an `async` [IIFE](https://developer.mozilla.org/en-US/docs/Glossary/IIFE).
6767

6868
```ts
69-
import {expectType, expectError} from 'tsd-check';
69+
import {expectType, expectError} from 'tsd';
7070
import concat from '.';
7171

7272
expectType<Promise<string>>(concat('foo', 'bar'));
@@ -83,7 +83,7 @@ When you have spread your tests over multiple files, you can store all those fil
8383
```json
8484
{
8585
"name": "my-module",
86-
"tsd-check": {
86+
"tsd": {
8787
"directory": "my-test-dir"
8888
}
8989
}
@@ -93,7 +93,7 @@ Now you can put all your test files in the `my-test-dir` directory.
9393

9494
### Custom TypeScript config
9595

96-
By default, `tsd-check` applies the following configuration:
96+
By default, `tsd` applies the following configuration:
9797

9898
```json5
9999
{
@@ -106,14 +106,14 @@ By default, `tsd-check` applies the following configuration:
106106
}
107107
```
108108

109-
If you wish to override these options, you have the possibility to provide a custom TypeScript config to `tsd-check` by specifying it in `package.json`.
109+
If you wish to override these options, you have the possibility to provide a custom TypeScript config to `tsd` by specifying it in `package.json`.
110110

111111
*Default options will still apply if you don't override them explicitly.* You can't override the `moduleResolution` and `skipLibCheck` options.
112112

113113
```json
114114
{
115115
"name": "my-module",
116-
"tsd-check": {
116+
"tsd": {
117117
"compilerOptions": {
118118
"strict": false
119119
}

source/cli.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
import * as meow from 'meow';
33
import * as updateNotifier from 'update-notifier';
44
import formatter from './lib/formatter';
5-
import tsdCheck from './lib';
5+
import tsd from './lib';
66

77
const cli = meow(`
88
Usage
9-
$ tsd-check [path]
9+
$ tsd [path]
1010
1111
Examples
12-
$ tsd-check /path/to/project
12+
$ tsd /path/to/project
1313
14-
$ tsd-check
14+
$ tsd
1515
1616
index.test-d.ts
1717
✖ 10:20 Argument of type string is not assignable to parameter of type number.
@@ -23,7 +23,7 @@ const cli = meow(`
2323
try {
2424
const options = cli.input.length > 0 ? {cwd: cli.input[0]} : undefined;
2525

26-
const diagnostics = await tsdCheck(options);
26+
const diagnostics = await tsd(options);
2727

2828
if (diagnostics.length > 0) {
2929
throw new Error(formatter(diagnostics));

source/lib/config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import {Config} from './interfaces';
77
* @param pkg - The package.json object.
88
* @returns The config object.
99
*/
10-
export default (pkg: {'tsd-check'?: Partial<Config>}): Config => {
11-
const pkgConfig = pkg['tsd-check'] || {};
10+
export default (pkg: {tsd?: Partial<Config>}): Config => {
11+
const pkgConfig = pkg.tsd || {};
1212

1313
return {
1414
directory: 'test-d',

source/test/fixtures/non-strict-check-with-config/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "foo",
3-
"tsd-check": {
3+
"tsd": {
44
"compilerOptions": {
55
"strict": false
66
}

source/test/fixtures/strict-null-checks-as-default-config-value/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "foo",
3-
"tsd-check": {
3+
"tsd": {
44
"compilerOptions": {
55
}
66
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "foo",
3-
"tsd-check": {
3+
"tsd": {
44
"directory": "test"
55
}
66
}

0 commit comments

Comments
 (0)