-
Notifications
You must be signed in to change notification settings - Fork 12.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show synthesized triple slash references in diagnostics for analysis
- Loading branch information
1 parent
df8d755
commit 2b69c9f
Showing
499 changed files
with
7,786 additions
and
1,074 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
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
34 changes: 34 additions & 0 deletions
34
tests/baselines/reference/amdLikeInputDeclarationEmit.errors.txt
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,34 @@ | ||
ExtendedClass.js(1,1): error TS18056: Declaration file contains synthesized file reference directives: '"../deps/BaseClass.d.ts"' | ||
|
||
|
||
==== typing.d.ts (0 errors) ==== | ||
declare function define<T=unknown>(name: string, modules: string[], ready: (...modules: unknown[]) => T); | ||
==== deps/BaseClass.d.ts (0 errors) ==== | ||
declare module "deps/BaseClass" { | ||
class BaseClass { | ||
static extends<A>(a: A): new () => A & BaseClass; | ||
} | ||
export = BaseClass; | ||
} | ||
==== ExtendedClass.js (1 errors) ==== | ||
define("lib/ExtendedClass", ["deps/BaseClass"], | ||
~~~~~~ | ||
!!! error TS18056: Declaration file contains synthesized file reference directives: '"../deps/BaseClass.d.ts"' | ||
/** | ||
* {typeof import("deps/BaseClass")} | ||
* @param {typeof import("deps/BaseClass")} BaseClass | ||
* @returns | ||
*/ | ||
(BaseClass) => { | ||
|
||
const ExtendedClass = BaseClass.extends({ | ||
f: function() { | ||
return "something"; | ||
} | ||
}); | ||
|
||
// Exports the module in a way tsc recognize class export | ||
const module = {}; | ||
module.exports = ExtendedClass | ||
return module.exports; | ||
}); |
This file was deleted.
Oops, something went wrong.
21 changes: 21 additions & 0 deletions
21
tests/baselines/reference/declFileAmbientExternalModuleWithSingleExportedModule.errors.txt
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,21 @@ | ||
declFileAmbientExternalModuleWithSingleExportedModule_1.ts(2,1): error TS18056: Declaration file contains synthesized file reference directives: '"declFileAmbientExternalModuleWithSingleExportedModule_0.d.ts"' | ||
|
||
|
||
==== declFileAmbientExternalModuleWithSingleExportedModule_1.ts (1 errors) ==== | ||
///<reference path='declFileAmbientExternalModuleWithSingleExportedModule_0.ts'/> | ||
import SubModule = require('SubModule'); | ||
~~~~~~ | ||
!!! error TS18056: Declaration file contains synthesized file reference directives: '"declFileAmbientExternalModuleWithSingleExportedModule_0.d.ts"' | ||
export var x: SubModule.m.m3.c; | ||
|
||
|
||
==== declFileAmbientExternalModuleWithSingleExportedModule_0.ts (0 errors) ==== | ||
declare module "SubModule" { | ||
export module m { | ||
export module m3 { | ||
interface c { | ||
} | ||
} | ||
} | ||
} | ||
|
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
24 changes: 24 additions & 0 deletions
24
tests/baselines/reference/declarationEmitBundleWithAmbientReferences.errors.txt
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,24 @@ | ||
src/datastore_result.ts(1,1): error TS18056: Declaration file contains synthesized file reference directives: '"../lib/lib.d.ts"' | ||
|
||
|
||
==== lib/lib.d.ts (0 errors) ==== | ||
declare module "lib/result" { | ||
export type Result<E extends Error, T> = (E & Failure<E>) | (T & Success<T>); | ||
export interface Failure<E extends Error> { } | ||
export interface Success<T> { } | ||
} | ||
|
||
==== src/datastore_result.ts (1 errors) ==== | ||
import { Result } from "lib/result"; | ||
~~~~~~ | ||
!!! error TS18056: Declaration file contains synthesized file reference directives: '"../lib/lib.d.ts"' | ||
|
||
export type T<T> = Result<Error, T>; | ||
|
||
==== src/conditional_directive_field.ts (0 errors) ==== | ||
import * as DatastoreResult from "src/datastore_result"; | ||
|
||
export const build = (): DatastoreResult.T<string> => { | ||
return null; | ||
}; | ||
|
16 changes: 16 additions & 0 deletions
16
tests/baselines/reference/declarationEmitCrossFileImportTypeOfAmbientModule.errors.txt
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,16 @@ | ||
packages/secondpackage/index.ts(1,1): error TS18056: Declaration file contains synthesized file reference directives: '"../../types/component.d.ts"' | ||
|
||
|
||
==== types/component.d.ts (0 errors) ==== | ||
declare module '@namespace/component' { | ||
export class Foo {} | ||
} | ||
==== packages/somepackage/index.d.ts (0 errors) ==== | ||
import { Foo } from "@namespace/component"; | ||
export declare const item: typeof Foo; | ||
==== packages/secondpackage/index.ts (1 errors) ==== | ||
import { item } from "../somepackage"; | ||
~~~~~~ | ||
!!! error TS18056: Declaration file contains synthesized file reference directives: '"../../types/component.d.ts"' | ||
export const reeexported = item; | ||
|
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
41 changes: 41 additions & 0 deletions
41
...es/reference/declarationEmitExportAssignedNamespaceNoTripleSlashTypesReference.errors.txt
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,41 @@ | ||
src/inferred-comp-export.ts(1,1): error TS18055: Declaration file contains synthesized type reference directives: '"react"' | ||
|
||
|
||
==== node_modules/@types/react/index.d.ts (0 errors) ==== | ||
export = React; | ||
|
||
declare namespace React { | ||
export type Component<T = any, U = {}, V = {}> = { x: T, y: U, z: V }; | ||
export interface DOMAttributes<T> { } | ||
} | ||
==== node_modules/@emotion/core/index.d.ts (0 errors) ==== | ||
import { | ||
Component | ||
} from 'react' | ||
export {}; | ||
|
||
declare module 'react' { | ||
interface DOMAttributes<T> { | ||
css?: any | ||
} | ||
} | ||
|
||
==== src/get-comp.ts (0 errors) ==== | ||
import {Component} from 'react'; | ||
|
||
export function getComp(): Component { | ||
return {} as any as Component | ||
} | ||
==== src/inferred-comp-export.ts (1 errors) ==== | ||
import { getComp } from "./get-comp"; | ||
~~~~~~ | ||
!!! error TS18055: Declaration file contains synthesized type reference directives: '"react"' | ||
|
||
// this shouldn't need any triple-slash references - it should have a direct import to `react` and that's it | ||
// This issue (#35343) _only_ reproduces in the test harness when the file in question is in a subfolder | ||
export const obj = { | ||
comp: getComp() | ||
} | ||
==== src/some-other-file.ts (0 errors) ==== | ||
export * from '@emotion/core'; | ||
|
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
17 changes: 17 additions & 0 deletions
17
tests/baselines/reference/declarationEmitHasTypesRefOnNamespaceUse.errors.txt
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,17 @@ | ||
/src/index.ts(1,1): error TS18055: Declaration file contains synthesized type reference directives: '"dep"' | ||
|
||
|
||
==== /src/index.ts (1 errors) ==== | ||
class Src implements NS.Dep { } | ||
~~~~~ | ||
!!! error TS18055: Declaration file contains synthesized type reference directives: '"dep"' | ||
|
||
==== /deps/dep/dep.d.ts (0 errors) ==== | ||
declare namespace NS { | ||
interface Dep { | ||
} | ||
} | ||
==== /deps/dep/package.json (0 errors) ==== | ||
{ | ||
"typings": "dep.d.ts" | ||
} |
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
32 changes: 32 additions & 0 deletions
32
tests/baselines/reference/declarationEmitPathMappingMonorepo.errors.txt
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,32 @@ | ||
packages/b/src/index.ts(1,1): error TS18055: Declaration file contains synthesized type reference directives: '"@ts-bug/a"' | ||
|
||
|
||
==== packages/b/tsconfig.json (0 errors) ==== | ||
{ | ||
"compilerOptions": { | ||
"outDir": "dist", | ||
"declaration": true, | ||
"baseUrl": ".", | ||
"paths": { | ||
"@ts-bug/a": ["../a"] | ||
} | ||
} | ||
} | ||
|
||
|
||
==== packages/b/src/index.ts (1 errors) ==== | ||
import { a } from "@ts-bug/a"; | ||
~~~~~~ | ||
!!! error TS18055: Declaration file contains synthesized type reference directives: '"@ts-bug/a"' | ||
|
||
export function b(text: string) { | ||
return a(text); | ||
} | ||
==== packages/a/index.d.ts (0 errors) ==== | ||
declare module "@ts-bug/a" { | ||
export type AText = { | ||
value: string; | ||
}; | ||
export function a(text: string): AText; | ||
} | ||
|
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
28 changes: 28 additions & 0 deletions
28
tests/baselines/reference/declarationEmitTripleSlashReferenceAmbientModule.errors.txt
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,28 @@ | ||
/usage1.ts(1,1): error TS18055: Declaration file contains synthesized type reference directives: '"node"' | ||
/usage2.ts(1,1): error TS18055: Declaration file contains synthesized type reference directives: '"node"' | ||
/usage3.ts(1,1): error TS18055: Declaration file contains synthesized type reference directives: '"node"' | ||
|
||
|
||
==== /node_modules/@types/node/index.d.ts (0 errors) ==== | ||
declare module "url" { | ||
export class Url {} | ||
export function parse(): Url; | ||
} | ||
|
||
==== /usage1.ts (1 errors) ==== | ||
export { parse } from "url"; | ||
~~~~~~ | ||
!!! error TS18055: Declaration file contains synthesized type reference directives: '"node"' | ||
|
||
==== /usage2.ts (1 errors) ==== | ||
import { parse } from "url"; | ||
~~~~~~ | ||
!!! error TS18055: Declaration file contains synthesized type reference directives: '"node"' | ||
export const thing: import("url").Url = parse(); | ||
|
||
==== /usage3.ts (1 errors) ==== | ||
import { parse } from "url"; | ||
~~~~~~ | ||
!!! error TS18055: Declaration file contains synthesized type reference directives: '"node"' | ||
export const thing = parse(); | ||
|
Oops, something went wrong.