kyle-johnson / rollup-plugin-optimize-lodash-imports

10 stars 6 forks source link

Support TypeScript "moduleResolution": "node16" #400

Closed IlyaSemenov closed 1 year ago

IlyaSemenov commented 1 year ago

With Typescript 5.1 and the following tsconfig:

{
  "compilerOptions": {
    "strict": true,
    "moduleResolution": "node16"
  }
}

the rollup plugin fails to import types:

import { optimizeLodashImports } from "@optimize-lodash/rollup-plugin"

with this error:

Could not find a declaration file for module '@optimize-lodash/rollup-plugin'. '/Users/semenov/tmp/ts/node_modules/.pnpm/@optimize-lodash+rollup-plugin@4.0.3_rollup@3.28.0/node_modules/@optimize-lodash/rollup-plugin/dist/index.mjs' implicitly has an 'any' type.

There are types at '/Users/semenov/tmp/ts/node_modules/@optimize-lodash/rollup-plugin/dist/index.d.ts', but this result could not be resolved when respecting package.json "exports". The '@optimize-lodash/rollup-plugin' library may need to update its package.json or typings.

ts(7016)

The fix add types compatible with modern moduleResolution.

changeset-bot[bot] commented 1 year ago

🦋 Changeset detected

Latest commit: 75066c9c741cc7aa0805dbd44f0b3d024ba06333

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | ------------------------------ | ----- | | @optimize-lodash/rollup-plugin | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

codecov[bot] commented 1 year ago

Codecov Report

Patch and project coverage have no change.

Comparison is base (3227863) 97.11% compared to head (75066c9) 97.11%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #400 +/- ## ======================================= Coverage 97.11% 97.11% ======================================= Files 6 6 Lines 104 104 Branches 29 29 ======================================= Hits 101 101 Misses 3 3 ``` | [Flag](https://app.codecov.io/gh/kyle-johnson/rollup-plugin-optimize-lodash-imports/pull/400/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Kyle+Johnson) | Coverage Δ | | |---|---|---| | [esbuild-plugin](https://app.codecov.io/gh/kyle-johnson/rollup-plugin-optimize-lodash-imports/pull/400/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Kyle+Johnson) | `86.95% <ø> (ø)` | | | [rollup-plugin](https://app.codecov.io/gh/kyle-johnson/rollup-plugin-optimize-lodash-imports/pull/400/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Kyle+Johnson) | `100.00% <ø> (ø)` | | | [transform](https://app.codecov.io/gh/kyle-johnson/rollup-plugin-optimize-lodash-imports/pull/400/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Kyle+Johnson) | `100.00% <ø> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Kyle+Johnson#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.