-
Notifications
You must be signed in to change notification settings - Fork 716
Fix error filtering by comment directives for program diagnostics #1649
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
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
testdata/baselines/reference/compiler/processingDiagnostic.errors.txt
This file contains hidden or 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 @@ | ||
/node_modules/foo/index.d.ts(1,23): error TS2688: Cannot find type definition file for 'cookie-session'. | ||
|
||
|
||
==== /tsconfig.json (0 errors) ==== | ||
{ | ||
"compilerOptions": { | ||
"strict": true, | ||
} | ||
} | ||
==== /index.ts (0 errors) ==== | ||
import { foo } from 'foo'; | ||
const y = foo; | ||
|
||
==== /node_modules/foo/index.d.ts (1 errors) ==== | ||
/// <reference types="cookie-session"/> | ||
~~~~~~~~~~~~~~ | ||
!!! error TS2688: Cannot find type definition file for 'cookie-session'. | ||
export const foo = 1; | ||
|
||
==== /node_modules/foo/package.json (0 errors) ==== | ||
{ | ||
"name": "foo", | ||
"version": "1.0.0", | ||
"types": "index.d.ts" | ||
} |
22 changes: 22 additions & 0 deletions
22
testdata/baselines/reference/compiler/processingDiagnostic.js
This file contains hidden or 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,22 @@ | ||
//// [tests/cases/compiler/processingDiagnostic.ts] //// | ||
|
||
//// [index.d.ts] | ||
/// <reference types="cookie-session"/> | ||
export const foo = 1; | ||
|
||
//// [package.json] | ||
{ | ||
"name": "foo", | ||
"version": "1.0.0", | ||
"types": "index.d.ts" | ||
} | ||
//// [index.ts] | ||
import { foo } from 'foo'; | ||
const y = foo; | ||
|
||
|
||
//// [index.js] | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const foo_1 = require("foo"); | ||
const y = foo_1.foo; |
15 changes: 15 additions & 0 deletions
15
testdata/baselines/reference/compiler/processingDiagnostic.symbols
This file contains hidden or 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,15 @@ | ||
//// [tests/cases/compiler/processingDiagnostic.ts] //// | ||
|
||
=== /index.ts === | ||
import { foo } from 'foo'; | ||
>foo : Symbol(foo, Decl(index.ts, 0, 8)) | ||
|
||
const y = foo; | ||
>y : Symbol(y, Decl(index.ts, 1, 5)) | ||
>foo : Symbol(foo, Decl(index.ts, 0, 8)) | ||
|
||
=== /node_modules/foo/index.d.ts === | ||
/// <reference types="cookie-session"/> | ||
export const foo = 1; | ||
>foo : Symbol(foo, Decl(index.d.ts, 1, 12)) | ||
|
16 changes: 16 additions & 0 deletions
16
testdata/baselines/reference/compiler/processingDiagnostic.types
This file contains hidden or 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 @@ | ||
//// [tests/cases/compiler/processingDiagnostic.ts] //// | ||
|
||
=== /index.ts === | ||
import { foo } from 'foo'; | ||
>foo : 1 | ||
|
||
const y = foo; | ||
>y : 1 | ||
>foo : 1 | ||
|
||
=== /node_modules/foo/index.d.ts === | ||
/// <reference types="cookie-session"/> | ||
export const foo = 1; | ||
>foo : 1 | ||
>1 : 1 | ||
|
23 changes: 23 additions & 0 deletions
23
testdata/baselines/reference/compiler/processingDiagnosticTsIgnore.js
This file contains hidden or 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,23 @@ | ||
//// [tests/cases/compiler/processingDiagnosticTsIgnore.ts] //// | ||
|
||
//// [index.d.ts] | ||
// @ts-ignore | ||
/// <reference types="cookie-session"/> | ||
export const foo = 1; | ||
|
||
//// [package.json] | ||
{ | ||
"name": "foo", | ||
"version": "1.0.0", | ||
"types": "index.d.ts" | ||
} | ||
//// [index.ts] | ||
import { foo } from 'foo'; | ||
const y = foo; | ||
|
||
|
||
//// [index.js] | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const foo_1 = require("foo"); | ||
const y = foo_1.foo; |
16 changes: 16 additions & 0 deletions
16
testdata/baselines/reference/compiler/processingDiagnosticTsIgnore.symbols
This file contains hidden or 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 @@ | ||
//// [tests/cases/compiler/processingDiagnosticTsIgnore.ts] //// | ||
|
||
=== /index.ts === | ||
import { foo } from 'foo'; | ||
>foo : Symbol(foo, Decl(index.ts, 0, 8)) | ||
|
||
const y = foo; | ||
>y : Symbol(y, Decl(index.ts, 1, 5)) | ||
>foo : Symbol(foo, Decl(index.ts, 0, 8)) | ||
|
||
=== /node_modules/foo/index.d.ts === | ||
// @ts-ignore | ||
/// <reference types="cookie-session"/> | ||
export const foo = 1; | ||
>foo : Symbol(foo, Decl(index.d.ts, 2, 12)) | ||
|
17 changes: 17 additions & 0 deletions
17
testdata/baselines/reference/compiler/processingDiagnosticTsIgnore.types
This file contains hidden or 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 @@ | ||
//// [tests/cases/compiler/processingDiagnosticTsIgnore.ts] //// | ||
|
||
=== /index.ts === | ||
import { foo } from 'foo'; | ||
>foo : 1 | ||
|
||
const y = foo; | ||
>y : 1 | ||
>foo : 1 | ||
|
||
=== /node_modules/foo/index.d.ts === | ||
// @ts-ignore | ||
/// <reference types="cookie-session"/> | ||
export const foo = 1; | ||
>foo : 1 | ||
>1 : 1 | ||
|
This file contains hidden or 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,20 @@ | ||
// @filename: /node_modules/foo/index.d.ts | ||
/// <reference types="cookie-session"/> | ||
export const foo = 1; | ||
|
||
// @filename: /node_modules/foo/package.json | ||
{ | ||
"name": "foo", | ||
"version": "1.0.0", | ||
"types": "index.d.ts" | ||
} | ||
// @filename: /index.ts | ||
import { foo } from 'foo'; | ||
const y = foo; | ||
|
||
// @filename: /tsconfig.json | ||
{ | ||
"compilerOptions": { | ||
"strict": true, | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
testdata/tests/cases/compiler/processingDiagnosticTsIgnore.ts
This file contains hidden or 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 @@ | ||
// @filename: /node_modules/foo/index.d.ts | ||
// @ts-ignore | ||
/// <reference types="cookie-session"/> | ||
export const foo = 1; | ||
|
||
// @filename: /node_modules/foo/package.json | ||
{ | ||
"name": "foo", | ||
"version": "1.0.0", | ||
"types": "index.d.ts" | ||
} | ||
// @filename: /index.ts | ||
import { foo } from 'foo'; | ||
const y = foo; | ||
|
||
// @filename: /tsconfig.json | ||
{ | ||
"compilerOptions": { | ||
"strict": true, | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.