{"id":25814,"library":"jsr-exports-lint","title":"jsr-exports-lint","description":"A linting tool for validating the `exports` field in JSR's `jsr.json` manifest files, designed to be used as a build hook in `tsdown` or `unbuild`. Current stable version is 0.4.2. Released under MIT license with active development. Key differentiator: unlike `publint` which lints npm `package.json` exports, this tool specifically targets JSR's `jsr.json` exports, making it essential for library authors distributing via both npm and JSR. It fully supports TypeScript and requires Node >= 20. The lint runs after the build is done, checking that all exported entries match the actual built files.","status":"active","version":"0.4.2","language":"javascript","source_language":"en","source_url":"https://github.com/kazupon/jsr-exports-lint","tags":["javascript","tsdown","unbuild","bundler","exports","jsr.json","typescript"],"install":[{"cmd":"npm install jsr-exports-lint","lang":"bash","label":"npm"},{"cmd":"yarn add jsr-exports-lint","lang":"bash","label":"yarn"},{"cmd":"pnpm add jsr-exports-lint","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency for tsdown hook integration","package":"tsdown","optional":true},{"reason":"Peer dependency for unbuild hook integration","package":"unbuild","optional":true}],"imports":[{"note":"Must import from subpath '/tsdown' for tsdown; from '/unbuild' for unbuild.","wrong":"import { lintJsrExports } from 'jsr-exports-lint'","symbol":"lintJsrExports","correct":"import { lintJsrExports } from 'jsr-exports-lint/tsdown'"},{"note":"Use '/unbuild' subpath when integrating with unbuild.","wrong":"import { lintJsrExports } from 'jsr-exports-lint'","symbol":"lintJsrExports","correct":"import { lintJsrExports } from 'jsr-exports-lint/unbuild'"},{"note":"CommonJS supported but requires subpath import.","wrong":"const lintJsrExports = require('jsr-exports-lint')","symbol":"lintJsrExports","correct":"const { lintJsrExports } = require('jsr-exports-lint/tsdown')"}],"quickstart":{"code":"// Install: npm install --save-dev jsr-exports-lint\n// tsdown.config.ts\nimport { defineConfig } from 'tsdown'\nimport { lintJsrExports } from 'jsr-exports-lint/tsdown'\n\nexport default defineConfig({\n  entry: ['./src/index.ts', './src/features/a.ts'],\n  publint: true,\n  dts: true,\n  hooks: {\n    'build:done': lintJsrExports()\n  }\n})\n\n// Run: npx tsdown build","lang":"typescript","description":"Demonstrates the simplest setup for tsdown using the default jsr.json path."},"warnings":[{"fix":"Update import paths from 'tsdown-jsr-exports-lint' to 'jsr-exports-lint'.","message":"Package renamed in v0.2.0 from 'tsdown-jsr-exports-lint' to 'jsr-exports-lint'. Old imports break.","severity":"breaking","affected_versions":">=0.2.0"},{"fix":"Upgrade tsdown to >=0.9.6 and unbuild to >=1.0.0.","message":"Support for tsdown <0.9.6 and unbuild <1.0.0 was dropped.","severity":"deprecated","affected_versions":">=0.2.0"},{"fix":"Use hooks: { 'build:done': lintJsrExports() } — with parentheses.","message":"The lintJsrExports function must be called (invoked) in the hook, not just passed as a reference.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Import from 'jsr-exports-lint/tsdown' or 'jsr-exports-lint/unbuild'.","cause":"Importing from the package root instead of the subpath.","error":"Error: Cannot find module 'jsr-exports-lint'"},{"fix":"Call it: hooks: { 'build:done': lintJsrExports() }.","cause":"Passing lintJsrExports as a reference without calling it.","error":"Error: 'undefined' is not a function (evaluating 'lintJsrExports()')"},{"fix":"Use named import: import { lintJsrExports } from 'jsr-exports-lint/tsdown'.","cause":"Using default import instead of named import.","error":"TypeError: (0 , _jsr_exports_lint_tsdown.lintJsrExports) is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}