Skip to content
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

fix(types): compilerOptions.paths to require values #15

Merged
merged 2 commits into from
Jun 17, 2022

Conversation

belgattitude
Copy link
Contributor

@belgattitude belgattitude commented Jun 17, 2022

Update type-fest to latest to fix typing issue regarding paths.

sindresorhus/type-fest#404

As an example of what it fixes (look for the // @ts-ignore):

const getTsConfigBasePaths = (tsConfigFile) => {
  const parsedTsConfig = getTsconfig(tsConfigFile);
  if (parsedTsConfig === null) {
    throw new Error(`Cannot find tsconfig file: ${tsConfigFile}`);
  }
  const tsPaths = parsedTsConfig.config.compilerOptions?.paths ?? {};

  return Object.entries(tsPaths).length > 0
    ? // @ts-ignore
      pathsToModuleNameMapper(tsPaths, {
        prefix: '<rootDir>/',
      })
    : {};
};

PS: added a manual patch to see if it works: https://github.com/belgattitude/perso/pull/365/files

@privatenumber privatenumber changed the title fix: update type-fest to fix upstream bug with paths fix(types): compilerOptions.paths to have required values (via type-fest) Jun 17, 2022
@privatenumber privatenumber changed the title fix(types): compilerOptions.paths to have required values (via type-fest) fix(types): compilerOptions.paths to require values Jun 17, 2022
@privatenumber privatenumber merged commit 6416ff3 into privatenumber:develop Jun 17, 2022
@privatenumber
Copy link
Owner

🎉 This PR is included in version 4.0.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants