{"id":22890497,"url":"https://github.com/rspack-contrib/rsbuild-plugin-publint","last_synced_at":"2025-04-22T20:29:21.497Z","repository":{"id":267634480,"uuid":"901764069","full_name":"rspack-contrib/rsbuild-plugin-publint","owner":"rspack-contrib","description":"Run `publint` to lint npm packages after the build.","archived":false,"fork":false,"pushed_at":"2025-04-01T03:19:12.000Z","size":47,"stargazers_count":14,"open_issues_count":1,"forks_count":2,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-15T12:45:28.739Z","etag":null,"topics":["npm","rsbuild","rsbuild-plugin","rslib","rspack"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rspack-contrib.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-11T09:17:31.000Z","updated_at":"2025-04-01T03:19:14.000Z","dependencies_parsed_at":"2024-12-11T14:40:28.599Z","dependency_job_id":"eb5d769b-e600-46ac-90d2-b7a98fb1b403","html_url":"https://github.com/rspack-contrib/rsbuild-plugin-publint","commit_stats":null,"previous_names":["rspack-contrib/rsbuild-plugin-publint"],"tags_count":5,"template":false,"template_full_name":"rspack-contrib/rsbuild-plugin-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rspack-contrib%2Frsbuild-plugin-publint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rspack-contrib%2Frsbuild-plugin-publint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rspack-contrib%2Frsbuild-plugin-publint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rspack-contrib%2Frsbuild-plugin-publint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rspack-contrib","download_url":"https://codeload.github.com/rspack-contrib/rsbuild-plugin-publint/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250318292,"owners_count":21410908,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["npm","rsbuild","rsbuild-plugin","rslib","rspack"],"created_at":"2024-12-13T22:00:39.539Z","updated_at":"2025-04-22T20:29:21.478Z","avatar_url":"https://github.com/rspack-contrib.png","language":"TypeScript","funding_links":[],"categories":["Plugins"],"sub_categories":["Rsbuild Plugins"],"readme":"# rsbuild-plugin-publint\n\nRun [publint](https://github.com/bluwy/publint) to lint npm packages after the build.\n\n\u003cp\u003e\n  \u003ca href=\"https://npmjs.com/package/rsbuild-plugin-publint\"\u003e\n   \u003cimg src=\"https://img.shields.io/npm/v/rsbuild-plugin-publint?style=flat-square\u0026colorA=564341\u0026colorB=EDED91\" alt=\"npm version\" /\u003e\n  \u003c/a\u003e\n  \u003cimg src=\"https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square\u0026colorA=564341\u0026colorB=EDED91\" alt=\"license\" /\u003e\n  \u003ca href=\"https://npmcharts.com/compare/rsbuild-plugin-publint?minimal=true\"\u003e\u003cimg src=\"https://img.shields.io/npm/dm/rsbuild-plugin-publint.svg?style=flat-square\u0026colorA=564341\u0026colorB=EDED91\" alt=\"downloads\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## Preview\n\n`rsbuild-plugin-publint` is the perfect partner for [Rslib](https://github.com/web-infra-dev/rslib). When building a library, publint helps you to lint the npm package and give suggestions to improve its compatibility with different environments.\n\n![Preview](https://github.com/user-attachments/assets/bb6940df-ab15-4155-bdf5-03b7bae5458f)\n\n## Usage\n\nInstall:\n\n```bash\nnpm add rsbuild-plugin-publint -D\n```\n\nAdd plugin to your `rslib.config.ts` or `rsbuild.config.ts`:\n\n```ts\nimport { pluginPublint } from \"rsbuild-plugin-publint\";\n\nexport default {\n  plugins: [pluginPublint()],\n};\n```\n\n## Options\n\n### enable\n\nWhether to enable publint.\n\n- Type: `boolean`\n- Default: `true`\n\nFor example, only run publint in the CI environment:\n\n```ts\npluginPublint({\n  enable: Boolean(process.env.CI),\n});\n```\n\n### publintOptions\n\nOptions for publint. See [publint - API](https://github.com/bluwy/publint/blob/master/pkg/README.md#api) for more details.\n\n- Type: `import('publint').Options`\n- Default:\n\n```js\nconst defaultOptions = {\n  pkgDir: api.context.rootPath,\n};\n```\n\n- Example:\n\n```js\npluginPublint({\n  publintOptions: {\n    level: \"error\",\n  },\n});\n```\n\n### throwOn\n\nSpecify when to throw an error based on message severity.\n\n- Type: `'error' | 'warning' | 'suggestion' | 'never'`\n- Default: `'error'`\n- Example:\n\n```ts\npluginPublint({\n  throwOn: \"warning\",\n});\n```\n\nOptional values:\n\n- `'error'`: Only throw on errors.\n- `'warning'`: Throw on errors and warnings.\n- `'suggestion'`: Throw on errors, warnings and suggestions.\n- `'never'`: Never throw an error.\n\n## License\n\n[MIT](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frspack-contrib%2Frsbuild-plugin-publint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frspack-contrib%2Frsbuild-plugin-publint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frspack-contrib%2Frsbuild-plugin-publint/lists"}