{"id":12231512,"url":"https://github.com/rspack-contrib/rsbuild-plugin-eslint","last_synced_at":"2025-04-14T10:20:48.755Z","repository":{"id":247253505,"uuid":"824191309","full_name":"rspack-contrib/rsbuild-plugin-eslint","owner":"rspack-contrib","description":"An Rsbuild plugin to run ESLint checks during the compilation.","archived":false,"fork":false,"pushed_at":"2025-03-13T13:27:47.000Z","size":163,"stargazers_count":4,"open_issues_count":2,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-27T23:33:01.711Z","etag":null,"topics":["rsbuild","rsbuild-plugin","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-07-04T14:48:14.000Z","updated_at":"2025-03-13T13:27:49.000Z","dependencies_parsed_at":"2024-12-11T02:11:46.912Z","dependency_job_id":"6df40bfe-2991-479f-9cdb-9c9189a4e0b8","html_url":"https://github.com/rspack-contrib/rsbuild-plugin-eslint","commit_stats":null,"previous_names":["rspack-contrib/rsbuild-plugin-eslint"],"tags_count":6,"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-eslint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rspack-contrib%2Frsbuild-plugin-eslint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rspack-contrib%2Frsbuild-plugin-eslint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rspack-contrib%2Frsbuild-plugin-eslint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rspack-contrib","download_url":"https://codeload.github.com/rspack-contrib/rsbuild-plugin-eslint/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248860005,"owners_count":21173343,"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":["rsbuild","rsbuild-plugin","rspack"],"created_at":"2024-07-07T17:03:58.447Z","updated_at":"2025-04-14T10:20:48.748Z","avatar_url":"https://github.com/rspack-contrib.png","language":"TypeScript","funding_links":[],"categories":["Plugins"],"sub_categories":["Rsbuild Plugins"],"readme":"# @rsbuild/plugin-eslint\n\nAn Rsbuild plugin to run ESLint checks during the compilation.\n\nThe plugin has integrated [eslint-rspack-plugin](https://www.npmjs.com/package/eslint-rspack-plugin) internally.\n\n\u003e We do not recommend using the `@rsbuild/plugin-eslint` plugin, as running ESLint during the build process will significantly increase the build time. Instead, we recommend using a separate `lint` command to run ESLint checks.\n\n\u003cp\u003e\n  \u003ca href=\"https://npmjs.com/package/@rsbuild/plugin-eslint\"\u003e\n   \u003cimg src=\"https://img.shields.io/npm/v/@rsbuild/plugin-eslint?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-eslint?minimal=true\"\u003e\u003cimg src=\"https://img.shields.io/npm/dm/@rsbuild/plugin-eslint.svg?style=flat-square\u0026colorA=564341\u0026colorB=EDED91\" alt=\"downloads\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cimg width=\"1496\" alt=\"Screenshot 2025-02-16 at 18 56 32\" src=\"https://github.com/user-attachments/assets/ee4b1915-92ce-4032-834d-b2321f02f1d2\" /\u003e\n\n## Usage\n\nInstall:\n\n```bash\nnpm add @rsbuild/plugin-eslint -D\n```\n\nAdd plugin to your `rsbuild.config.ts`:\n\n```ts\n// rsbuild.config.ts\nimport { pluginEslint } from \"@rsbuild/plugin-eslint\";\n\nexport default {\n  plugins: [pluginEslint()],\n};\n```\n\n## Example Projects\n\n- [React + ESLint project](https://github.com/rspack-contrib/rspack-examples/tree/main/rsbuild/react-eslint)\n- [Vue 3 + ESLint project](https://github.com/rspack-contrib/rspack-examples/tree/main/rsbuild/vue3-eslint)\n\n## Options\n\n### enable\n\nWhether to enable ESLint checking.\n\n- **Type:** `boolean`\n- **Default:** `true`\n- **Example:**\n\nDisable ESLint checking:\n\n```js\npluginEslint({\n  enable: false,\n});\n```\n\nEnable ESLint checking only during production builds:\n\n```js\npluginEslint({\n  enable: process.env.NODE_ENV === \"production\",\n});\n```\n\nEnable ESLint checking only during development builds:\n\n```js\npluginEslint({\n  enable: process.env.NODE_ENV === \"development\",\n});\n```\n\n### eslintPluginOptions\n\nTo modify the options of `eslint-rspack-plugin`, please refer to [eslint-rspack-plugin - README](https://github.com/rspack-contrib/eslint-rspack-plugin#readme) to learn about available options.\n\n- **Type:** [Options](https://github.com/rspack-contrib/eslint-rspack-plugin/blob/master/types/options.d.ts)\n- **Default:**\n\n```ts\nconst defaultOptions = {\n  extensions: [\"js\", \"jsx\", \"mjs\", \"cjs\", \"ts\", \"tsx\", \"mts\", \"cts\"],\n  exclude: [\n    \"node_modules\",\n    \"dist\", // -\u003e rsbuildConfig.output.distPath.root\n  ],\n};\n```\n\nThe `eslintPluginOptions` object will be shallowly merged with the default configuration object.\n\n- For example, enable ESLint v9's flat config:\n\n```ts\npluginEslint({\n  eslintPluginOptions: {\n    cwd: __dirname,\n    configType: \"flat\",\n  },\n});\n```\n\n- For example, exclude some files using `exclude`:\n\n```ts\npluginEslint({\n  eslintPluginOptions: {\n    exclude: [\"node_modules\", \"dist\", \"./src/foo.js\"],\n  },\n});\n```\n\n- Extend `extensions` to validate `.vue` or `.svelte` files:\n\n```ts\npluginEslint({\n  eslintPluginOptions: {\n    extensions: [\"js\", \"jsx\", \"mjs\", \"cjs\", \"ts\", \"tsx\", \"mts\", \"cts\", \"vue\"],\n  },\n});\n```\n\n## License\n\n[MIT](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frspack-contrib%2Frsbuild-plugin-eslint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frspack-contrib%2Frsbuild-plugin-eslint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frspack-contrib%2Frsbuild-plugin-eslint/lists"}