Related issue: #28321
Search Terms
baseUrl, paths, compilerOptions
Suggestion
Do not require 'baseUrl' in compilerOptions when 'paths' is provided.
Use Cases
We want to use 'paths' for type-checking, but don't want to resolve non-module relative names:
./1.ts
./2.ts
Examples
tsconfig
{
"compilerOptions": {
"paths": {
"foo": ["../foo"]
}
}
}
Actual behavior of paths without baseUrl:
Error: Option 'paths' cannot be used without specifying '--baseUrl' option
Expected behavior of paths without baseUrl:
- No error message
paths are resolved relative to the project directory (which I think means the same thing as "where the tsconfig is")
Checklist
My suggestion meets these guidelines:
Related issue: #28321
Search Terms
baseUrl, paths, compilerOptions
Suggestion
Do not require 'baseUrl' in compilerOptions when 'paths' is provided.
Use Cases
We want to use 'paths' for type-checking, but don't want to resolve non-module relative names:
./1.ts
./2.ts
Examples
tsconfig
{ "compilerOptions": { "paths": { "foo": ["../foo"] } } }Actual behavior of
pathswithoutbaseUrl:Error:
Option 'paths' cannot be used without specifying '--baseUrl' optionExpected behavior of
pathswithoutbaseUrl:pathsare resolved relative to the project directory (which I think means the same thing as "where the tsconfig is")Checklist
My suggestion meets these guidelines: