jsr-exports-lint
Version:
JSR exports field lint for bundlers
35 lines (33 loc) • 660 B
JavaScript
import { t as lint } from "./lint-ChuUrGpT.js";
//#region src/tsdown.ts
/**
* An entry for tsdown hooks
*
* @example
* ```js
* import { lintJsrExports } from 'jsr-exports-lint/tsdown'
* ```
*
* @module
*/
/**
* @author kazuya kawaguchi (a.k.a. @kazupon)
* @license MIT
*/
/**
* Lint `exports` field of JSR manifest file for tsdown hooks
* @param jsrPath The path to the `jsr.json` file.
* @returns A tsdown hook
*/
function lintJsrExports(jsrPath) {
return async (ctx) => {
await lint({
jsrPath,
entries: ctx.options.entry,
cwd: ctx.options.cwd,
silent: ctx.options.logger.level === "silent"
});
};
}
//#endregion
export { lintJsrExports };