mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Update Baselines and/or Applied Lint Fixes
This commit is contained in:
-116
@@ -1,116 +0,0 @@
|
||||
// === /tests/cases/fourslash/findAllRefsOnDefinition-import.ts ===
|
||||
// export class Test{
|
||||
//
|
||||
// constructor(){
|
||||
//
|
||||
// }
|
||||
//
|
||||
// public /*FIND ALL REFS*/[|start|](){
|
||||
// return this;
|
||||
// }
|
||||
//
|
||||
// public stop(){
|
||||
// return this;
|
||||
// }
|
||||
// }
|
||||
|
||||
// === /tests/cases/fourslash/findAllRefsOnDefinition.ts ===
|
||||
// import Second = require("./findAllRefsOnDefinition-import");
|
||||
//
|
||||
// var second = new Second.Test()
|
||||
// second.[|start|]();
|
||||
// second.stop();
|
||||
|
||||
[
|
||||
{
|
||||
"definition": {
|
||||
"containerKind": "",
|
||||
"containerName": "",
|
||||
"fileName": "/tests/cases/fourslash/findAllRefsOnDefinition-import.ts",
|
||||
"kind": "method",
|
||||
"name": "(method) Test.start(): this",
|
||||
"textSpan": {
|
||||
"start": 58,
|
||||
"length": 5
|
||||
},
|
||||
"displayParts": [
|
||||
{
|
||||
"text": "(",
|
||||
"kind": "punctuation"
|
||||
},
|
||||
{
|
||||
"text": "method",
|
||||
"kind": "text"
|
||||
},
|
||||
{
|
||||
"text": ")",
|
||||
"kind": "punctuation"
|
||||
},
|
||||
{
|
||||
"text": " ",
|
||||
"kind": "space"
|
||||
},
|
||||
{
|
||||
"text": "Test",
|
||||
"kind": "className"
|
||||
},
|
||||
{
|
||||
"text": ".",
|
||||
"kind": "punctuation"
|
||||
},
|
||||
{
|
||||
"text": "start",
|
||||
"kind": "methodName"
|
||||
},
|
||||
{
|
||||
"text": "(",
|
||||
"kind": "punctuation"
|
||||
},
|
||||
{
|
||||
"text": ")",
|
||||
"kind": "punctuation"
|
||||
},
|
||||
{
|
||||
"text": ":",
|
||||
"kind": "punctuation"
|
||||
},
|
||||
{
|
||||
"text": " ",
|
||||
"kind": "space"
|
||||
},
|
||||
{
|
||||
"text": "this",
|
||||
"kind": "keyword"
|
||||
}
|
||||
],
|
||||
"contextSpan": {
|
||||
"start": 51,
|
||||
"length": 42
|
||||
}
|
||||
},
|
||||
"references": [
|
||||
{
|
||||
"textSpan": {
|
||||
"start": 58,
|
||||
"length": 5
|
||||
},
|
||||
"fileName": "/tests/cases/fourslash/findAllRefsOnDefinition-import.ts",
|
||||
"contextSpan": {
|
||||
"start": 51,
|
||||
"length": 42
|
||||
},
|
||||
"isWriteAccess": true,
|
||||
"isDefinition": true
|
||||
},
|
||||
{
|
||||
"textSpan": {
|
||||
"start": 100,
|
||||
"length": 5
|
||||
},
|
||||
"fileName": "/tests/cases/fourslash/findAllRefsOnDefinition.ts",
|
||||
"isWriteAccess": false,
|
||||
"isDefinition": false
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -1,47 +0,0 @@
|
||||
tests/cases/compiler/index.ts(8,23): error TS1267: A type referenced in a decorated signature must be imported with 'import type' when 'isolatedModules' and 'emitDecoratorMetadata' are enabled.
|
||||
tests/cases/compiler/index.ts(14,8): error TS1267: A type referenced in a decorated signature must be imported with 'import type' when 'isolatedModules' and 'emitDecoratorMetadata' are enabled.
|
||||
tests/cases/compiler/index.ts(20,28): error TS1267: A type referenced in a decorated signature must be imported with 'import type' when 'isolatedModules' and 'emitDecoratorMetadata' are enabled.
|
||||
|
||||
|
||||
==== tests/cases/compiler/type1.ts (0 errors) ====
|
||||
interface T1 {}
|
||||
export type { T1 }
|
||||
|
||||
==== tests/cases/compiler/type2.ts (0 errors) ====
|
||||
export interface T2 {}
|
||||
|
||||
==== tests/cases/compiler/class3.ts (0 errors) ====
|
||||
export class C3 {}
|
||||
|
||||
==== tests/cases/compiler/index.ts (3 errors) ====
|
||||
import { T1 } from "./type1";
|
||||
import type { T2 } from "./type2";
|
||||
import { C3 } from "./class3";
|
||||
declare var EventListener: any;
|
||||
|
||||
class HelloWorld {
|
||||
@EventListener('1')
|
||||
handleEvent1(event: T1) {} // Error
|
||||
~~
|
||||
!!! error TS1267: A type referenced in a decorated signature must be imported with 'import type' when 'isolatedModules' and 'emitDecoratorMetadata' are enabled.
|
||||
!!! related TS1376 tests/cases/compiler/index.ts:1:10: 'T1' was imported here.
|
||||
|
||||
@EventListener('2')
|
||||
handleEvent2(event: T2) {} // Ok
|
||||
|
||||
@EventListener('1')
|
||||
p1!: T1; // Error
|
||||
~~
|
||||
!!! error TS1267: A type referenced in a decorated signature must be imported with 'import type' when 'isolatedModules' and 'emitDecoratorMetadata' are enabled.
|
||||
!!! related TS1376 tests/cases/compiler/index.ts:1:10: 'T1' was imported here.
|
||||
|
||||
@EventListener('2')
|
||||
p2!: T2; // Ok
|
||||
|
||||
@EventListener('3')
|
||||
handleEvent3(event: C3): T1 { return undefined! } // Ok, Error
|
||||
~~
|
||||
!!! error TS1267: A type referenced in a decorated signature must be imported with 'import type' when 'isolatedModules' and 'emitDecoratorMetadata' are enabled.
|
||||
!!! related TS1376 tests/cases/compiler/index.ts:1:10: 'T1' was imported here.
|
||||
}
|
||||
|
||||
@@ -1,99 +0,0 @@
|
||||
//// [tests/cases/compiler/emitDecoratorMetadata_isolatedModules.ts] ////
|
||||
|
||||
//// [type1.ts]
|
||||
interface T1 {}
|
||||
export type { T1 }
|
||||
|
||||
//// [type2.ts]
|
||||
export interface T2 {}
|
||||
|
||||
//// [class3.ts]
|
||||
export class C3 {}
|
||||
|
||||
//// [index.ts]
|
||||
import { T1 } from "./type1";
|
||||
import type { T2 } from "./type2";
|
||||
import { C3 } from "./class3";
|
||||
declare var EventListener: any;
|
||||
|
||||
class HelloWorld {
|
||||
@EventListener('1')
|
||||
handleEvent1(event: T1) {} // Error
|
||||
|
||||
@EventListener('2')
|
||||
handleEvent2(event: T2) {} // Ok
|
||||
|
||||
@EventListener('1')
|
||||
p1!: T1; // Error
|
||||
|
||||
@EventListener('2')
|
||||
p2!: T2; // Ok
|
||||
|
||||
@EventListener('3')
|
||||
handleEvent3(event: C3): T1 { return undefined! } // Ok, Error
|
||||
}
|
||||
|
||||
|
||||
//// [type1.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
//// [type2.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
//// [class3.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
exports.C3 = void 0;
|
||||
var C3 = /** @class */ (function () {
|
||||
function C3() {
|
||||
}
|
||||
return C3;
|
||||
}());
|
||||
exports.C3 = C3;
|
||||
//// [index.js]
|
||||
"use strict";
|
||||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
||||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
||||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
||||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
||||
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
||||
};
|
||||
var __metadata = (this && this.__metadata) || function (k, v) {
|
||||
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
||||
};
|
||||
exports.__esModule = true;
|
||||
var class3_1 = require("./class3");
|
||||
var HelloWorld = /** @class */ (function () {
|
||||
function HelloWorld() {
|
||||
}
|
||||
HelloWorld.prototype.handleEvent1 = function (event) { }; // Error
|
||||
HelloWorld.prototype.handleEvent2 = function (event) { }; // Ok
|
||||
HelloWorld.prototype.handleEvent3 = function (event) { return undefined; }; // Ok, Error
|
||||
__decorate([
|
||||
EventListener('1'),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [Object]),
|
||||
__metadata("design:returntype", void 0)
|
||||
], HelloWorld.prototype, "handleEvent1");
|
||||
__decorate([
|
||||
EventListener('2'),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [Object]),
|
||||
__metadata("design:returntype", void 0)
|
||||
], HelloWorld.prototype, "handleEvent2");
|
||||
__decorate([
|
||||
EventListener('1'),
|
||||
__metadata("design:type", Object)
|
||||
], HelloWorld.prototype, "p1");
|
||||
__decorate([
|
||||
EventListener('2'),
|
||||
__metadata("design:type", Object)
|
||||
], HelloWorld.prototype, "p2");
|
||||
__decorate([
|
||||
EventListener('3'),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [class3_1.C3]),
|
||||
__metadata("design:returntype", Object)
|
||||
], HelloWorld.prototype, "handleEvent3");
|
||||
return HelloWorld;
|
||||
}());
|
||||
@@ -1,72 +0,0 @@
|
||||
=== tests/cases/compiler/type1.ts ===
|
||||
interface T1 {}
|
||||
>T1 : Symbol(T1, Decl(type1.ts, 0, 0))
|
||||
|
||||
export type { T1 }
|
||||
>T1 : Symbol(T1, Decl(type1.ts, 1, 13))
|
||||
|
||||
=== tests/cases/compiler/type2.ts ===
|
||||
export interface T2 {}
|
||||
>T2 : Symbol(T2, Decl(type2.ts, 0, 0))
|
||||
|
||||
=== tests/cases/compiler/class3.ts ===
|
||||
export class C3 {}
|
||||
>C3 : Symbol(C3, Decl(class3.ts, 0, 0))
|
||||
|
||||
=== tests/cases/compiler/index.ts ===
|
||||
import { T1 } from "./type1";
|
||||
>T1 : Symbol(T1, Decl(index.ts, 0, 8))
|
||||
|
||||
import type { T2 } from "./type2";
|
||||
>T2 : Symbol(T2, Decl(index.ts, 1, 13))
|
||||
|
||||
import { C3 } from "./class3";
|
||||
>C3 : Symbol(C3, Decl(index.ts, 2, 8))
|
||||
|
||||
declare var EventListener: any;
|
||||
>EventListener : Symbol(EventListener, Decl(index.ts, 3, 11))
|
||||
|
||||
class HelloWorld {
|
||||
>HelloWorld : Symbol(HelloWorld, Decl(index.ts, 3, 31))
|
||||
|
||||
@EventListener('1')
|
||||
>EventListener : Symbol(EventListener, Decl(index.ts, 3, 11))
|
||||
|
||||
handleEvent1(event: T1) {} // Error
|
||||
>handleEvent1 : Symbol(HelloWorld.handleEvent1, Decl(index.ts, 5, 18))
|
||||
>event : Symbol(event, Decl(index.ts, 7, 15))
|
||||
>T1 : Symbol(T1, Decl(index.ts, 0, 8))
|
||||
|
||||
@EventListener('2')
|
||||
>EventListener : Symbol(EventListener, Decl(index.ts, 3, 11))
|
||||
|
||||
handleEvent2(event: T2) {} // Ok
|
||||
>handleEvent2 : Symbol(HelloWorld.handleEvent2, Decl(index.ts, 7, 28))
|
||||
>event : Symbol(event, Decl(index.ts, 10, 15))
|
||||
>T2 : Symbol(T2, Decl(index.ts, 1, 13))
|
||||
|
||||
@EventListener('1')
|
||||
>EventListener : Symbol(EventListener, Decl(index.ts, 3, 11))
|
||||
|
||||
p1!: T1; // Error
|
||||
>p1 : Symbol(HelloWorld.p1, Decl(index.ts, 10, 28))
|
||||
>T1 : Symbol(T1, Decl(index.ts, 0, 8))
|
||||
|
||||
@EventListener('2')
|
||||
>EventListener : Symbol(EventListener, Decl(index.ts, 3, 11))
|
||||
|
||||
p2!: T2; // Ok
|
||||
>p2 : Symbol(HelloWorld.p2, Decl(index.ts, 13, 10))
|
||||
>T2 : Symbol(T2, Decl(index.ts, 1, 13))
|
||||
|
||||
@EventListener('3')
|
||||
>EventListener : Symbol(EventListener, Decl(index.ts, 3, 11))
|
||||
|
||||
handleEvent3(event: C3): T1 { return undefined! } // Ok, Error
|
||||
>handleEvent3 : Symbol(HelloWorld.handleEvent3, Decl(index.ts, 16, 10))
|
||||
>event : Symbol(event, Decl(index.ts, 19, 15))
|
||||
>C3 : Symbol(C3, Decl(index.ts, 2, 8))
|
||||
>T1 : Symbol(T1, Decl(index.ts, 0, 8))
|
||||
>undefined : Symbol(undefined)
|
||||
}
|
||||
|
||||
@@ -1,74 +0,0 @@
|
||||
=== tests/cases/compiler/type1.ts ===
|
||||
interface T1 {}
|
||||
export type { T1 }
|
||||
>T1 : T1
|
||||
|
||||
=== tests/cases/compiler/type2.ts ===
|
||||
export interface T2 {}
|
||||
No type information for this code.
|
||||
No type information for this code.=== tests/cases/compiler/class3.ts ===
|
||||
export class C3 {}
|
||||
>C3 : C3
|
||||
|
||||
=== tests/cases/compiler/index.ts ===
|
||||
import { T1 } from "./type1";
|
||||
>T1 : any
|
||||
|
||||
import type { T2 } from "./type2";
|
||||
>T2 : T2
|
||||
|
||||
import { C3 } from "./class3";
|
||||
>C3 : typeof C3
|
||||
|
||||
declare var EventListener: any;
|
||||
>EventListener : any
|
||||
|
||||
class HelloWorld {
|
||||
>HelloWorld : HelloWorld
|
||||
|
||||
@EventListener('1')
|
||||
>EventListener('1') : any
|
||||
>EventListener : any
|
||||
>'1' : "1"
|
||||
|
||||
handleEvent1(event: T1) {} // Error
|
||||
>handleEvent1 : (event: T1) => void
|
||||
>event : T1
|
||||
|
||||
@EventListener('2')
|
||||
>EventListener('2') : any
|
||||
>EventListener : any
|
||||
>'2' : "2"
|
||||
|
||||
handleEvent2(event: T2) {} // Ok
|
||||
>handleEvent2 : (event: T2) => void
|
||||
>event : T2
|
||||
|
||||
@EventListener('1')
|
||||
>EventListener('1') : any
|
||||
>EventListener : any
|
||||
>'1' : "1"
|
||||
|
||||
p1!: T1; // Error
|
||||
>p1 : T1
|
||||
|
||||
@EventListener('2')
|
||||
>EventListener('2') : any
|
||||
>EventListener : any
|
||||
>'2' : "2"
|
||||
|
||||
p2!: T2; // Ok
|
||||
>p2 : T2
|
||||
|
||||
@EventListener('3')
|
||||
>EventListener('3') : any
|
||||
>EventListener : any
|
||||
>'3' : "3"
|
||||
|
||||
handleEvent3(event: C3): T1 { return undefined! } // Ok, Error
|
||||
>handleEvent3 : (event: C3) => T1
|
||||
>event : C3
|
||||
>undefined! : undefined
|
||||
>undefined : undefined
|
||||
}
|
||||
|
||||
@@ -1,195 +0,0 @@
|
||||
// === /tests/cases/fourslash/a.ts ===
|
||||
// interface A {
|
||||
// /*FIND ALL REFS*/[|foo|]: string;
|
||||
// }
|
||||
|
||||
// === /tests/cases/fourslash/b.ts ===
|
||||
// ///<reference path='a.ts'/>
|
||||
//
|
||||
//
|
||||
// function foo(x: A) {
|
||||
// x.[|foo|]
|
||||
// }
|
||||
|
||||
[
|
||||
{
|
||||
"definition": {
|
||||
"containerKind": "",
|
||||
"containerName": "",
|
||||
"fileName": "/tests/cases/fourslash/a.ts",
|
||||
"kind": "property",
|
||||
"name": "(property) A.foo: string",
|
||||
"textSpan": {
|
||||
"start": 18,
|
||||
"length": 3
|
||||
},
|
||||
"displayParts": [
|
||||
{
|
||||
"text": "(",
|
||||
"kind": "punctuation"
|
||||
},
|
||||
{
|
||||
"text": "property",
|
||||
"kind": "text"
|
||||
},
|
||||
{
|
||||
"text": ")",
|
||||
"kind": "punctuation"
|
||||
},
|
||||
{
|
||||
"text": " ",
|
||||
"kind": "space"
|
||||
},
|
||||
{
|
||||
"text": "A",
|
||||
"kind": "interfaceName"
|
||||
},
|
||||
{
|
||||
"text": ".",
|
||||
"kind": "punctuation"
|
||||
},
|
||||
{
|
||||
"text": "foo",
|
||||
"kind": "propertyName"
|
||||
},
|
||||
{
|
||||
"text": ":",
|
||||
"kind": "punctuation"
|
||||
},
|
||||
{
|
||||
"text": " ",
|
||||
"kind": "space"
|
||||
},
|
||||
{
|
||||
"text": "string",
|
||||
"kind": "keyword"
|
||||
}
|
||||
],
|
||||
"contextSpan": {
|
||||
"start": 18,
|
||||
"length": 12
|
||||
}
|
||||
},
|
||||
"references": [
|
||||
{
|
||||
"textSpan": {
|
||||
"start": 18,
|
||||
"length": 3
|
||||
},
|
||||
"fileName": "/tests/cases/fourslash/a.ts",
|
||||
"contextSpan": {
|
||||
"start": 18,
|
||||
"length": 12
|
||||
},
|
||||
"isWriteAccess": false,
|
||||
"isDefinition": true
|
||||
},
|
||||
{
|
||||
"textSpan": {
|
||||
"start": 57,
|
||||
"length": 3
|
||||
},
|
||||
"fileName": "/tests/cases/fourslash/b.ts",
|
||||
"isWriteAccess": false,
|
||||
"isDefinition": false
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
// === /tests/cases/fourslash/a.ts ===
|
||||
// interface A {
|
||||
// [|foo|]: string;
|
||||
// }
|
||||
|
||||
// === /tests/cases/fourslash/b.ts ===
|
||||
// ///<reference path='a.ts'/>
|
||||
//
|
||||
//
|
||||
// function foo(x: A) {
|
||||
// x./*FIND ALL REFS*/[|foo|]
|
||||
// }
|
||||
|
||||
[
|
||||
{
|
||||
"definition": {
|
||||
"containerKind": "",
|
||||
"containerName": "",
|
||||
"fileName": "/tests/cases/fourslash/a.ts",
|
||||
"kind": "property",
|
||||
"name": "(property) A.foo: string",
|
||||
"textSpan": {
|
||||
"start": 18,
|
||||
"length": 3
|
||||
},
|
||||
"displayParts": [
|
||||
{
|
||||
"text": "(",
|
||||
"kind": "punctuation"
|
||||
},
|
||||
{
|
||||
"text": "property",
|
||||
"kind": "text"
|
||||
},
|
||||
{
|
||||
"text": ")",
|
||||
"kind": "punctuation"
|
||||
},
|
||||
{
|
||||
"text": " ",
|
||||
"kind": "space"
|
||||
},
|
||||
{
|
||||
"text": "A",
|
||||
"kind": "interfaceName"
|
||||
},
|
||||
{
|
||||
"text": ".",
|
||||
"kind": "punctuation"
|
||||
},
|
||||
{
|
||||
"text": "foo",
|
||||
"kind": "propertyName"
|
||||
},
|
||||
{
|
||||
"text": ":",
|
||||
"kind": "punctuation"
|
||||
},
|
||||
{
|
||||
"text": " ",
|
||||
"kind": "space"
|
||||
},
|
||||
{
|
||||
"text": "string",
|
||||
"kind": "keyword"
|
||||
}
|
||||
],
|
||||
"contextSpan": {
|
||||
"start": 18,
|
||||
"length": 12
|
||||
}
|
||||
},
|
||||
"references": [
|
||||
{
|
||||
"textSpan": {
|
||||
"start": 18,
|
||||
"length": 3
|
||||
},
|
||||
"fileName": "/tests/cases/fourslash/a.ts",
|
||||
"contextSpan": {
|
||||
"start": 18,
|
||||
"length": 12
|
||||
},
|
||||
"isWriteAccess": false
|
||||
},
|
||||
{
|
||||
"textSpan": {
|
||||
"start": 57,
|
||||
"length": 3
|
||||
},
|
||||
"fileName": "/tests/cases/fourslash/b.ts",
|
||||
"isWriteAccess": false
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -512,4 +512,6 @@ tests/cases/conformance/salsa/plainJSGrammarErrors.js(205,36): error TS1325: Arg
|
||||
const spreadDynamicImport = import(...[])
|
||||
~~~~~
|
||||
!!! error TS1325: Argument of dynamic import cannot be spread element.
|
||||
|
||||
return
|
||||
|
||||
@@ -204,6 +204,8 @@ function foo() { new.targe }
|
||||
const nullaryDynamicImport = import()
|
||||
const trinaryDynamicImport = import('1', '2', '3')
|
||||
const spreadDynamicImport = import(...[])
|
||||
|
||||
return
|
||||
|
||||
|
||||
//// [plainJSGrammarErrors.js]
|
||||
@@ -405,3 +407,4 @@ function foo() { new.targe; }
|
||||
const nullaryDynamicImport = import();
|
||||
const trinaryDynamicImport = import('1', '2', '3');
|
||||
const spreadDynamicImport = import(...[]);
|
||||
return;
|
||||
|
||||
@@ -465,3 +465,5 @@ const trinaryDynamicImport = import('1', '2', '3')
|
||||
const spreadDynamicImport = import(...[])
|
||||
>spreadDynamicImport : Symbol(spreadDynamicImport, Decl(plainJSGrammarErrors.js, 204, 5))
|
||||
|
||||
return
|
||||
|
||||
|
||||
@@ -624,3 +624,5 @@ const spreadDynamicImport = import(...[])
|
||||
>...[] : undefined
|
||||
>[] : undefined[]
|
||||
|
||||
return
|
||||
|
||||
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"noDtsResolution": true
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user