The parseJsonConfigFileContent
function does not resolve relative JSON paths
#60918
Labels
Milestone
parseJsonConfigFileContent
function does not resolve relative JSON paths
#60918
π Search Terms
json, imports, files, allowJs, resolveJsonModule
π Version & Regression Information
This is replicated in TypeScript version 5.7.2. It has not been tested on earlier versions.
β― Playground Link
No response
π» Code
$ npm install $ npm test
π Actual behavior
π Expected behavior
Additional information about the issue
I tried to find the reason and ended up here. The pattern that is generated for subsequent path validation always starts with a slash. As a result, any relative path in the future will fail this check. An example of the generated pattern is below:
/^\/(?!(node_modules|bower_components|jspm_packages)(\/|$))([^./]([^./]|(\.(?!min\.js$))?)*)?\.json$/
The text was updated successfully, but these errors were encountered: