-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Add support to report errors in js files #14496
Merged
Merged
Changes from 3 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
91571f0
Add support for handeling .js file correctelly in fixAddMissingMember…
mhegazy 0b1fff7
Add `--checkJsFiles`
mhegazy 9f0c5ce
Add support for `//@check` directives
mhegazy 0b247b1
Add tests
mhegazy 1f9bb69
Add --noEmit to tests
mhegazy b015c1d
Allow @check directives to switch on/off checking in a file
mhegazy 9305d4d
Change flag name to `checkJs`
mhegazy fb218b7
Error if `--checkJs` is used without `--allowJs`
mhegazy e9f8214
Code review comments
mhegazy a202fa4
add es6 to buildProtocol
mhegazy 3d03f8d
Merge branch 'fixBuildBreak' into checkJSFiles
mhegazy fe7719f
Disable check diagnostics per line
mhegazy 706acdf
Add quick fix to disable error checking in a .js file
mhegazy 13e80b9
Fix building webTestServer
mhegazy 936a91d
Add comment
mhegazy cc6affa
Merge remote-tracking branch 'origin/updateCodeFixForAddMissingMember…
mhegazy 6e86596
Add debugging utilities
mhegazy fd9fb8f
Support static properties
mhegazy 509b2dc
Add disableJsDiagnostics codefixes to harnes
mhegazy 1fbbead
Merge pull request #14568 from Microsoft/checkJSFiles_QuickFixes
mhegazy 7980629
Code review comments
mhegazy 0dac29f
Merge branch 'master' into checkJSFiles
mhegazy 3b57b5d
Refactor checking for checkJs value in a common helper
mhegazy e408cad
Merge branch 'master' into checkJSFiles
mhegazy db6c969
Change ingore diagonstic comment to `// @ts-ignore`
mhegazy 3378f5c
Merge branch 'master' into checkJSFiles
mhegazy e630ab1
Report semantic errors for JS files if checkJs is enabled
mhegazy 0637f24
Merge remote-tracking branch 'origin/master' into checkJSFiles
mhegazy 8ea9617
Merge remote-tracking branch 'origin/master' into checkJSFiles
mhegazy 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 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
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
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
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,13 @@ | ||
error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. | ||
Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig. | ||
tests/cases/compiler/a.js(3,1): error TS2322: Type '0' is not assignable to type 'string'. | ||
|
||
|
||
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. | ||
!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig. | ||
==== tests/cases/compiler/a.js (1 errors) ==== | ||
|
||
var x = "string"; | ||
x = 0; | ||
~ | ||
!!! error TS2322: Type '0' is not assignable to type 'string'. |
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,14 @@ | ||
error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. | ||
Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig. | ||
tests/cases/compiler/a.js(4,1): error TS2322: Type '0' is not assignable to type 'string'. | ||
|
||
|
||
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. | ||
!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig. | ||
==== tests/cases/compiler/a.js (1 errors) ==== | ||
|
||
// @check | ||
var x = "string"; | ||
x = 0; | ||
~ | ||
!!! error TS2322: Type '0' is not assignable to type 'string'. |
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,14 @@ | ||
error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. | ||
Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig. | ||
tests/cases/compiler/a.js(4,1): error TS2322: Type '0' is not assignable to type 'string'. | ||
|
||
|
||
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file. | ||
!!! error TS5055: Adding a tsconfig.json file will help organize projects that contain both TypeScript and JavaScript files. Learn more at https://aka.ms/tsconfig. | ||
==== tests/cases/compiler/a.js (1 errors) ==== | ||
|
||
// @check | ||
var x = "string"; | ||
x = 0; | ||
~ | ||
!!! error TS2322: Type '0' is not assignable to type 'string'. |
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,6 @@ | ||
// @allowJs: true | ||
// @checkJsFiles: true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You might want to add |
||
|
||
// @fileName: a.js | ||
var x = "string"; | ||
x = 0; |
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,7 @@ | ||
// @allowJs: true | ||
// @checkJsFiles: false | ||
|
||
// @fileName: a.js | ||
// @check | ||
var x = "string"; | ||
x = 0; |
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,6 @@ | ||
// @allowJs: true | ||
|
||
// @fileName: a.js | ||
// @check | ||
var x = "string"; | ||
x = 0; |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we have
allowJs
, shouldn't this becheckJs
? Having 'Files' on just one of them seems inconsistent.