{"id":13596325,"url":"https://github.com/webpack-contrib/eslint-webpack-plugin","last_synced_at":"2025-05-14T08:06:46.505Z","repository":{"id":38007738,"uuid":"215780988","full_name":"webpack-contrib/eslint-webpack-plugin","owner":"webpack-contrib","description":"A ESLint plugin for webpack","archived":false,"fork":false,"pushed_at":"2025-04-15T11:51:25.000Z","size":3669,"stargazers_count":260,"open_issues_count":6,"forks_count":49,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-04-30T23:03:36.329Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/webpack-contrib.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"open_collective":"webpack"}},"created_at":"2019-10-17T11:57:21.000Z","updated_at":"2025-04-15T11:51:28.000Z","dependencies_parsed_at":"2024-01-13T12:38:02.821Z","dependency_job_id":"dadec147-34c8-459e-b2c4-2225b29ab269","html_url":"https://github.com/webpack-contrib/eslint-webpack-plugin","commit_stats":{"total_commits":144,"total_committers":22,"mean_commits":6.545454545454546,"dds":"0.48611111111111116","last_synced_commit":"c379e122d365976125988b56b02bd71d09f7eba0"},"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webpack-contrib%2Feslint-webpack-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webpack-contrib%2Feslint-webpack-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webpack-contrib%2Feslint-webpack-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webpack-contrib%2Feslint-webpack-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/webpack-contrib","download_url":"https://codeload.github.com/webpack-contrib/eslint-webpack-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253229744,"owners_count":21874987,"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":[],"created_at":"2024-08-01T16:02:18.611Z","updated_at":"2025-05-14T08:06:41.489Z","avatar_url":"https://github.com/webpack-contrib.png","language":"JavaScript","readme":"\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://github.com/eslint/eslint\"\u003e\u003cimg width=\"200\" height=\"200\" src=\"https://cdn.worldvectorlogo.com/logos/eslint.svg\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/webpack/webpack\"\u003e\u003cimg width=\"200\" height=\"200\" src=\"https://webpack.js.org/assets/icon-square-big.svg\"\u003e\u003c/a\u003e\n\u003c/div\u003e\n\n[![npm][npm]][npm-url]\n[![node][node]][node-url]\n[![tests][tests]][tests-url]\n[![coverage][cover]][cover-url]\n[![discussion][discussion]][discussion-url]\n[![size][size]][size-url]\n\n# eslint-webpack-plugin\n\n\u003e This version of eslint-webpack-plugin only works with webpack 5. For the webpack 4, see the [2.x branch](https://github.com/webpack-contrib/eslint-webpack-plugin/tree/2.x).\n\nThis plugin uses [`eslint`](https://eslint.org/) to find and fix problems in your JavaScript code\n\n## Getting Started\n\nTo begin, you'll need to install `eslint-webpack-plugin`:\n\n```console\nnpm install eslint-webpack-plugin --save-dev\n```\n\nor\n\n```console\nyarn add -D eslint-webpack-plugin\n```\n\nor\n\n```console\npnpm add -D eslint-webpack-plugin\n```\n\n\u003e [!NOTE]\n\u003e\n\u003e You also need to install `eslint \u003e= 8` from npm, if you haven't already:\n\n```console\nnpm install eslint --save-dev\n```\n\nor\n\n```console\nyarn add -D eslint\n```\n\nor\n\n```console\npnpm add -D eslint\n```\n\nThen add the plugin to your webpack config. For example:\n\n```js\nconst ESLintPlugin = require('eslint-webpack-plugin');\n\nmodule.exports = {\n  // ...\n  plugins: [new ESLintPlugin(options)],\n  // ...\n};\n```\n\n## Options\n\nYou can pass [eslint options](https://eslint.org/docs/developer-guide/nodejs-api#-new-eslintoptions).\n\n\u003e [!NOTE]\n\u003e\n\u003e The config option you provide will be passed to the `ESLint` class.\n\u003e This is a different set of options than what you'd specify in `package.json` or `.eslintrc`.\n\u003e See the [eslint docs](https://eslint.org/docs/developer-guide/nodejs-api#-new-eslintoptions) for more details.\n\n\u003e [!WARNING]\n\u003e\n\u003e In eslint-webpack-plugin version 1 the options were passed to the now deprecated [CLIEngine](https://eslint.org/docs/developer-guide/nodejs-api#cliengine).\n\n### `cache`\n\n- Type:\n\n```ts\ntype cache = boolean;\n```\n\n- Default: `true`\n\nThe cache is enabled by default to decrease execution time.\n\n### `cacheLocation`\n\n- Type:\n\n```ts\ntype cacheLocation = string;\n```\n\n- Default: `node_modules/.cache/eslint-webpack-plugin/.eslintcache`\n\nSpecify the path to the cache location. Can be a file or a directory.\n\n### `configType`\n\n- Type:\n\n```ts\ntype configType = 'flat' | 'eslintrc';\n```\n\n- Default: `flat`\n\nSpecify the type of configuration to use with ESLint.\n\n- `eslintrc` is the classic configuration format available in most ESLint versions.\n- `flat` is the new format introduced in ESLint 8.21.0.\n\nThe new configuration format is explained in its [own documentation](https://eslint.org/docs/latest/use/configure/configuration-files-new).\n\n### `context`\n\n- Type:\n\n```ts\ntype context = string;\n```\n\n- Default: `compiler.context`\n\nA string indicating the root of your files.\n\n### `eslintPath`\n\n- Type:\n\n```ts\ntype eslintPath = string;\n```\n\n- Default: `eslint`\n\nPath to `eslint` instance that will be used for linting. If the `eslintPath` is a folder like a official eslint, or specify a `formatter` option. now you don't have to install `eslint`.\n\n### `extensions`\n\n- Type:\n\n```ts\ntype extensions = string | Array\u003cstring\u003e;\n```\n\n- Default: `'js'`\n\nSpecify extensions that should be checked.\n\n### `exclude`\n\n- Type:\n\n```ts\ntype exclude = string | Array\u003cstring\u003e;\n```\n\n- Default: `'node_modules'`\n\nSpecify the files and/or directories to exclude. Must be relative to `options.context`.\n\n### `resourceQueryExclude`\n\n- Type:\n\n```ts\ntype resourceQueryExclude = RegExp | Array\u003cRegExp\u003e;\n```\n\n- Default: `[]`\n\nSpecify the resource query to exclude.\n\n### `files`\n\n- Type:\n\n```ts\ntype files = string | Array\u003cstring\u003e;\n```\n\n- Default: `null`\n\nSpecify directories, files, or globs. Must be relative to `options.context`.\nDirectories are traversed recursively looking for files matching `options.extensions`.\nFile and glob patterns ignore `options.extensions`.\n\n### `fix`\n\n- Type:\n\n```ts\ntype fix = boolean;\n```\n\n- Default: `false`\n\nWill enable [ESLint autofix feature](https://eslint.org/docs/developer-guide/nodejs-api#-eslintoutputfixesresults).\n\n**Be careful: this option will change source files.**\n\n### `formatter`\n\n- Type:\n\n```ts\ntype formatter = string| (\n  results:  Array\u003cimport('eslint').ESLint.LintResult\u003e,\n  data?: import('eslint').ESLint.LintResultData | undefined\n) =\u003e string\n```\n\n- Default: `'stylish'`\n\nAccepts a function that will have one argument: an array of eslint messages (object). The function must return the output as a string. You can use official [eslint formatters](https://eslint.org/docs/user-guide/formatters/).\n\n### `lintDirtyModulesOnly`\n\n- Type:\n\n```ts\ntype lintDirtyModulesOnly = boolean;\n```\n\n- Default: `false`\n\nLint only changed files, skip lint on start.\n\n### `threads`\n\n- Type:\n\n```ts\ntype threads = boolean | number;\n```\n\n- Default: `false`\n\nWill run lint tasks across a thread pool. The pool size is automatic unless you specify a number.\n\n### Errors and Warning\n\n**By default the plugin will auto adjust error reporting depending on eslint errors/warnings counts.**\nYou can still force this behavior by using `emitError` **or** `emitWarning` options:\n\n#### `emitError`\n\n- Type:\n\n```ts\ntype emitError = boolean;\n```\n\n- Default: `true`\n\nThe errors found will always be emitted, to disable set to `false`.\n\n#### `emitWarning`\n\n- Type:\n\n```ts\ntype emitWarning = boolean;\n```\n\n- Default: `true`\n\nThe warnings found will always be emitted, to disable set to `false`.\n\n#### `failOnError`\n\n- Type:\n\n```ts\ntype failOnError = boolean;\n```\n\n- Default: `true`\n\nWill cause the module build to fail if there are any errors, to disable set to `false`.\n\n#### `failOnWarning`\n\n- Type:\n\n```ts\ntype failOnWarning = boolean;\n```\n\n- Default: `false`\n\nWill cause the module build to fail if there are any warnings, if set to `true`.\n\n#### `quiet`\n\n- Type:\n\n```ts\ntype quiet = boolean;\n```\n\n- Default: `false`\n\nWill process and report errors only and ignore warnings, if set to `true`.\n\n#### `outputReport`\n\n- Type:\n\n```ts\ntype outputReport =\n  | boolean\n  | {\n      filePath?: string | undefined;\n      formatter?:\n        | (\n            | string\n            | ((\n                results: Array\u003cimport('eslint').ESLint.LintResult\u003e,\n                data?: import('eslint').ESLint.LintResultData | undefined,\n              ) =\u003e string)\n          )\n        | undefined;\n    };\n```\n\n- Default: `false`\n\nWrite the output of the errors to a file, for example a checkstyle xml file for use for reporting on Jenkins CI.\n\nThe `filePath` is an absolute path or relative to the webpack config: `output.path`.\nYou can pass in a different `formatter` for the output file,\nif none is passed in the default/configured formatter will be used.\n\n## Changelog\n\n[Changelog](CHANGELOG.md)\n\n## License\n\n[MIT](./LICENSE)\n\n[npm]: https://img.shields.io/npm/v/eslint-webpack-plugin.svg\n[npm-url]: https://npmjs.com/package/eslint-webpack-plugin\n[node]: https://img.shields.io/node/v/eslint-webpack-plugin.svg\n[node-url]: https://nodejs.org\n[tests]: https://github.com/webpack-contrib/eslint-webpack-plugin/workflows/eslint-webpack-plugin/badge.svg\n[tests-url]: https://github.com/webpack-contrib/eslint-webpack-plugin/actions\n[cover]: https://codecov.io/gh/webpack-contrib/eslint-webpack-plugin/branch/master/graph/badge.svg\n[cover-url]: https://codecov.io/gh/webpack-contrib/eslint-webpack-plugin\n[discussion]: https://img.shields.io/github/discussions/webpack/webpack\n[discussion-url]: https://github.com/webpack/webpack/discussions\n[size]: https://packagephobia.now.sh/badge?p=eslint-webpack-plugin\n[size-url]: https://packagephobia.now.sh/result?p=eslint-webpack-plugin\n","funding_links":["https://opencollective.com/webpack"],"categories":["Plugins","JavaScript"],"sub_categories":["Rspack Plugins"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebpack-contrib%2Feslint-webpack-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebpack-contrib%2Feslint-webpack-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebpack-contrib%2Feslint-webpack-plugin/lists"}