Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing ES types regression in 0.15 #100

Merged
merged 5 commits into from
May 25, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
"prepublishOnly": "npm run build",
"pretest": "npm run build && cpy \"./**/**\" \"../../../dist/test/fixtures/\" --parents --cwd=source/test/fixtures",
"test": "npm run lint && ava",
"build": "npm run clean && tsc && chmod +x dist/cli.js",
"build": "npm run clean && tsc --project tsconfig.tsd.json && chmod +x dist/cli.js",
"clean": "del-cli dist",
"lint": "tslint -p . --format stylish"
"lint": "tslint -p tsconfig.tsd.json --format stylish"
},
"files": [
"dist/index.js",
Expand Down
2 changes: 1 addition & 1 deletion source/lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default (pkg: {tsd?: RawConfig}, cwd: string): Config => {
compilerOptions: {
strict: true,
jsx: JsxEmit.React,
lib: ['es2017', 'dom', 'dom.iterable'],
lib: ['es2017', 'dom', 'dom.iterable'].map(lib => `lib.${lib}.d.ts`),
module: ModuleKind.CommonJS,
target: ScriptTarget.ES2017,
esModuleInterop: true,
Expand Down
7 changes: 1 addition & 6 deletions source/test/fixtures/dom/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
{
"name": "foo",
"tsd": {
"compilerOptions": {
"lib": ["dom"]
}
}
"name": "foo"
}
9 changes: 0 additions & 9 deletions source/test/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,6 @@ test('overridden config defaults to `strict` if `strict` is not explicitly overr
]);
});

test('fail if types are used from a lib that was not explicitly specified', async t => {
const diagnostics = await tsd({cwd: path.join(__dirname, 'fixtures/lib-config/failure-missing-lib')});

verify(t, diagnostics, [
[1, 22, 'error', 'Cannot find name \'Window\'.', /failure-missing-lib\/index.d.ts$/],
[4, 11, 'error', 'Cannot find name \'Window\'.', /failure-missing-lib\/index.test-d.ts$/]
]);
});

test('allow specifying a lib as a triple-slash-reference', async t => {
const diagnostics = await tsd({cwd: path.join(__dirname, 'fixtures/lib-config/lib-as-triple-slash-reference')});

Expand Down
File renamed without changes.