Skip to content

[publint] publishConfig.exports is used for linting by warning message uses value from root's exports #883

@timofei-iatsenko

Description

@timofei-iatsenko

Reproduction link or steps

With a given package.json file

  "exports": {
    ".": "./src/index.ts"
  },
  "publishConfig": {
    "exports": {
      ".": "./dist/index.mjs"
    }
  },

Imagine we don't have ./dist/index.mjs file on the disk, the publint correctly report an issue, but the warning message is using data from the normal exports

The repro is here https://github.com/timofei-iatsenko/tsdown-publint-issue-repro

What is expected?

Warning message uses message from publishConfig.exports

ERROR [publint] pkg.exports["."] is ./dist/index.mjs but the file does not exist.

What is actually happening?

The warning message is using data from the normal exports, not from the publishConfig.exports

ERROR [publint] pkg.exports["."] is ./src/index.ts but the file does not exist.

So actually ./src/index.ts exists, but /dist/index.mjs is not. The warning message makes it confusing

Any additional comments?

This happend only when publint invoked from the tsdown. When publint is used from it's own cli - reporting is correct.

Metadata

Metadata

Assignees

No one assigned

    Type

    Priority

    None yet

    Effort

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions