You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
--moduleResolution bundler (formerly known as hybrid) (#51669)
* WIP
* Add extension error back unless noEmit is set
* Add non-relative tests
* Add error for importing from declaration file
* Update unit test
* Add explicit flag for importing from .ts extensions
* Add module specifier resolution changes
* Add auto-import tests
* Disallow relative imports into node_modules
* Ensure auto-imports don’t suggest ./node_modules;
* Test a non-portable declaration emit issue
* Test auto-importing TSX file
* Update path completions
* Fix lint due to merge
* Remove minimal-specific stuff
* Remove minimal tests
* Update unit tests
* Add options
* Add customConditions option
* Add first tests
* CJS constructs are not allowed
* Add another test
* Fix extension adding/replacing priority
* Update test to reflect the choice not to block on unrecognized extensions
* Add auto-imports and string completions tests
* Revamp string completions ending preferences
* Comment test
* Auto-imports of declaration files cannot use .ts extension
* Have declaration file auto imports default to extensionless instead
* Add test for custom conditions
* Fix indentation
* Add baseline showing resolvePackageJsonImports/Exports compatibility
* Fix test and prevent CJS require from resolving
* Update unit test baselines
* Fix bad merge conflict resolution
* Make resolvedUsingTsExtension optional
* Update missed baselines
* Revert now-unnecessary API implementation changes
* Clean up
* Update baselines to es5 emit
* Rename to `bundler`
Copy file name to clipboardExpand all lines: src/compiler/diagnosticMessages.json
+44-4Lines changed: 44 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -3563,6 +3563,10 @@
3563
3563
"category": "Error",
3564
3564
"code": 2845
3565
3565
},
3566
+
"A declaration file cannot be imported without 'import type'. Did you mean to import an implementation file '{0}' instead?": {
3567
+
"category": "Error",
3568
+
"code": 2846
3569
+
},
3566
3570
3567
3571
"Import declaration '{0}' is using private name '{1}'.": {
3568
3572
"category": "Error",
@@ -4221,6 +4225,26 @@
4221
4225
"category": "Error",
4222
4226
"code": 5095
4223
4227
},
4228
+
"Option 'allowImportingTsExtensions' can only be used when 'moduleResolution' is set to 'bundler' and either 'noEmit' or 'emitDeclarationOnly' is set.": {
4229
+
"category": "Error",
4230
+
"code": 5096
4231
+
},
4232
+
"An import path can only end with a '{0}' extension when 'allowImportingTsExtensions' is enabled.": {
4233
+
"category": "Error",
4234
+
"code": 5097
4235
+
},
4236
+
"Option '{0}' can only be used when 'moduleResolution' is set to 'node16', 'nodenext', or 'bundler'.": {
4237
+
"category": "Error",
4238
+
"code": 5098
4239
+
},
4240
+
"Import assignment is not allowed when 'moduleResolution' is set to 'bundler'. Consider using 'import * as ns from \"mod\"', 'import {a} from \"mod\"', 'import d from \"mod\"', or another module format instead.": {
4241
+
"category": "Error",
4242
+
"code": 5099
4243
+
},
4244
+
"Export assignment cannot be used when 'moduleResolution' is set to 'bundler'. Consider using 'export default' or another module format instead.": {
4245
+
"category": "Error",
4246
+
"code": 5100
4247
+
},
4224
4248
4225
4249
"Generates a sourcemap for each corresponding '.d.ts' file.": {
"Initializes a TypeScript project and creates a tsconfig.json file.": {
4451
4471
"category": "Message",
4452
4472
"code": 6070
@@ -5430,6 +5450,26 @@
5430
5450
"category": "Message",
5431
5451
"code": 6406
5432
5452
},
5453
+
"Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set.": {
5454
+
"category": "Message",
5455
+
"code": 6407
5456
+
},
5457
+
"Use the package.json 'exports' field when resolving package imports.": {
5458
+
"category": "Message",
5459
+
"code": 6408
5460
+
},
5461
+
"Use the package.json 'imports' field when resolving imports.": {
5462
+
"category": "Message",
5463
+
"code": 6409
5464
+
},
5465
+
"Conditions to set in addition to the resolver-specific defaults when resolving imports.": {
5466
+
"category": "Message",
5467
+
"code": 6410
5468
+
},
5469
+
"`true` when 'moduleResolution' is 'node16', 'nodenext', or 'bundler'; otherwise `false`.": {
5470
+
"category": "Message",
5471
+
"code": 6411
5472
+
},
5433
5473
5434
5474
"The expected type comes from property '{0}' which is declared here on type '{1}'": {
0 commit comments