-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Make CommonJS the default (and some default "exclude" values). #7016
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
13 commits
Select commit
Hold shift + click to select a range
b791fd8
Changed node_modules and module defaults
billti 0e5a93b
Changed further defaults to CommonJS
billti f2e7f9f
Removed errors for missing module specifier
billti f9fb68f
Fixed up baselines
billti ed1eb2b
Fixed up paths in fourslash tests
billti 2922bd5
Fix node_modules exclude
billti 7404b90
fix falling tests and linter issues
vladima e4f7add
Merge pull request #7027 from Microsoft/fixTestsAndLinter
billti fc5d94d
Do not add minified JavaScript files on file crawl
billti 73fa45b
Added back errors for module kind none
billti 4a67dc5
Dont default to CommonJS modules for ES6 target
billti 195e69c
Added module: none as an option
billti d446d06
Added module: none baseline
billti 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
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
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
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
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
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
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
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
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
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
5 changes: 1 addition & 4 deletions
5
...es/reference/TwoInternalModulesThatMergeEachWithExportedLocalVarsOfTheSameName.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
28 changes: 0 additions & 28 deletions
28
tests/baselines/reference/ambientDeclarationsExternal.errors.txt
This file was deleted.
Oops, something went wrong.
36 changes: 36 additions & 0 deletions
36
tests/baselines/reference/ambientDeclarationsExternal.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,36 @@ | ||
| === tests/cases/conformance/ambient/consumer.ts === | ||
| /// <reference path="decls.ts" /> | ||
| import imp1 = require('equ'); | ||
| >imp1 : Symbol(imp1, Decl(consumer.ts, 0, 0)) | ||
|
|
||
|
|
||
| // Ambient external module members are always exported with or without export keyword when module lacks export assignment | ||
| import imp3 = require('equ2'); | ||
| >imp3 : Symbol(imp3, Decl(consumer.ts, 1, 29)) | ||
|
|
||
| var n = imp3.x; | ||
| >n : Symbol(n, Decl(consumer.ts, 6, 3), Decl(consumer.ts, 7, 3)) | ||
| >imp3.x : Symbol(imp3.x, Decl(decls.ts, 8, 7)) | ||
| >imp3 : Symbol(imp3, Decl(consumer.ts, 1, 29)) | ||
| >x : Symbol(imp3.x, Decl(decls.ts, 8, 7)) | ||
|
|
||
| var n: number; | ||
| >n : Symbol(n, Decl(consumer.ts, 6, 3), Decl(consumer.ts, 7, 3)) | ||
|
|
||
| === tests/cases/conformance/ambient/decls.ts === | ||
|
|
||
| // Ambient external module with export assignment | ||
| declare module 'equ' { | ||
| var x; | ||
| >x : Symbol(x, Decl(decls.ts, 3, 7)) | ||
|
|
||
| export = x; | ||
| >x : Symbol(x, Decl(decls.ts, 3, 7)) | ||
| } | ||
|
|
||
| declare module 'equ2' { | ||
| var x: number; | ||
| >x : Symbol(x, Decl(decls.ts, 8, 7)) | ||
| } | ||
|
|
||
| // Ambient external import declaration referencing ambient external module using top level module name |
36 changes: 36 additions & 0 deletions
36
tests/baselines/reference/ambientDeclarationsExternal.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,36 @@ | ||
| === tests/cases/conformance/ambient/consumer.ts === | ||
| /// <reference path="decls.ts" /> | ||
| import imp1 = require('equ'); | ||
| >imp1 : any | ||
|
|
||
|
|
||
| // Ambient external module members are always exported with or without export keyword when module lacks export assignment | ||
| import imp3 = require('equ2'); | ||
| >imp3 : typeof imp3 | ||
|
|
||
| var n = imp3.x; | ||
| >n : number | ||
| >imp3.x : number | ||
| >imp3 : typeof imp3 | ||
| >x : number | ||
|
|
||
| var n: number; | ||
| >n : number | ||
|
|
||
| === tests/cases/conformance/ambient/decls.ts === | ||
|
|
||
| // Ambient external module with export assignment | ||
| declare module 'equ' { | ||
| var x; | ||
| >x : any | ||
|
|
||
| export = x; | ||
| >x : any | ||
| } | ||
|
|
||
| declare module 'equ2' { | ||
| var x: number; | ||
| >x : number | ||
| } | ||
|
|
||
| // Ambient external import declaration referencing ambient external module using top level module name |
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
5 changes: 1 addition & 4 deletions
5
tests/baselines/reference/classAbstractManyKeywords.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
5 changes: 1 addition & 4 deletions
5
tests/baselines/reference/classMemberInitializerWithLamdaScoping3.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
5 changes: 1 addition & 4 deletions
5
tests/baselines/reference/classMemberInitializerWithLamdaScoping4.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
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
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.
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.
We have added this message in the past to catch iadvertant use of export/import in the top level of a script file. ppl used to do this by mistak, and spend hours to understand what is wrong with thier program.
@zhengbli and I talked about this, and the conclusion was to leave a valid module target
--m nonewhich will trigger this error. this way users who are sure they never need a module loader can set it and get the nice error instead of having to go crazy figuring out what it means.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.
Well that's a pain :-/ ModuleKind.None is 0, so I'll need to change all the existing checks that just looks for a falsy value as meaning "not set". Will look into it...