diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index db6b562a70e20..d817926fe67e6 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -3355,7 +3355,7 @@ namespace ts { type = finishNode(factory.createJSDocNonNullableType(type), pos); break; case SyntaxKind.QuestionToken: - // If not in JSDoc and next token is start of a type we have a conditional type + // If next token is start of a type we have a conditional type if (lookAhead(nextTokenIsStartOfType)) { return type; } diff --git a/tests/cases/user/acorn/index.ts b/tests/cases/user/acorn/index.ts new file mode 100644 index 0000000000000..676c628c824ce --- /dev/null +++ b/tests/cases/user/acorn/index.ts @@ -0,0 +1 @@ +import x = require('acorn'); \ No newline at end of file diff --git a/tests/cases/user/acorn/tsconfig.json b/tests/cases/user/acorn/tsconfig.json index 6ef664a2c1c5c..f544c4b4c9c9a 100644 --- a/tests/cases/user/acorn/tsconfig.json +++ b/tests/cases/user/acorn/tsconfig.json @@ -7,8 +7,16 @@ "noEmit": true, "allowJs": true, "checkJs": true, - "types": ["node"], - "lib": ["esnext", "dom"], + "types": [ + "node" + ], + "lib": [ + "esnext", + "dom" + ] }, - "include": ["node_modules/acorn"] -} + "include": [ + "node_modules/acorn", + "index.ts" + ] +} \ No newline at end of file diff --git a/tests/cases/user/adonis-framework/index.ts b/tests/cases/user/adonis-framework/index.ts new file mode 100644 index 0000000000000..50b1a6f99dfbe --- /dev/null +++ b/tests/cases/user/adonis-framework/index.ts @@ -0,0 +1 @@ +import x = require('adonis-framework/src/View'); diff --git a/tests/cases/user/adonis-framework/tsconfig.json b/tests/cases/user/adonis-framework/tsconfig.json index 829e8ff07308b..f33b23f1ff04d 100644 --- a/tests/cases/user/adonis-framework/tsconfig.json +++ b/tests/cases/user/adonis-framework/tsconfig.json @@ -7,8 +7,16 @@ "noEmit": true, "allowJs": true, "checkJs": true, - "types": ["node"], - "lib": ["esnext", "dom"], + "types": [ + "node" + ], + "lib": [ + "esnext", + "dom" + ] }, - "include": ["node_modules/adonis-framework"] -} + "include": [ + "node_modules/adonis-framework", + "index.ts" + ] +} \ No newline at end of file diff --git a/tests/cases/user/assert/index.ts b/tests/cases/user/assert/index.ts new file mode 100644 index 0000000000000..315f4ace3b2df --- /dev/null +++ b/tests/cases/user/assert/index.ts @@ -0,0 +1 @@ +import x = require('assert'); \ No newline at end of file diff --git a/tests/cases/user/assert/tsconfig.json b/tests/cases/user/assert/tsconfig.json index 4c344cc1590d2..b3a8f2146af49 100644 --- a/tests/cases/user/assert/tsconfig.json +++ b/tests/cases/user/assert/tsconfig.json @@ -7,8 +7,16 @@ "noEmit": true, "allowJs": true, "checkJs": true, - "types": ["node"], - "lib": ["esnext", "dom"], + "types": [ + "node" + ], + "lib": [ + "esnext", + "dom" + ] }, - "include": ["node_modules/assert"] -} + "include": [ + "node_modules/assert", + "index.ts" + ] +} \ No newline at end of file diff --git a/tests/cases/user/async/index.ts b/tests/cases/user/async/index.ts new file mode 100644 index 0000000000000..0c1603b5169ae --- /dev/null +++ b/tests/cases/user/async/index.ts @@ -0,0 +1 @@ +import async_ = require('async'); diff --git a/tests/cases/user/async/tsconfig.json b/tests/cases/user/async/tsconfig.json index b79170484bca2..07bd8bd076554 100644 --- a/tests/cases/user/async/tsconfig.json +++ b/tests/cases/user/async/tsconfig.json @@ -10,5 +10,5 @@ "types": ["node"], "lib": ["esnext", "dom"], }, - "include": ["node_modules/async"] + "include": ["index.ts", "node_modules/async"] } diff --git a/tests/cases/user/bcryptjs/index.ts b/tests/cases/user/bcryptjs/index.ts new file mode 100644 index 0000000000000..7f0cf7e269f5c --- /dev/null +++ b/tests/cases/user/bcryptjs/index.ts @@ -0,0 +1 @@ +import x = require('bcryptjs'); \ No newline at end of file diff --git a/tests/cases/user/bcryptjs/tsconfig.json b/tests/cases/user/bcryptjs/tsconfig.json index 032e5b5655e28..6dde4d4051b87 100644 --- a/tests/cases/user/bcryptjs/tsconfig.json +++ b/tests/cases/user/bcryptjs/tsconfig.json @@ -7,12 +7,18 @@ "noEmit": true, "allowJs": true, "checkJs": true, - "types": ["node"], - "lib": ["esnext", "dom"], + "types": [ + "node" + ], + "lib": [ + "esnext", + "dom" + ] }, "include": [ "node_modules/bcryptjs/scripts", "node_modules/bcryptjs/src", - "node_modules/bcryptjs/tests" + "node_modules/bcryptjs/tests", + "index.ts" ] -} +} \ No newline at end of file diff --git a/tests/cases/user/bluebird/index.ts b/tests/cases/user/bluebird/index.ts new file mode 100644 index 0000000000000..d1aa6c2caef44 --- /dev/null +++ b/tests/cases/user/bluebird/index.ts @@ -0,0 +1 @@ +import x = require('bluebird'); \ No newline at end of file diff --git a/tests/cases/user/bluebird/tsconfig.json b/tests/cases/user/bluebird/tsconfig.json index b54158015a140..d482a57edb533 100644 --- a/tests/cases/user/bluebird/tsconfig.json +++ b/tests/cases/user/bluebird/tsconfig.json @@ -7,8 +7,16 @@ "noEmit": true, "allowJs": true, "checkJs": true, - "types": ["node"], - "lib": ["esnext", "dom"], + "types": [ + "node" + ], + "lib": [ + "esnext", + "dom" + ] }, - "include": ["node_modules/bluebird/js/release"] -} + "include": [ + "node_modules/bluebird/js/release", + "index.ts" + ] +} \ No newline at end of file diff --git a/tests/cases/user/clear-require/index.ts b/tests/cases/user/clear-require/index.ts new file mode 100644 index 0000000000000..9cc48aaa2fe7e --- /dev/null +++ b/tests/cases/user/clear-require/index.ts @@ -0,0 +1 @@ +import x = require('clear-require'); \ No newline at end of file diff --git a/tests/cases/user/clear-require/tsconfig.json b/tests/cases/user/clear-require/tsconfig.json index 010d8edac98cc..862669ea89a0a 100644 --- a/tests/cases/user/clear-require/tsconfig.json +++ b/tests/cases/user/clear-require/tsconfig.json @@ -7,8 +7,16 @@ "noEmit": true, "allowJs": true, "checkJs": true, - "lib": ["esnext", "dom"], - "types": ["node"] + "lib": [ + "esnext", + "dom" + ], + "types": [ + "node" + ] }, - "include": ["node_modules/clear-require"] -} + "include": [ + "node_modules/clear-require", + "index.ts" + ] +} \ No newline at end of file diff --git a/tests/cases/user/clone/index.ts b/tests/cases/user/clone/index.ts new file mode 100644 index 0000000000000..bc8deb71f9fd5 --- /dev/null +++ b/tests/cases/user/clone/index.ts @@ -0,0 +1 @@ +import x = require('clone'); \ No newline at end of file diff --git a/tests/cases/user/clone/tsconfig.json b/tests/cases/user/clone/tsconfig.json index 569cb09985e8c..564efe47ce7be 100644 --- a/tests/cases/user/clone/tsconfig.json +++ b/tests/cases/user/clone/tsconfig.json @@ -7,8 +7,16 @@ "noEmit": true, "allowJs": true, "checkJs": true, - "types": ["node"], - "lib": ["esnext", "dom"], + "types": [ + "node" + ], + "lib": [ + "esnext", + "dom" + ] }, - "include": ["node_modules/clone"] -} + "include": [ + "node_modules/clone", + "index.ts" + ] +} \ No newline at end of file diff --git a/tests/cases/user/content-disposition/index.ts b/tests/cases/user/content-disposition/index.ts new file mode 100644 index 0000000000000..7181342cfb3f4 --- /dev/null +++ b/tests/cases/user/content-disposition/index.ts @@ -0,0 +1 @@ +import x = require('content-disposition'); \ No newline at end of file diff --git a/tests/cases/user/content-disposition/tsconfig.json b/tests/cases/user/content-disposition/tsconfig.json index d597d933d8a0b..c7e71839c701f 100644 --- a/tests/cases/user/content-disposition/tsconfig.json +++ b/tests/cases/user/content-disposition/tsconfig.json @@ -7,8 +7,16 @@ "noEmit": true, "allowJs": true, "checkJs": true, - "types": ["node"], - "lib": ["esnext", "dom"], + "types": [ + "node" + ], + "lib": [ + "esnext", + "dom" + ] }, - "include": ["node_modules/content-disposition"] -} + "include": [ + "node_modules/content-disposition", + "index.ts" + ] +} \ No newline at end of file diff --git a/tests/cases/user/debug/index.ts b/tests/cases/user/debug/index.ts new file mode 100644 index 0000000000000..24274f8f6020a --- /dev/null +++ b/tests/cases/user/debug/index.ts @@ -0,0 +1 @@ +import debug = require('debug'); diff --git a/tests/cases/user/debug/tsconfig.json b/tests/cases/user/debug/tsconfig.json index 168535d6eb12f..b8f2be327f8e4 100644 --- a/tests/cases/user/debug/tsconfig.json +++ b/tests/cases/user/debug/tsconfig.json @@ -10,5 +10,5 @@ "types": ["node"], "lib": ["esnext", "dom"], }, - "include": ["node_modules/debug"] + "include": ["index.ts", "node_modules/debug"] } diff --git a/tests/cases/user/enhanced-resolve/index.ts b/tests/cases/user/enhanced-resolve/index.ts new file mode 100644 index 0000000000000..a138e9f0370be --- /dev/null +++ b/tests/cases/user/enhanced-resolve/index.ts @@ -0,0 +1 @@ +import x = require('enhanced-resolve'); \ No newline at end of file diff --git a/tests/cases/user/enhanced-resolve/tsconfig.json b/tests/cases/user/enhanced-resolve/tsconfig.json index 74226d5a6be39..79ff04d24c24c 100644 --- a/tests/cases/user/enhanced-resolve/tsconfig.json +++ b/tests/cases/user/enhanced-resolve/tsconfig.json @@ -7,10 +7,18 @@ "noEmit": true, "allowJs": true, "checkJs": true, - "types": ["node"], - "lib": ["esnext", "dom"], + "types": [ + "node" + ], + "lib": [ + "esnext", + "dom" + ], "module": "CommonJS", - "target": "esnext", + "target": "esnext" }, - "include": ["node_modules/enhanced-resolve"] -} + "include": [ + "node_modules/enhanced-resolve", + "index.ts" + ] +} \ No newline at end of file diff --git a/tests/cases/user/follow-redirects/index.ts b/tests/cases/user/follow-redirects/index.ts new file mode 100644 index 0000000000000..3b9bd99672919 --- /dev/null +++ b/tests/cases/user/follow-redirects/index.ts @@ -0,0 +1 @@ +import x = require('follow-redirects'); \ No newline at end of file diff --git a/tests/cases/user/follow-redirects/tsconfig.json b/tests/cases/user/follow-redirects/tsconfig.json index 2631eb02ac4a7..0693f0936c6f2 100644 --- a/tests/cases/user/follow-redirects/tsconfig.json +++ b/tests/cases/user/follow-redirects/tsconfig.json @@ -7,8 +7,16 @@ "noEmit": true, "allowJs": true, "checkJs": true, - "types": ["node"], - "lib": ["esnext", "dom"], + "types": [ + "node" + ], + "lib": [ + "esnext", + "dom" + ] }, - "include": ["node_modules/follow-redirects"] -} + "include": [ + "node_modules/follow-redirects", + "index.ts" + ] +} \ No newline at end of file diff --git a/tests/cases/user/graceful-fs/index.ts b/tests/cases/user/graceful-fs/index.ts new file mode 100644 index 0000000000000..66e27087ada45 --- /dev/null +++ b/tests/cases/user/graceful-fs/index.ts @@ -0,0 +1 @@ +import x = require('graceful-fs'); \ No newline at end of file diff --git a/tests/cases/user/graceful-fs/tsconfig.json b/tests/cases/user/graceful-fs/tsconfig.json index 4a4435d0274b6..d055c1a785af1 100644 --- a/tests/cases/user/graceful-fs/tsconfig.json +++ b/tests/cases/user/graceful-fs/tsconfig.json @@ -7,8 +7,16 @@ "noEmit": true, "allowJs": true, "checkJs": true, - "types": ["node"], - "lib": ["esnext", "dom"], + "types": [ + "node" + ], + "lib": [ + "esnext", + "dom" + ] }, - "include": ["node_modules/graceful-fs"] -} + "include": [ + "node_modules/graceful-fs", + "index.ts" + ] +} \ No newline at end of file diff --git a/tests/cases/user/lodash/index.ts b/tests/cases/user/lodash/index.ts new file mode 100644 index 0000000000000..dc7787aeb9a08 --- /dev/null +++ b/tests/cases/user/lodash/index.ts @@ -0,0 +1 @@ +import x = require('lodash'); \ No newline at end of file diff --git a/tests/cases/user/lodash/tsconfig.json b/tests/cases/user/lodash/tsconfig.json index a50a9a8537458..dfde145a90df3 100644 --- a/tests/cases/user/lodash/tsconfig.json +++ b/tests/cases/user/lodash/tsconfig.json @@ -7,9 +7,19 @@ "noEmit": true, "allowJs": true, "checkJs": true, - "types": ["node"], - "lib": ["esnext", "dom"], + "types": [ + "node" + ], + "lib": [ + "esnext", + "dom" + ] }, - "include": ["node_modules/lodash"], - "exclude": ["node_modules/lodash/lodash.js"] -} + "include": [ + "node_modules/lodash", + "index.ts" + ], + "exclude": [ + "node_modules/lodash/lodash.js" + ] +} \ No newline at end of file diff --git a/tests/cases/user/minimatch/index.ts b/tests/cases/user/minimatch/index.ts new file mode 100644 index 0000000000000..a09b6875a6efb --- /dev/null +++ b/tests/cases/user/minimatch/index.ts @@ -0,0 +1 @@ +import x = require('minimatch'); \ No newline at end of file diff --git a/tests/cases/user/minimatch/tsconfig.json b/tests/cases/user/minimatch/tsconfig.json index a78270eceac26..3e19afb37c00c 100644 --- a/tests/cases/user/minimatch/tsconfig.json +++ b/tests/cases/user/minimatch/tsconfig.json @@ -7,8 +7,16 @@ "noEmit": true, "allowJs": true, "checkJs": true, - "types": ["node"], - "lib": ["esnext", "dom"], + "types": [ + "node" + ], + "lib": [ + "esnext", + "dom" + ] }, - "include": ["node_modules/minimatch"] -} + "include": [ + "node_modules/minimatch", + "index.ts" + ] +} \ No newline at end of file diff --git a/tests/cases/user/npm/index.ts b/tests/cases/user/npm/index.ts new file mode 100644 index 0000000000000..15de2c136262e --- /dev/null +++ b/tests/cases/user/npm/index.ts @@ -0,0 +1 @@ +import x = require('npm'); \ No newline at end of file diff --git a/tests/cases/user/npm/tsconfig.json b/tests/cases/user/npm/tsconfig.json index a57d36221641f..f1bfac4f0d33d 100644 --- a/tests/cases/user/npm/tsconfig.json +++ b/tests/cases/user/npm/tsconfig.json @@ -7,8 +7,17 @@ "noEmit": true, "allowJs": true, "checkJs": true, - "types": ["node"], - "lib": ["esnext", "dom", "scripthost"], + "types": [ + "node" + ], + "lib": [ + "esnext", + "dom", + "scripthost" + ] }, - "include": ["node_modules/npm"] -} + "include": [ + "node_modules/npm", + "index.ts" + ] +} \ No newline at end of file diff --git a/tests/cases/user/npmlog/index.ts b/tests/cases/user/npmlog/index.ts new file mode 100644 index 0000000000000..1f7d2d807bc0a --- /dev/null +++ b/tests/cases/user/npmlog/index.ts @@ -0,0 +1 @@ +import x = require('npmlog'); \ No newline at end of file diff --git a/tests/cases/user/npmlog/tsconfig.json b/tests/cases/user/npmlog/tsconfig.json index e41cb272df38e..f79a3582acf03 100644 --- a/tests/cases/user/npmlog/tsconfig.json +++ b/tests/cases/user/npmlog/tsconfig.json @@ -7,8 +7,16 @@ "noEmit": true, "allowJs": true, "checkJs": true, - "types": ["node"], - "lib": ["esnext", "dom"], + "types": [ + "node" + ], + "lib": [ + "esnext", + "dom" + ] }, - "include": ["node_modules/npmlog"] -} + "include": [ + "node_modules/npmlog", + "index.ts" + ] +} \ No newline at end of file diff --git a/tests/cases/user/uglify-js/index.ts b/tests/cases/user/uglify-js/index.ts new file mode 100644 index 0000000000000..cbc122032303c --- /dev/null +++ b/tests/cases/user/uglify-js/index.ts @@ -0,0 +1 @@ +import x = require('uglify-js'); \ No newline at end of file diff --git a/tests/cases/user/uglify-js/tsconfig.json b/tests/cases/user/uglify-js/tsconfig.json index 3c4dfc18abdac..a27b4936d71e9 100644 --- a/tests/cases/user/uglify-js/tsconfig.json +++ b/tests/cases/user/uglify-js/tsconfig.json @@ -7,8 +7,16 @@ "noEmit": true, "allowJs": true, "checkJs": true, - "types": ["node"], - "lib": ["esnext", "dom"], + "types": [ + "node" + ], + "lib": [ + "esnext", + "dom" + ] }, - "include": ["node_modules/uglify-js"] -} + "include": [ + "node_modules/uglify-js", + "index.ts" + ] +} \ No newline at end of file diff --git a/tests/cases/user/url-search-params/index.ts b/tests/cases/user/url-search-params/index.ts new file mode 100644 index 0000000000000..2be6170acac50 --- /dev/null +++ b/tests/cases/user/url-search-params/index.ts @@ -0,0 +1 @@ +import x = require('url-search-params'); \ No newline at end of file diff --git a/tests/cases/user/url-search-params/tsconfig.json b/tests/cases/user/url-search-params/tsconfig.json index 113a87b9e4ac3..3b6e76f761186 100644 --- a/tests/cases/user/url-search-params/tsconfig.json +++ b/tests/cases/user/url-search-params/tsconfig.json @@ -7,8 +7,16 @@ "noEmit": true, "allowJs": true, "checkJs": true, - "types": ["node"], - "lib": ["esnext", "dom"], + "types": [ + "node" + ], + "lib": [ + "esnext", + "dom" + ] }, - "include": ["node_modules/url-search-params/build/url-search-params.node.js"] -} + "include": [ + "node_modules/url-search-params/build/url-search-params.node.js", + "index.ts" + ] +} \ No newline at end of file diff --git a/tests/cases/user/util/index.ts b/tests/cases/user/util/index.ts new file mode 100644 index 0000000000000..dfb94ec3900fd --- /dev/null +++ b/tests/cases/user/util/index.ts @@ -0,0 +1 @@ +import x = require('util'); \ No newline at end of file diff --git a/tests/cases/user/util/tsconfig.json b/tests/cases/user/util/tsconfig.json index ca58940aa0255..66b5f11df2b0d 100644 --- a/tests/cases/user/util/tsconfig.json +++ b/tests/cases/user/util/tsconfig.json @@ -7,8 +7,16 @@ "noEmit": true, "allowJs": true, "checkJs": true, - "types": ["node"], - "lib": ["esnext", "dom"], + "types": [ + "node" + ], + "lib": [ + "esnext", + "dom" + ] }, - "include": ["node_modules/util"] -} + "include": [ + "node_modules/util", + "index.ts" + ] +} \ No newline at end of file