[
  {
    "path": ".cspell.json",
    "content": "{\n  \"version\": \"0.2\",\n  \"language\": \"en,en-gb\",\n  \"words\": [\n    \"arrify\",\n    \"notjs\",\n    \"nonfixable\",\n    \"dasdas\",\n    \"badeslintrc\",\n    \"autofix\",\n    \"autofixing\",\n    \"checkstyle\",\n    \"commitlint\",\n    \"indentifiers\"\n  ],\n\n  \"ignorePaths\": [\n    \"CHANGELOG.md\",\n    \"package.json\",\n    \"coverage\",\n    \"/test/outputs\",\n    \"dist/**\",\n    \"**/__snapshots__/**\",\n    \"package-lock.json\",\n    \"node_modules\",\n    \"coverage\",\n    \"*.log\"\n  ]\n}\n"
  },
  {
    "path": ".editorconfig",
    "content": "# editorconfig.org\n\n[*]\ncharset = utf-8\nindent_style = space\nindent_size = 2\nend_of_line = lf\ninsert_final_newline = true\ntrim_trailing_whitespace = true\n\n[*.md]\ntrim_trailing_whitespace = false\n"
  },
  {
    "path": ".gitattributes",
    "content": "* text=auto\nbin/* eol=lf\npackage-lock.json -diff\nyarn.lock -diff\n"
  },
  {
    "path": ".github/workflows/dependency-review.yml",
    "content": "name: \"Dependency Review\"\non: [pull_request]\n\npermissions:\n  contents: read\n\njobs:\n  dependency-review:\n    runs-on: ubuntu-latest\n    steps:\n      - name: \"Checkout Repository\"\n        uses: actions/checkout@v6\n      - name: \"Dependency Review\"\n        uses: actions/dependency-review-action@v4\n"
  },
  {
    "path": ".github/workflows/nodejs.yml",
    "content": "name: eslint-webpack-plugin\n\non:\n  push:\n    branches:\n      - main\n      - next\n  pull_request:\n    branches:\n      - main\n      - next\n\npermissions:\n  contents: read\n\njobs:\n  lint:\n    name: Lint - ${{ matrix.os }} - Node v${{ matrix.node-version }}\n\n    env:\n      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n\n    strategy:\n      matrix:\n        os: [ubuntu-latest]\n        node-version: [lts/*]\n\n    runs-on: ${{ matrix.os }}\n\n    concurrency:\n      group: lint-${{ matrix.os }}-v${{ matrix.node-version }}-${{ github.ref }}\n      cancel-in-progress: true\n\n    steps:\n      - uses: actions/checkout@v6\n        with:\n          fetch-depth: 0\n\n      - name: Use Node.js ${{ matrix.node-version }}\n        uses: actions/setup-node@v6\n        with:\n          node-version: ${{ matrix.node-version }}\n\n      - name: Install dependencies\n        run: npm ci\n\n      - name: Lint\n        run: npm run lint\n\n      - name: Security audit\n        run: npm run security\n\n      - name: Validate PR commits with commitlint\n        if: github.event_name == 'pull_request'\n        run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose\n\n  test:\n    name: Test - ${{ matrix.os }} - Node v${{ matrix.node-version }}, Webpack ${{ matrix.webpack-version }}, Eslint ${{ matrix.eslint-version }}\n\n    strategy:\n      matrix:\n        os: [ubuntu-latest, windows-latest, macos-latest]\n        node-version: [20.x, 22.x, 24.x]\n        eslint-version: [9.x, 10.x]\n        webpack-version: [latest]\n\n    runs-on: ${{ matrix.os }}\n\n    concurrency:\n      group: test-${{ matrix.os }}-v${{ matrix.node-version }}-${{ matrix.eslint-version }}-${{ matrix.webpack-version }}-${{ github.ref }}\n      cancel-in-progress: true\n\n    steps:\n      - uses: actions/checkout@v6\n\n      - name: Use Node.js ${{ matrix.node-version }}\n        uses: actions/setup-node@v6\n        with:\n          node-version: ${{ matrix.node-version }}\n          cache: \"npm\"\n\n      - name: Install dependencies\n        run: npm ci\n\n      - name: Install webpack ${{ matrix.webpack-version }}\n        run: npm i webpack@${{ matrix.webpack-version }}\n\n      - name: Install eslint ${{ matrix.eslint-version }}\n        run: npm i eslint@${{ matrix.eslint-version }}\n\n      - name: Run tests for webpack version ${{ matrix.webpack-version }}\n        run: npm run test:coverage -- --ci\n\n      - name: Submit coverage data to codecov\n        uses: codecov/codecov-action@v6\n        with:\n          token: ${{ secrets.CODECOV_TOKEN }}\n"
  },
  {
    "path": ".gitignore",
    "content": "logs\n*.log\nnpm-debug.log*\nyarn-debug.log*\n.eslintcache\n\n/coverage\n/dist\n/local\n/reports\n/node_modules\n/test/outputs\n\n.DS_Store\nThumbs.db\n.idea\n.vscode\n*.sublime-project\n*.sublime-workspace\n*.iml\n"
  },
  {
    "path": ".prettierignore",
    "content": "/coverage\n/dist\n/node_modules\n/test/fixtures\n/test/outputs\nCHANGELOG.md\n"
  },
  {
    "path": "CHANGELOG.md",
    "content": "# Changelog\n\nAll notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.\n\n## [6.0.0](https://github.com/webpack/eslint-webpack-plugin/compare/v5.0.3...v6.0.0) (2026-04-03)\n\n\n### ⚠ BREAKING CHANGES\n\n* remove threads option (#299)\n* use `compiler.options.mode` to set the default value of `failOnError` (#296)\n* add support for ESLint v10 and remove support for ESLint v8 and Node.js v18 (#295)\n\n### Features\n\n* add support for ESLint v10 and remove support for ESLint v8 and Node.js v18 ([#295](https://github.com/webpack/eslint-webpack-plugin/issues/295)) ([42de4fe](https://github.com/webpack/eslint-webpack-plugin/commit/42de4fefc67d0d3983a14c73a70d93f497735e73))\n\n\n### Bug Fixes\n\n* do not store errors, errors from files not included should not be reported ([#298](https://github.com/webpack/eslint-webpack-plugin/issues/298)) ([a4400b2](https://github.com/webpack/eslint-webpack-plugin/commit/a4400b2396b179bb8b15ee2a1b159a106d7c962a))\n* use `compiler.options.mode` to set the default value of `failOnError` ([#296](https://github.com/webpack/eslint-webpack-plugin/issues/296)) ([def99b0](https://github.com/webpack/eslint-webpack-plugin/commit/def99b0c1d72c8d6b70361f0b2215ff2dc3ead59))\n\n\n* remove threads option ([#299](https://github.com/webpack/eslint-webpack-plugin/issues/299)) ([a53360e](https://github.com/webpack/eslint-webpack-plugin/commit/a53360e1291ea08307d21efa7102d6a7c9725f42))\n\n### [5.0.3](https://github.com/webpack/eslint-webpack-plugin/compare/v5.0.2...v5.0.3) (2026-02-27)\n\n\n### Bug Fixes\n\n* display errors and warnings ([#297](https://github.com/webpack/eslint-webpack-plugin/issues/297)) ([d099b5d](https://github.com/webpack/eslint-webpack-plugin/commit/d099b5dd504ce074ed481eff37c1ebec4f3ec288))\n\n### [5.0.2](https://github.com/webpack-contrib/eslint-webpack-plugin/compare/v5.0.1...v5.0.2) (2025-06-09)\n\n\n### Bug Fixes\n\n* don't error on circular eslint plugins ([#277](https://github.com/webpack-contrib/eslint-webpack-plugin/issues/277)) ([32f05c6](https://github.com/webpack-contrib/eslint-webpack-plugin/commit/32f05c6fdd70ec5532682ce5ed134998a269cdf3))\n\n### [5.0.1](https://github.com/webpack-contrib/eslint-webpack-plugin/compare/v5.0.0...v5.0.1) (2025-04-15)\n\n\n### Bug Fixes\n\n* fail on error and fail on warning ([#275](https://github.com/webpack-contrib/eslint-webpack-plugin/issues/275)) ([4ef97cd](https://github.com/webpack-contrib/eslint-webpack-plugin/commit/4ef97cd46b5ced43d5a68444bce2d392ddd28166))\n\n## [5.0.0](https://github.com/webpack-contrib/eslint-webpack-plugin/compare/v4.2.0...v5.0.0) (2025-02-26)\n\n\n### ⚠ BREAKING CHANGES\n\n* Use flat config by default\n* Minimum supported Node.js version is 18.12.0\n\n## [4.2.0](https://github.com/webpack-contrib/eslint-webpack-plugin/compare/v4.1.0...v4.2.0) (2024-05-24)\n\n\n### Features\n\n* support eslint 9 ([#250](https://github.com/webpack-contrib/eslint-webpack-plugin/issues/250)) ([d25e94c](https://github.com/webpack-contrib/eslint-webpack-plugin/commit/d25e94c90b477d465bf4d7fb6450a9b4ed6936f4))\n\n\n### Bug Fixes\n\n* use `stillValidModule` only `lintDirtyModulesOnly` is disabled ([#253](https://github.com/webpack-contrib/eslint-webpack-plugin/issues/253)) ([b52d1e7](https://github.com/webpack-contrib/eslint-webpack-plugin/commit/b52d1e743e77e657256919ca7b0cdb1d432a1fb9))\n\n## [4.1.0](https://github.com/webpack-contrib/eslint-webpack-plugin/compare/v4.0.0...v4.1.0) (2024-03-14)\n\n\n### Features\n\n* support flat config ([#238](https://github.com/webpack-contrib/eslint-webpack-plugin/issues/238)) ([19cadbe](https://github.com/webpack-contrib/eslint-webpack-plugin/commit/19cadbe3117fa7899eba2424d7bb07bc403160c5))\n\n### [4.0.1](https://github.com/webpack-contrib/eslint-webpack-plugin/compare/v4.0.0...v4.0.1) (2023-04-10)\n\n\n### Performance\n\n* enable `cache` by default ([#213](https://github.com/webpack-contrib/eslint-webpack-plugin/issues/213))\n\n## [4.0.0](https://github.com/webpack-contrib/eslint-webpack-plugin/compare/v3.2.0...v4.0.0) (2023-02-03)\n\n\n### ⚠ BREAKING CHANGES\n\n* drop node v12 and eslint v7 (#159)\n\n### Bug Fixes\n\n* lint modules that are cached with webpack's filesystem cache ([#197](https://github.com/webpack-contrib/eslint-webpack-plugin/issues/197)) ([92f25ec](https://github.com/webpack-contrib/eslint-webpack-plugin/commit/92f25ecf5f92d72bab4c80dac363a1c632e3500f)), closes [#130](https://github.com/webpack-contrib/eslint-webpack-plugin/issues/130)\n\n\n* drop node v12 and eslint v7 ([#159](https://github.com/webpack-contrib/eslint-webpack-plugin/issues/159)) ([1edd3c1](https://github.com/webpack-contrib/eslint-webpack-plugin/commit/1edd3c1ab63ba864768d812401ce500318548e2d))\n\n## [3.2.0](https://github.com/webpack-contrib/eslint-webpack-plugin/compare/v3.1.1...v3.2.0) (2022-06-23)\n\n\n### Features\n\n* add eslint prefix to CLI output for better debugging ([#155](https://github.com/webpack-contrib/eslint-webpack-plugin/issues/155)) ([67efb34](https://github.com/webpack-contrib/eslint-webpack-plugin/commit/67efb34fc2ad11dcd6593fce21059aea271dcfc7))\n* removed cjs wrapper ([#152](https://github.com/webpack-contrib/eslint-webpack-plugin/issues/152)) ([125becf](https://github.com/webpack-contrib/eslint-webpack-plugin/commit/125becfaad348042b732d074b346bb3243dd7fa4))\n* support resourceQueryExclude option ([#165](https://github.com/webpack-contrib/eslint-webpack-plugin/issues/165)) ([464120f](https://github.com/webpack-contrib/eslint-webpack-plugin/commit/464120fa74f0f0ccca98322ef43a4c057528a964))\n\n### [3.1.1](https://github.com/webpack-contrib/eslint-webpack-plugin/compare/v3.1.0...v3.1.1) (2021-11-11)\n\n\n### Bug Fixes\n\n* child compiler lint ([#127](https://github.com/webpack-contrib/eslint-webpack-plugin/issues/127)) ([18d5f23](https://github.com/webpack-contrib/eslint-webpack-plugin/commit/18d5f23ecefd1a242f62722e8487ef2bcc39bc8c))\n\n## [3.1.0](https://github.com/webpack-contrib/eslint-webpack-plugin/compare/v3.0.1...v3.1.0) (2021-10-27)\n\n\n### Features\n\n* support eslint 8 ([#121](https://github.com/webpack-contrib/eslint-webpack-plugin/issues/121)) ([caeb2dd](https://github.com/webpack-contrib/eslint-webpack-plugin/commit/caeb2dd198ea4261091650e62cb30d2a54530f1d))\n\n### [3.0.1](https://github.com/webpack-contrib/eslint-webpack-plugin/compare/v3.0.0...v3.0.1) (2021-07-20)\n\n\n### Bug Fixes\n\n* crash with `ERR_REQUIRE_ESM` error ([26b4db3](https://github.com/webpack-contrib/eslint-webpack-plugin/commit/26b4db37f1b39d597c26fbab52374425e2c455ac))\n\n## [3.0.0](https://github.com/webpack-contrib/eslint-webpack-plugin/compare/v2.5.4...v3.0.0) (2021-07-19)\n\n\n### ⚠ BREAKING CHANGES\n\n* webpack v4 and nodejs v10 dropped (#105)\n\n* webpack v4 and nodejs v10 dropped ([#105](https://github.com/webpack-contrib/eslint-webpack-plugin/issues/105)) ([594d84c](https://github.com/webpack-contrib/eslint-webpack-plugin/commit/594d84cc800057f889b23a27e9bc31e2eb5e32f1))\n\n### [2.5.4](https://github.com/webpack-contrib/eslint-webpack-plugin/compare/v2.5.3...v2.5.4) (2021-04-19)\n\n\n### Bug Fixes\n\n* context with symbols ([#94](https://github.com/webpack-contrib/eslint-webpack-plugin/issues/94)) ([6fc6874](https://github.com/webpack-contrib/eslint-webpack-plugin/commit/6fc6874f4ee295eea372dcfa0a86799b355dab70))\n* resolve paths and normalize ([#97](https://github.com/webpack-contrib/eslint-webpack-plugin/issues/97)) ([818b825](https://github.com/webpack-contrib/eslint-webpack-plugin/commit/818b825db119dde0b53b24d96688f1af89344b29))\n* use `finishModules` if thread is less than or equal 1 ([#95](https://github.com/webpack-contrib/eslint-webpack-plugin/issues/95)) ([c12e7be](https://github.com/webpack-contrib/eslint-webpack-plugin/commit/c12e7be0be49f95fa8f2d9ae354acba3bd412b5c))\n\n### [2.5.3](https://github.com/webpack-contrib/eslint-webpack-plugin/compare/v2.5.2...v2.5.3) (2021-03-24)\n\n\n### Bug Fixes\n\n* allow multiple instances ([#92](https://github.com/webpack-contrib/eslint-webpack-plugin/issues/92)) ([0cdd621](https://github.com/webpack-contrib/eslint-webpack-plugin/commit/0cdd621be597c643cad6c4a41c7fed31c29fb1a5))\n* match hidden directories for path exclusions ([#87](https://github.com/webpack-contrib/eslint-webpack-plugin/issues/87)) ([bb8750c](https://github.com/webpack-contrib/eslint-webpack-plugin/commit/bb8750cb8a1cb4f6297a07b579ad4e394e11d968))\n\n### [2.5.2](https://github.com/webpack-contrib/eslint-webpack-plugin/compare/v2.5.1...v2.5.2) (2021-02-18)\n\n\n### Bug Fixes\n\n* **fail-on-error:** show eslint errors when failOnError is disabled ([#85](https://github.com/webpack-contrib/eslint-webpack-plugin/issues/85)) ([69be533](https://github.com/webpack-contrib/eslint-webpack-plugin/commit/69be5338a8f72ffdbee055ab926cf4d84047fd35))\n\n### [2.5.1](https://github.com/webpack-contrib/eslint-webpack-plugin/compare/v2.5.0...v2.5.1) (2021-02-12)\n\n\n### Bug Fixes\n\n* exclude node_modules root ([#80](https://github.com/webpack-contrib/eslint-webpack-plugin/issues/80)) ([be0391e](https://github.com/webpack-contrib/eslint-webpack-plugin/commit/be0391e28322e220cf628f842f35b3d800c284c0))\n* prevent lint all files ([#77](https://github.com/webpack-contrib/eslint-webpack-plugin/issues/77)) ([f57cb8e](https://github.com/webpack-contrib/eslint-webpack-plugin/commit/f57cb8e1f01c522e562f0af3460d900d7fbba94f))\n* update types ([#81](https://github.com/webpack-contrib/eslint-webpack-plugin/issues/81)) ([90608da](https://github.com/webpack-contrib/eslint-webpack-plugin/commit/90608da93f13ae2de70c2696d4284c1558a3f301))\n\n## [2.5.0](https://github.com/webpack-contrib/eslint-webpack-plugin/compare/v2.4.3...v2.5.0) (2021-02-04)\n\n\n### Refactor\n\n* Updates to emitError and emitWarning\n\nSetting only emitError to true will no longer exclusively print files with errors\nand disregard the files with warnings. Similarly, setting only emitWarning to true\nwill no longer exclusively print files with warnings disregard the files with errors.\n\n* fix: use quiet to override emitError and emitWarning\n\n- quiet is essentially syntactic sugar for setting emitError to true\nand emitWarning to false\n\n### Bug Fixes\n\n* fails when `failOnError` or `failOnWarning` enabled ([#72](https://github.com/webpack-contrib/eslint-webpack-plugin/issues/72)) ([8a72a8a](https://github.com/webpack-contrib/eslint-webpack-plugin/commit/8a72a8ad26b8decb800f955d8f4d362f280c4d0f))\n* lint dirty modules only ([#67](https://github.com/webpack-contrib/eslint-webpack-plugin/issues/67)) ([f7f372e](https://github.com/webpack-contrib/eslint-webpack-plugin/commit/f7f372e800e75fcd2928655648fee01266c6d158))\n* threads multi-compiler ([#69](https://github.com/webpack-contrib/eslint-webpack-plugin/issues/69)) ([cef4f74](https://github.com/webpack-contrib/eslint-webpack-plugin/commit/cef4f7473707fb3f069ec44c54b5ed2d27d931f8))\n* types ([#66](https://github.com/webpack-contrib/eslint-webpack-plugin/issues/66)) ([4daddf5](https://github.com/webpack-contrib/eslint-webpack-plugin/commit/4daddf5335b2c78203482d7e7f6d82a909277212))\n* Fix emit warning error quiet (#46) ([d38165b](https://github.com/webpack-contrib/eslint-webpack-plugin/commit/d38165bef1e2d73a9d53f42d80b926c9eab12707)), closes [#46](https://github.com/webpack-contrib/eslint-webpack-plugin/issues/46) [#19](https://github.com/webpack-contrib/eslint-webpack-plugin/issues/19) [#19](https://github.com/webpack-contrib/eslint-webpack-plugin/issues/19)\n\n### [2.4.3](https://github.com/webpack-contrib/eslint-webpack-plugin/compare/v2.4.2...v2.4.3) (2021-01-19)\n\n\n### Bug Fixes\n\n* crash on `split` ([#62](https://github.com/webpack-contrib/eslint-webpack-plugin/issues/62)) ([db38f61](https://github.com/webpack-contrib/eslint-webpack-plugin/commit/db38f611965cfdec83984364e0b982bbd7a678e0))\n\n### [2.4.2](https://github.com/webpack-contrib/eslint-webpack-plugin/compare/v2.4.1...v2.4.2) (2021-01-19)\n\n\n### Bug Fixes\n\n* strip resource query ([#58](https://github.com/webpack-contrib/eslint-webpack-plugin/issues/58)) ([f0a2d81](https://github.com/webpack-contrib/eslint-webpack-plugin/commit/f0a2d81a4feecf87e13649f2930f773c04fa3814))\n\n### [2.4.1](https://github.com/webpack-contrib/eslint-webpack-plugin/compare/v2.4.0...v2.4.1) (2020-11-30)\n\n\n### Bug Fixes\n\n* [#43](https://github.com/webpack-contrib/eslint-webpack-plugin/issues/43), [#44](https://github.com/webpack-contrib/eslint-webpack-plugin/issues/44), [#45](https://github.com/webpack-contrib/eslint-webpack-plugin/issues/45) ([#47](https://github.com/webpack-contrib/eslint-webpack-plugin/issues/47)) ([4b8d4de](https://github.com/webpack-contrib/eslint-webpack-plugin/commit/4b8d4def970381126f70c8407eb708c1c975bbf5))\n* recompile speedups ([#55](https://github.com/webpack-contrib/eslint-webpack-plugin/issues/55)) ([d862d92](https://github.com/webpack-contrib/eslint-webpack-plugin/commit/d862d9291853c6b7430a0dbdc965b16db0723925))\n\n## [2.4.0](https://github.com/webpack-contrib/eslint-webpack-plugin/compare/v2.3.0...v2.4.0) (2020-11-20)\n\n\n### Features\n\n* threads ([#39](https://github.com/webpack-contrib/eslint-webpack-plugin/issues/39)) ([1e38fc7](https://github.com/webpack-contrib/eslint-webpack-plugin/commit/1e38fc77fd575d9e56be0da6a206ded54a8f7c34))\n\n## [2.3.0](https://github.com/webpack-contrib/eslint-webpack-plugin/compare/v2.2.1...v2.3.0) (2020-11-13)\n\n\n### Features\n\n* exclude option ([#41](https://github.com/webpack-contrib/eslint-webpack-plugin/issues/41)) ([dc2fac7](https://github.com/webpack-contrib/eslint-webpack-plugin/commit/dc2fac7918c0733f26fa5a1683315bf439370559))\n\n### [2.2.1](https://github.com/webpack-contrib/eslint-webpack-plugin/compare/v2.2.0...v2.2.1) (2020-11-07)\n\n\n### Bug Fixes\n\n* folder pattern ([#36](https://github.com/webpack-contrib/eslint-webpack-plugin/issues/36)) ([e79741e](https://github.com/webpack-contrib/eslint-webpack-plugin/commit/e79741ee22d04c8c6e4d6f11d6869434ed5b339d))\n\n## [2.2.0](https://github.com/webpack-contrib/eslint-webpack-plugin/compare/v1.0.0...v2.2.0) (2020-11-04)\n\n\n### Features\n\n* feat: only use the import graph, update tests ([#28](https://github.com/webpack-contrib/eslint-webpack-plugin/pull/28)) ([47612f16](https://github.com/webpack-contrib/eslint-webpack-plugin/commit/47612f16894f22f4b5c3848595bba48ca8eb9b0f))\n\n### Bug Fixes\n\n* fix: use compiler.outputFileSystem to write report\n\n* fix: use fs callback forms because webpack5 does not work with promisify on outputFileSystem methods\n\n* fix: do not accumulate more taps as watchRuns occur\n\n* fix: windows path escape, cleanup watch-fixture\n\n## [2.1.0](https://github.com/webpack-contrib/eslint-webpack-plugin/compare/v1.0.0...v2.1.0) (2020-07-30)\n\n\n### Features\n\n* support typescript ([#8](https://github.com/webpack-contrib/eslint-webpack-plugin/issues/8)) ([6634d96](https://github.com/webpack-contrib/eslint-webpack-plugin/commit/6634d96e7e80dd2d7097479f13a48115e0544f59))\n\n## [2.0.0](https://github.com/webpack-contrib/eslint-webpack-plugin/compare/v1.0.0...v2.0.0) (2020-07-26)\n\n\n### Features\n\n* ESLint class migration ([#11](https://github.com/webpack-contrib/eslint-webpack-plugin/issues/11)) ([efd5e7d](https://github.com/webpack-contrib/eslint-webpack-plugin/commit/efd5e7d01b8569c5dcb2808f618f56e4857fcf52)), closes [#10](https://github.com/webpack-contrib/eslint-webpack-plugin/issues/10) [#10](https://github.com/webpack-contrib/eslint-webpack-plugin/issues/10) [#10](https://github.com/webpack-contrib/eslint-webpack-plugin/issues/10) [#10](https://github.com/webpack-contrib/eslint-webpack-plugin/issues/10) [#10](https://github.com/webpack-contrib/eslint-webpack-plugin/issues/10) [#10](https://github.com/webpack-contrib/eslint-webpack-plugin/issues/10) [#10](https://github.com/webpack-contrib/eslint-webpack-plugin/issues/10) [#10](https://github.com/webpack-contrib/eslint-webpack-plugin/issues/10) [#10](https://github.com/webpack-contrib/eslint-webpack-plugin/issues/10)\n\n### ⚠ BREAKING CHANGES\n\n* minimum supported eslint version is `7`\n\n## [1.0.0](https://github.com/webpack-contrib/eslint-webpack-plugin/compare/v0.1.0...v1.0.0) (2020-05-04)\n\n### ⚠ BREAKING CHANGES\n\n* minimum supported Node.js version is `10.13`\n* minimum supported eslint version is `6.0.0`\n\n## [0.1.0](https://github.com/webpack-contrib/eslint-webpack-plugin/compare/v0.0.1...v0.1.0) (2019-12-20)\n\n\n### Features\n\n* support webpack 5 ([b7f3679](https://github.com/webpack-contrib/eslint-webpack-plugin/commit/b7f3679a8d5e5166376caec2a28ed38d6772bcca))\n\n\n### Bug Fixes\n\n* hooks and callback error ([3e7c36e](https://github.com/webpack-contrib/eslint-webpack-plugin/commit/3e7c36e78e7c05bb5559adced2f92317affbf1ff))\n* resolve file glob patterns ([d5c8820](https://github.com/webpack-contrib/eslint-webpack-plugin/commit/d5c8820d9467e8794a4aa3944bf6ded746d79411))\n\n### 0.0.1 (2019-11-12)\n"
  },
  {
    "path": "LICENSE",
    "content": "Copyright JS Foundation and other contributors\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "<div align=\"center\">\n  <a href=\"https://github.com/eslint/eslint\"><img width=\"200\" height=\"200\" src=\"https://cdn.worldvectorlogo.com/logos/eslint.svg\"></a>\n  <a href=\"https://github.com/webpack/webpack\"><img width=\"200\" height=\"200\" src=\"https://webpack.js.org/assets/icon-square-big.svg\"></a>\n</div>\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> This version of eslint-webpack-plugin only supports webpack 5. For the webpack 4, see the [2.x branch](https://github.com/webpack/eslint-webpack-plugin/tree/2.x).\n\nThis plugin uses [`ESlint`](https://eslint.org/) to find and fix problems in your JavaScript code during the Webpack build process.\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> [!NOTE]\n>\n> You also need to install `eslint >= 9` 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 configuration. 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 Node.js API options](https://eslint.org/docs/latest/integrate/nodejs-api#-new-eslintoptions).\n\n> [!NOTE]\n>\n> The config option you provide will be passed to the `ESLint` class.\n> See the [ESlint docs](https://eslint.org/docs/latest/integrate/nodejs-api#-new-eslintoptions) for more details.\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- `flat` is the current standard configuration format.\n- `eslintrc` is the legacy configuration format and has been officially deprecated.\n\nThe new configuration format is explained in its [own documentation](https://eslint.org/docs/latest/use/configure/configuration-files).\n\n### `context`\n\n- Type:\n\n```ts\ntype context = string;\n```\n\n- Default: `compiler.context`\n\nBase directory for linting.\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.\n\nIf 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 | string[];\n```\n\n- Default: `'js'`\n\nSpecify file extensions that should be checked.\n\n### `exclude`\n\n- Type:\n\n```ts\ntype exclude = string | string[];\n```\n\n- Default: `'node_modules'`\n\nSpecify the files/directories to exclude. Must be relative to `options.context`.\n\n### `resourceQueryExclude`\n\n- Type:\n\n```ts\ntype resourceQueryExclude = RegExp | RegExp[];\n```\n\n- Default: `[]`\n\nSpecify the resource query to exclude.\n\n### `files`\n\n- Type:\n\n```ts\ntype files = string | string[];\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/latest/integrate/nodejs-api#-eslintoutputfixesresults).\n\n**Be careful: this option will modify source files.**\n\n### `formatter`\n\n- Type:\n\n```ts\ntype formatter =\n  | string\n  | ((\n      results: import(\"eslint\").ESLint.LintResult[],\n      data?: import(\"eslint\").ESLint.LintResultData | undefined,\n    ) => string);\n```\n\n- Default: `'stylish'`\n\nAccepts a function that receives an array of ESLint messages (object) as its argument and must return a string as output.\n\nYou 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, skipping initial lint on build start.\n\n### Errors and Warning\n\n**By default the plugin will auto adjust error reporting depending on eslint errors/warnings counts.**\n\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 any errors are found, 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 any warnings are found, 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: import(\"eslint\").ESLint.LintResult[],\n                data?: import(\"eslint\").ESLint.LintResultData | undefined,\n              ) => string)\n          )\n        | undefined;\n    };\n```\n\n- Default: `false`\n\nWrite ESLint results to a file, for example a checkstyle xml file for use for reporting on Jenkins CI.\n\n- filePath: Path to output report file (relative to output.path or absolute).\n- formatter: You can pass in a different `formatter` for the output file.\n  if none is passed in the default/configured formatter will be used.\n\n## Changelog\n\n[Changelog](CHANGELOG.md)\n\n## Contributing\n\nWe welcome all contributions!\n\nIf you're new here, please take a moment to review our contributing guidelines.\n\n[CONTRIBUTING](https://github.com/webpack/eslint-webpack-plugin?tab=contributing-ov-file#contributing)\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/eslint-webpack-plugin/workflows/eslint-webpack-plugin/badge.svg\n[tests-url]: https://github.com/webpack/eslint-webpack-plugin/actions\n[cover]: https://codecov.io/gh/webpack/eslint-webpack-plugin/branch/main/graph/badge.svg\n[cover-url]: https://codecov.io/gh/webpack/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"
  },
  {
    "path": "babel.config.js",
    "content": "const MIN_BABEL_VERSION = 7;\n\nmodule.exports = (api) => {\n  api.assertVersion(MIN_BABEL_VERSION);\n  api.cache(true);\n\n  return {\n    presets: [\n      [\n        \"@babel/preset-env\",\n        {\n          targets: {\n            node: \"14.15.0\",\n          },\n        },\n      ],\n    ],\n  };\n};\n"
  },
  {
    "path": "commitlint.config.js",
    "content": "module.exports = {\n  extends: [\"@commitlint/config-conventional\"],\n  rules: {\n    \"header-max-length\": [0],\n    \"body-max-line-length\": [0],\n    \"footer-max-line-length\": [0],\n  },\n};\n"
  },
  {
    "path": "eslint.config.mjs",
    "content": "import { defineConfig } from \"eslint/config\";\nimport configs from \"eslint-config-webpack/configs.js\";\n\nexport default defineConfig([\n  {\n    extends: [configs[\"recommended-dirty\"]],\n  },\n]);\n"
  },
  {
    "path": "husky.config.js",
    "content": "module.exports = {\n  hooks: {\n    \"pre-commit\": \"lint-staged\",\n    \"commit-msg\": \"commitlint -E HUSKY_GIT_PARAMS\",\n  },\n};\n"
  },
  {
    "path": "jest.config.js",
    "content": "module.exports = {\n  collectCoverage: true,\n  collectCoverageFrom: [\"src/**/*\"],\n  testEnvironment: \"node\",\n  testTimeout: 60000,\n  transformIgnorePatterns: [\"node_modules/(?!(arrify)/)\"],\n};\n"
  },
  {
    "path": "lint-staged.config.js",
    "content": "module.exports = {\n  \"*.js\": [\"eslint --fix\", \"prettier --write\", \"cspell\"],\n  \"*.{json,md,yml,css,ts}\": [\"prettier --write\"],\n};\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"eslint-webpack-plugin\",\n  \"version\": \"6.0.0\",\n  \"description\": \"A ESLint plugin for webpack\",\n  \"keywords\": [\n    \"eslint\",\n    \"lint\",\n    \"linter\",\n    \"plugin\",\n    \"webpack\"\n  ],\n  \"homepage\": \"https://github.com/webpack/eslint-webpack-plugin\",\n  \"bugs\": \"https://github.com/webpack/eslint-webpack-plugin/issues\",\n  \"repository\": \"webpack/eslint-webpack-plugin\",\n  \"funding\": {\n    \"type\": \"opencollective\",\n    \"url\": \"https://opencollective.com/webpack\"\n  },\n  \"license\": \"MIT\",\n  \"author\": \"Ricardo Gobbo de Souza <ricardogobbosouza@yahoo.com.br>\",\n  \"main\": \"dist/index.js\",\n  \"types\": \"types/index.d.ts\",\n  \"files\": [\n    \"dist\",\n    \"types\"\n  ],\n  \"scripts\": {\n    \"start\": \"npm run build -- -w\",\n    \"clean\": \"del-cli dist types\",\n    \"prebuild\": \"npm run clean\",\n    \"build:types\": \"tsc --declaration --emitDeclarationOnly --outDir types && prettier \\\"types/**/*.ts\\\" --write\",\n    \"build:code\": \"cross-env NODE_ENV=production babel src -d dist --copy-files\",\n    \"build\": \"npm-run-all -p \\\"build:**\\\"\",\n    \"commitlint\": \"commitlint --from=main\",\n    \"security\": \"npm audit --omit=dev\",\n    \"lint:prettier\": \"prettier -w --list-different .\",\n    \"lint:code\": \"eslint --cache .\",\n    \"lint:spelling\": \"cspell \\\"**/*.*\\\"\",\n    \"lint:types\": \"tsc --pretty --noEmit\",\n    \"lint\": \"npm-run-all -l -p \\\"lint:**\\\"\",\n    \"fix:code\": \"npm run lint:code -- --fix\",\n    \"fix:prettier\": \"npm run lint:prettier -- --write\",\n    \"fix\": \"npm-run-all -l fix:code fix:prettier\",\n    \"test:only\": \"cross-env NODE_OPTIONS=--experimental-vm-modules NODE_ENV=test jest --testTimeout=60000\",\n    \"test:watch\": \"npm run test:only -- --watch\",\n    \"test:coverage\": \"npm run test:only -- --collectCoverageFrom=\\\"src/**/*.js\\\" --coverage\",\n    \"pretest\": \"npm run lint\",\n    \"test\": \"npm run test:coverage\",\n    \"prepare\": \"npm run build\",\n    \"release\": \"standard-version\"\n  },\n  \"dependencies\": {\n    \"@types/eslint\": \"^9.6.1\",\n    \"micromatch\": \"^4.0.8\",\n    \"normalize-path\": \"^3.0.0\",\n    \"schema-utils\": \"^4.3.3\"\n  },\n  \"devDependencies\": {\n    \"@babel/cli\": \"^7.28.6\",\n    \"@babel/core\": \"^7.29.0\",\n    \"@babel/preset-env\": \"^7.29.2\",\n    \"@commitlint/cli\": \"^20.5.0\",\n    \"@commitlint/config-conventional\": \"^20.5.0\",\n    \"@types/fs-extra\": \"^11.0.4\",\n    \"@types/micromatch\": \"^4.0.10\",\n    \"@types/node\": \"^25.5.0\",\n    \"@types/normalize-path\": \"^3.0.2\",\n    \"chokidar\": \"^5.0.0\",\n    \"cross-env\": \"^10.1.0\",\n    \"cspell\": \"^9.7.0\",\n    \"del\": \"^8.0.1\",\n    \"del-cli\": \"^7.0.0\",\n    \"eslint\": \"^9.39.4\",\n    \"eslint-config-webpack\": \"^4.9.4\",\n    \"fs-extra\": \"^11.3.4\",\n    \"globals\": \"^17.4.0\",\n    \"husky\": \"^9.1.7\",\n    \"jest\": \"^30.3.0\",\n    \"lint-staged\": \"^16.4.0\",\n    \"npm-run-all\": \"^4.1.5\",\n    \"prettier\": \"^3.8.1\",\n    \"standard-version\": \"^9.5.0\",\n    \"typescript\": \"^5.9.3\",\n    \"webpack\": \"^5.105.4\"\n  },\n  \"peerDependencies\": {\n    \"eslint\": \"^9.0.0 || ^10.0.0\",\n    \"webpack\": \"^5.0.0\"\n  },\n  \"engines\": {\n    \"node\": \">= 20.9.0\"\n  }\n}\n"
  },
  {
    "path": "src/ESLintError.js",
    "content": "class ESLintError extends Error {\n  /**\n   * @param {string=} messages messages\n   */\n  constructor(messages) {\n    super(`[eslint] ${messages}`);\n    this.name = \"ESLintError\";\n    this.stack = \"\";\n  }\n}\n\nmodule.exports = ESLintError;\n"
  },
  {
    "path": "src/getESLint.js",
    "content": "const { getESLintOptions } = require(\"./options\");\n\n/** @typedef {import(\"eslint\").ESLint} ESLint */\n/** @typedef {import(\"eslint\").ESLint.LintResult} LintResult */\n/** @typedef {import(\"./options\").Options} Options */\n/** @typedef {(files: string | string[]) => Promise<LintResult[]>} LintTask */\n/** @typedef {{ eslint: ESLint, lintFiles: LintTask }} Linter */\n/** @typedef {import(\"eslint\").ESLint.Options} ESLintOptions */\n/** @typedef {{ new (arg0: ESLintOptions): ESLint, outputFixes: (arg0: LintResult[]) => Promise<void> }} ESLintClass */\n\n/**\n * @param {Options} options options\n * @returns {Promise<Linter>} linter\n */\nasync function getESLint(options) {\n  const eslintOptions = getESLintOptions(options);\n  const fix = Boolean(eslintOptions && eslintOptions.fix);\n\n  const eslintModule = require(options.eslintPath || \"eslint\");\n\n  /** @type {ESLintClass} */\n  const ESLint = await eslintModule.loadESLint({\n    useFlatConfig: options.configType === \"flat\",\n  });\n\n  /** @type {ESLint} */\n  const eslint = new ESLint(eslintOptions);\n\n  /**\n   * @param {string | string[]} files files\n   * @returns {Promise<LintResult[]>} lint results\n   */\n  async function lintFiles(files) {\n    /** @type {LintResult[]} */\n    const result = await eslint.lintFiles(files);\n    // if enabled, use eslint autofixing where possible\n    if (fix) {\n      await ESLint.outputFixes(result);\n    }\n    return result;\n  }\n\n  return {\n    lintFiles,\n    eslint,\n  };\n}\n\nmodule.exports = {\n  getESLint,\n};\n"
  },
  {
    "path": "src/index.js",
    "content": "const { isAbsolute, join } = require(\"node:path\");\n\nconst { isMatch } = require(\"micromatch\");\n\nconst linter = require(\"./linter\");\nconst { getOptions } = require(\"./options\");\nconst { arrify, parseFiles, parseFoldersToGlobs } = require(\"./utils\");\n\n/** @typedef {import(\"webpack\").Compiler} Compiler */\n/** @typedef {import(\"webpack\").Module} Module */\n/** @typedef {import(\"webpack\").NormalModule} NormalModule */\n/** @typedef {import(\"./options\").Options} Options */\n\nconst ESLINT_PLUGIN = \"ESLintWebpackPlugin\";\nconst DEFAULT_FOLDER_TO_EXCLUDE = \"**/node_modules/**\";\n\nlet compilerId = 0;\n\nclass ESLintWebpackPlugin {\n  /**\n   * @param {Options=} options options\n   */\n  constructor(options = {}) {\n    this.key = ESLINT_PLUGIN;\n    this.options = getOptions(options);\n    this.run = this.run.bind(this);\n  }\n\n  /**\n   * @param {Compiler} compiler compiler\n   * @returns {void}\n   */\n  apply(compiler) {\n    // Generate key for each compilation,\n    // this differentiates one from the other when being cached.\n    this.key = compiler.name || `${this.key}_${(compilerId += 1)}`;\n    this.options.failOnError ??= compiler.options.mode !== \"development\";\n\n    const excludedFiles = parseFiles(\n      this.options.exclude || [],\n      this.getContext(compiler),\n    );\n    const resourceQueries = arrify(this.options.resourceQueryExclude || []);\n    const excludedResourceQueries = resourceQueries.map((item) =>\n      item instanceof RegExp ? item : new RegExp(item),\n    );\n\n    const options = {\n      ...this.options,\n      exclude: excludedFiles,\n      resourceQueryExclude: excludedResourceQueries,\n      extensions: arrify(this.options.extensions),\n      files: parseFiles(this.options.files || \"\", this.getContext(compiler)),\n    };\n\n    const foldersToExclude = this.options.exclude\n      ? options.exclude\n      : DEFAULT_FOLDER_TO_EXCLUDE;\n    const exclude = parseFoldersToGlobs(foldersToExclude);\n    const wanted = parseFoldersToGlobs(options.files, options.extensions);\n\n    // If `lintDirtyModulesOnly` is disabled,\n    // execute the linter on the build\n    if (!this.options.lintDirtyModulesOnly) {\n      compiler.hooks.run.tapPromise(this.key, (compiler) =>\n        this.run(compiler, options, wanted, exclude),\n      );\n    }\n\n    let hasCompilerRunByDirtyModule = this.options.lintDirtyModulesOnly;\n\n    compiler.hooks.watchRun.tapPromise(this.key, (compiler) => {\n      if (!hasCompilerRunByDirtyModule) {\n        return this.run(compiler, options, wanted, exclude);\n      }\n\n      hasCompilerRunByDirtyModule = false;\n\n      return Promise.resolve();\n    });\n  }\n\n  /**\n   * @param {Compiler} compiler compiler\n   * @param {Omit<Options, \"resourceQueryExclude\"> & { resourceQueryExclude: RegExp[] }} options options\n   * @param {string[]} wanted wanted files\n   * @param {string[]} exclude excluded files\n   */\n  async run(compiler, options, wanted, exclude) {\n    // Do not re-hook\n    const isCompilerHooked = compiler.hooks.compilation.taps.find(\n      ({ name }) => name === this.key,\n    );\n\n    if (isCompilerHooked) return;\n\n    compiler.hooks.compilation.tap(this.key, async (compilation) => {\n      /** @type {import(\"./linter\").Linter} */\n      let lint;\n      /** @type {import(\"./linter\").Reporter} */\n      let report;\n\n      try {\n        ({ lint, report } = await linter(options, compilation));\n      } catch (err) {\n        compilation.errors.push(err);\n        return;\n      }\n\n      /** @type {string[]} */\n      const files = [];\n\n      /**\n       * @param {Module} module module\n       */\n      function addFile(module) {\n        const { resource } = /** @type {NormalModule} */ (module);\n\n        if (!resource) return;\n\n        const [file, query] = resource.split(\"?\");\n        const isFileNotListed = file && !files.includes(file);\n        const isFileWanted =\n          isMatch(file, wanted, { dot: true }) &&\n          !isMatch(file, exclude, { dot: true });\n        const isQueryNotExclude = options.resourceQueryExclude.every(\n          (reg) => !reg.test(query),\n        );\n\n        if (isFileNotListed && isFileWanted && isQueryNotExclude) {\n          files.push(file);\n        }\n      }\n\n      // Add the file to be linted\n      compilation.hooks.succeedModule.tap(this.key, addFile);\n\n      if (!this.options.lintDirtyModulesOnly) {\n        compilation.hooks.stillValidModule.tap(this.key, addFile);\n      }\n\n      // Lint all files added\n      compilation.hooks.finishModules.tap(this.key, () => {\n        if (files.length > 0) lint(files);\n      });\n\n      // await and interpret results\n      compilation.hooks.processAssets.tapAsync(\n        this.key,\n        async (_, callback) => {\n          const { errors, warnings, generateReportAsset } = await report();\n\n          if (warnings) {\n            compilation.warnings.push(warnings);\n          }\n\n          if (errors) {\n            compilation.errors.push(errors);\n          }\n\n          if (generateReportAsset) {\n            await generateReportAsset(compilation);\n          }\n\n          if (warnings && options.failOnWarning) {\n            callback(warnings);\n          } else if (errors && options.failOnError) {\n            callback(errors);\n          } else {\n            callback();\n          }\n        },\n      );\n    });\n  }\n\n  /**\n   * @param {Compiler} compiler compiler\n   * @returns {string} context\n   */\n  getContext(compiler) {\n    const compilerContext = String(compiler.options.context);\n    const optionContext = this.options.context;\n\n    if (!optionContext) return compilerContext;\n\n    if (isAbsolute(optionContext)) return optionContext;\n\n    return join(compilerContext, optionContext);\n  }\n}\n\nmodule.exports = ESLintWebpackPlugin;\n"
  },
  {
    "path": "src/linter.js",
    "content": "const { dirname, isAbsolute, join } = require(\"node:path\");\n\nconst ESLintError = require(\"./ESLintError\");\nconst { getESLint } = require(\"./getESLint\");\n\n/** @typedef {import(\"eslint\").ESLint} ESLint */\n/** @typedef {import(\"eslint\").ESLint.Formatter} Formatter */\n/** @typedef {import(\"eslint\").ESLint.LintResult} LintResult */\n/** @typedef {import(\"webpack\").Compiler} Compiler */\n/** @typedef {import(\"webpack\").Compilation} Compilation */\n/** @typedef {import(\"./options\").Options} Options */\n/** @typedef {import(\"./options\").FormatterFunction} FormatterFunction */\n/** @typedef {(compilation: Compilation) => Promise<void>} GenerateReport */\n/** @typedef {{ errors?: ESLintError, warnings?: ESLintError, generateReportAsset?: GenerateReport }} Report */\n/** @typedef {() => Promise<Report>} Reporter */\n/** @typedef {(files: string | string[]) => void} Linter */\n/** @typedef {{ [files: string]: LintResult }} LintResultMap */\n\n/**\n * @param {Promise<LintResult[]>[]} results results\n * @returns {Promise<LintResult[]>} flatted results\n */\nasync function flatten(results) {\n  /**\n   * @param {LintResult[]} acc acc\n   * @param {LintResult[]} list list\n   * @returns {LintResult[]} result\n   */\n  const flat = (acc, list) => [...acc, ...list];\n  return (await Promise.all(results)).reduce(flat, []);\n}\n\n/**\n * @param {ESLint} eslint eslint\n * @param {LintResult[]} results results\n * @returns {Promise<LintResult[]>} result without warnings\n */\nasync function removeIgnoredWarnings(eslint, results) {\n  const filterPromises = results.map(async (result) => {\n    // Short circuit the call to isPathIgnored.\n    //   fatal is false for ignored file warnings.\n    //   ruleId is unset for internal ESLint errors.\n    //   line is unset for warnings not involving file contents.\n    const { messages, warningCount, errorCount, filePath } = result;\n    const [firstMessage] = messages;\n    const hasWarning = warningCount === 1 && errorCount === 0;\n    const ignored =\n      messages.length === 0 ||\n      (hasWarning &&\n        !firstMessage.fatal &&\n        !firstMessage.ruleId &&\n        !firstMessage.line &&\n        (await eslint.isPathIgnored(filePath)));\n    return ignored ? false : result;\n  });\n\n  return (await Promise.all(filterPromises)).filter(\n    (result) => result !== false,\n  );\n}\n\n/**\n * @param {ESLint} eslint eslint\n * @param {string | FormatterFunction=} formatter formatter\n * @returns {Promise<Formatter>} loaded formatter\n */\nasync function loadFormatter(eslint, formatter) {\n  if (typeof formatter === \"function\") {\n    return { format: formatter };\n  }\n\n  if (typeof formatter === \"string\") {\n    try {\n      return eslint.loadFormatter(formatter);\n    } catch {\n      // Load the default formatter.\n    }\n  }\n\n  return eslint.loadFormatter();\n}\n\n/**\n * @param {Formatter} formatter formatter\n * @param {{ errors: LintResult[], warnings: LintResult[] }} results results\n * @returns {Promise<{ errors?: ESLintError, warnings?: ESLintError }>} errors and warnings\n */\nasync function formatResults(formatter, results) {\n  let errors;\n  let warnings;\n  if (results.warnings.length > 0) {\n    warnings = new ESLintError(await formatter.format(results.warnings));\n  }\n\n  if (results.errors.length > 0) {\n    errors = new ESLintError(await formatter.format(results.errors));\n  }\n\n  return {\n    errors,\n    warnings,\n  };\n}\n\n/**\n * @param {LintResult} file file\n * @returns {boolean} true when has errors, otherwise false\n */\nfunction fileHasErrors(file) {\n  return file.errorCount > 0;\n}\n\n/**\n * @param {LintResult} file file\n * @returns {boolean} true when has warnings, otherwise false\n */\nfunction fileHasWarnings(file) {\n  return file.warningCount > 0;\n}\n\n/**\n * @param {Options} options options results\n * @param {LintResult[]} results results\n * @returns {{ errors: LintResult[], warnings: LintResult[] }} parsed errors and warnings\n */\nfunction parseResults(options, results) {\n  /** @type {LintResult[]} */\n  const errors = [];\n\n  /** @type {LintResult[]} */\n  const warnings = [];\n\n  for (const file of results) {\n    if (fileHasErrors(file)) {\n      const messages = file.messages.filter(\n        (message) => options.emitError && message.severity === 2,\n      );\n\n      if (messages.length > 0) {\n        errors.push({ ...file, messages });\n      }\n    }\n\n    if (fileHasWarnings(file)) {\n      const messages = file.messages.filter(\n        (message) => options.emitWarning && message.severity === 1,\n      );\n\n      if (messages.length > 0) {\n        warnings.push({ ...file, messages });\n      }\n    }\n  }\n\n  return {\n    errors,\n    warnings,\n  };\n}\n\n/**\n * @param {Options} options options\n * @param {Compilation} compilation compilation\n * @returns {Promise<{ lint: Linter, report: Reporter }>} linter with additional functions\n */\nasync function linter(options, compilation) {\n  /** @type {ESLint} */\n  let eslint;\n\n  /** @type {(files: string | string[]) => Promise<LintResult[]>} */\n  let lintFiles;\n\n  /** @type {Promise<LintResult[]>[]} */\n  const rawResults = [];\n\n  try {\n    ({ eslint, lintFiles } = await getESLint(options));\n  } catch (err) {\n    throw new ESLintError(err.message);\n  }\n\n  /**\n   * @param {string | string[]} files files\n   */\n  function lint(files) {\n    rawResults.push(\n      lintFiles(files).catch((err) => {\n        compilation.errors.push(new ESLintError(err.message));\n        return [];\n      }),\n    );\n  }\n\n  /**\n   * @returns {Promise<Report>} report\n   */\n  async function report() {\n    // Filter out ignored files.\n    const results = await removeIgnoredWarnings(\n      eslint,\n      // Get the current results, resetting the rawResults to empty\n      await flatten(rawResults.splice(0)),\n    );\n\n    // do not analyze if there are no results or eslint config\n    if (!results || results.length < 1) {\n      return {};\n    }\n\n    const formatter = await loadFormatter(eslint, options.formatter);\n    const { errors, warnings } = await formatResults(\n      formatter,\n      parseResults(options, results),\n    );\n\n    /**\n     * @param {Compilation} compilation compilation\n     * @returns {Promise<void>}\n     */\n    async function generateReportAsset({ compiler }) {\n      const { outputReport } = options;\n      /**\n       * @param {string} name name\n       * @param {string | Buffer} content content\n       * @returns {Promise<void>}\n       */\n      const save = (name, content) =>\n        /** @type {Promise<void>} */\n        (\n          new Promise((finish, bail) => {\n            if (!compiler.outputFileSystem) return;\n\n            const { mkdir, writeFile } = compiler.outputFileSystem;\n\n            mkdir(dirname(name), { recursive: true }, (err) => {\n              /* istanbul ignore if */\n              if (err) {\n                bail(err);\n              } else {\n                writeFile(name, content, (/** @type {unknown} */ err2) => {\n                  /* istanbul ignore if */\n                  if (err2) bail(err2);\n                  else finish();\n                });\n              }\n            });\n          })\n        );\n\n      if (!outputReport || !outputReport.filePath) {\n        return;\n      }\n\n      const content = await (outputReport.formatter\n        ? (await loadFormatter(eslint, outputReport.formatter)).format(results)\n        : formatter.format(results));\n\n      let { filePath } = outputReport;\n      if (!isAbsolute(filePath)) {\n        filePath = join(compiler.outputPath, filePath);\n      }\n\n      await save(filePath, content);\n    }\n\n    return {\n      errors,\n      warnings,\n      generateReportAsset,\n    };\n  }\n\n  return {\n    lint,\n    report,\n  };\n}\n\nmodule.exports = linter;\n"
  },
  {
    "path": "src/options.js",
    "content": "const { validate } = require(\"schema-utils\");\n\nconst schema = require(\"./options.json\");\n\n/** @typedef {import(\"eslint\").ESLint.Options} ESLintOptions */\n/** @typedef {import(\"eslint\").ESLint.LintResult} LintResult */\n\n/**\n * @callback FormatterFunction\n * @param {LintResult[]} results results\n * @returns {string} formatted result\n */\n\n/**\n * @typedef {object} OutputReport\n * @property {string=} filePath a file path\n * @property {string | FormatterFunction=} formatter a formatter\n */\n\n/**\n * @typedef {object} PluginOptions\n * @property {string=} context a string indicating the root of your files\n * @property {boolean=} emitError the errors found will always be emitted\n * @property {boolean=} emitWarning the warnings found will always be emitted\n * @property {string | string[]=} exclude specify the files and/or directories to exclude\n * @property {string | string[]=} extensions specify the extensions that should be checked\n * @property {boolean=} failOnError will cause the module build to fail if there are any errors\n * @property {boolean=} failOnWarning will cause the module build to fail if there are any warning\n * @property {string | string[]=} files specify directories, files, or globs\n * @property {boolean=} fix apply fixes\n * @property {string | FormatterFunction=} formatter specify the formatter you would like to use to format your results\n * @property {boolean=} lintDirtyModulesOnly lint only changed files, skip linting on start\n * @property {boolean=} quiet will process and report errors only and ignore warnings\n * @property {string=} eslintPath path to `eslint` instance that will be used for linting\n * @property {OutputReport=} outputReport writes the output of the errors to a file - for example, a `json` file for use for reporting\n * @property {RegExp | RegExp[]=} resourceQueryExclude Specify the resource query to exclude\n * @property {string=} configType config type\n */\n\n/** @typedef {PluginOptions & ESLintOptions} Options */\n\n/**\n * @param {Options} pluginOptions plugin options\n * @returns {PluginOptions} normalized plugin options\n */\nfunction getOptions(pluginOptions) {\n  const options = {\n    cache: true,\n    cacheLocation: \"node_modules/.cache/eslint-webpack-plugin/.eslintcache\",\n    configType: \"flat\",\n    extensions: \"js\",\n    emitError: true,\n    emitWarning: true,\n    resourceQueryExclude: [],\n    ...pluginOptions,\n    ...(pluginOptions.quiet ? { emitError: true, emitWarning: false } : {}),\n  };\n\n  // @ts-expect-error need better types\n  validate(schema, options, {\n    name: \"ESLint Webpack Plugin\",\n    baseDataPath: \"options\",\n  });\n\n  return options;\n}\n\n/**\n * @param {Options} loaderOptions loader options\n * @returns {ESLintOptions} eslint options\n */\nfunction getESLintOptions(loaderOptions) {\n  const eslintOptions = { ...loaderOptions };\n\n  // Keep the fix option because it is common to both the loader and ESLint.\n  const { fix, extensions, ...eslintOnlyOptions } = schema.properties;\n\n  // No need to guard the for-in because schema.properties has hardcoded keys.\n\n  for (const option in eslintOnlyOptions) {\n    // @ts-expect-error need better types\n    delete eslintOptions[option];\n  }\n\n  // Some options aren't available in flat mode\n  if (loaderOptions.configType === \"flat\") {\n    delete eslintOptions.extensions;\n  }\n\n  return eslintOptions;\n}\n\nmodule.exports = {\n  getESLintOptions,\n  getOptions,\n};\n"
  },
  {
    "path": "src/options.json",
    "content": "{\n  \"type\": \"object\",\n  \"additionalProperties\": true,\n  \"properties\": {\n    \"configType\": {\n      \"description\": \"Specify the type of configuration to use with ESLint, `flat` or `eslintrc`.\",\n      \"type\": \"string\"\n    },\n    \"context\": {\n      \"description\": \"A string indicating the root of your files.\",\n      \"type\": \"string\"\n    },\n    \"emitError\": {\n      \"description\": \"The errors found will always be emitted, to disable set to `false`.\",\n      \"type\": \"boolean\"\n    },\n    \"emitWarning\": {\n      \"description\": \"The warnings found will always be emitted, to disable set to `false`.\",\n      \"type\": \"boolean\"\n    },\n    \"eslintPath\": {\n      \"description\": \"Path 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      \"type\": \"string\"\n    },\n    \"exclude\": {\n      \"description\": \"Specify the files and/or directories to exclude. Must be relative to `options.context`.\",\n      \"anyOf\": [{ \"type\": \"string\" }, { \"type\": \"array\" }]\n    },\n    \"resourceQueryExclude\": {\n      \"description\": \"Specify the resource query to exclude.\",\n      \"anyOf\": [{ \"instanceof\": \"RegExp\" }, { \"type\": \"array\" }]\n    },\n    \"failOnError\": {\n      \"description\": \"Will cause the module build to fail if there are any errors, to disable set to `false`.\",\n      \"type\": \"boolean\"\n    },\n    \"failOnWarning\": {\n      \"description\": \"Will cause the module build to fail if there are any warnings, if set to `true`.\",\n      \"type\": \"boolean\"\n    },\n    \"files\": {\n      \"description\": \"Specify the files and/or directories to traverse. Must be relative to `options.context`.\",\n      \"anyOf\": [{ \"type\": \"string\" }, { \"type\": \"array\" }]\n    },\n    \"extensions\": {\n      \"description\": \"Specify extensions that should be checked.\",\n      \"anyOf\": [{ \"type\": \"string\" }, { \"type\": \"array\" }]\n    },\n    \"fix\": {\n      \"description\": \"Will enable ESLint autofix feature\",\n      \"type\": \"boolean\"\n    },\n    \"formatter\": {\n      \"description\": \"Accepts a function that will have one argument: an array of eslint messages (object). The function must return the output as a string.\",\n      \"anyOf\": [{ \"type\": \"string\" }, { \"instanceof\": \"Function\" }]\n    },\n    \"lintDirtyModulesOnly\": {\n      \"description\": \"Lint only changed files, skip lint on start.\",\n      \"type\": \"boolean\"\n    },\n    \"quiet\": {\n      \"description\": \"Will process and report errors only and ignore warnings, if set to `true`.\",\n      \"type\": \"boolean\"\n    },\n    \"outputReport\": {\n      \"description\": \"Write the output of the errors to a file, for example a checkstyle xml file for use for reporting on Jenkins CI\",\n      \"anyOf\": [\n        {\n          \"type\": \"boolean\"\n        },\n        {\n          \"type\": \"object\",\n          \"additionalProperties\": false,\n          \"properties\": {\n            \"filePath\": {\n              \"description\": \"The `filePath` is relative to the webpack config: output.path\",\n              \"anyOf\": [{ \"type\": \"string\" }]\n            },\n            \"formatter\": {\n              \"description\": \"You can pass in a different formatter for the output file, if none is passed in the default/configured formatter will be used\",\n              \"anyOf\": [{ \"type\": \"string\" }, { \"instanceof\": \"Function\" }]\n            }\n          }\n        }\n      ]\n    }\n  }\n}\n"
  },
  {
    "path": "src/utils.js",
    "content": "// eslint-disable-next-line jsdoc/reject-any-type\n/** @typedef {any} EXPECTED_ANY */\n\nconst { statSync } = require(\"node:fs\");\nconst { resolve } = require(\"node:path\");\n\nconst normalizePath = require(\"normalize-path\");\n\n/**\n * @template T\n * @typedef {T extends (null | undefined)\n * ? []\n * : T extends string\n * ? [string]\n * : T extends readonly unknown[]\n * ? T\n * : T extends Iterable<infer T>\n * ? T[]\n * : [T]} ArrifyResult\n */\n\n/* istanbul ignore next */\n/**\n * @template T\n * @param {T} value value\n * @returns {ArrifyResult<T>} array of values\n */\nfunction arrify(value) {\n  if (value === null || value === undefined) {\n    return /** @type {ArrifyResult<T>} */ ([]);\n  }\n\n  if (Array.isArray(value)) {\n    return /** @type {ArrifyResult<T>} */ (value);\n  }\n\n  if (typeof value === \"string\") {\n    return /** @type {ArrifyResult<T>} */ ([value]);\n  }\n\n  // @ts-expect-error need better types\n  if (typeof value[Symbol.iterator] === \"function\") {\n    // @ts-expect-error need better types\n    return [...value];\n  }\n\n  return /** @type {ArrifyResult<T>} */ ([value]);\n}\n\n/**\n * @param {string | string[]} files files\n * @param {string} context context\n * @returns {string[]} normalized paths\n */\nfunction parseFiles(files, context) {\n  return arrify(files).map((/** @type {string} */ file) =>\n    normalizePath(resolve(context, file)),\n  );\n}\n\n/**\n * @param {string | string[]} patterns patterns\n * @param {string | string[]} extensions extensions\n * @returns {string[]} globs\n */\nfunction parseFoldersToGlobs(patterns, extensions = []) {\n  const extensionsList = arrify(extensions);\n  const [prefix, postfix] = extensionsList.length > 1 ? [\"{\", \"}\"] : [\"\", \"\"];\n  const extensionsGlob = extensionsList\n    .map((/** @type {string} */ extension) => extension.replace(/^\\./u, \"\"))\n    .join(\",\");\n\n  return arrify(patterns).map((/** @type {string} */ pattern) => {\n    try {\n      // The patterns are absolute because they are prepended with the context.\n      const stats = statSync(pattern);\n      /* istanbul ignore else */\n      if (stats.isDirectory()) {\n        return pattern.replace(\n          /[/\\\\]*?$/u,\n          `/**${\n            extensionsGlob ? `/*.${prefix + extensionsGlob + postfix}` : \"\"\n          }`,\n        );\n      }\n    } catch {\n      // Return the pattern as is on error.\n    }\n    return pattern;\n  });\n}\n\nmodule.exports = {\n  arrify,\n  parseFiles,\n  parseFoldersToGlobs,\n};\n"
  },
  {
    "path": "test/.badeslintrc",
    "content": "{\n  \"foo\": \"bar\"\n}\n"
  },
  {
    "path": "test/autofix-stop.test.js",
    "content": "import { join } from \"node:path\";\nimport { copySync, removeSync } from \"fs-extra\";\n\nimport pack from \"./utils/pack\";\n\ndescribe(\"autofix stop\", () => {\n  const entry = join(__dirname, \"fixtures/nonfixable-clone.js\");\n\n  let changed = false;\n  let watcher;\n\n  beforeAll(async () => {\n    copySync(join(__dirname, \"fixtures/nonfixable.js\"), entry);\n    const chokidar = (await import(\"chokidar\")).default;\n\n    watcher = chokidar.watch(entry);\n    watcher.on(\"change\", () => {\n      changed = true;\n    });\n  });\n\n  afterAll(() => {\n    watcher.close();\n    removeSync(entry);\n  });\n\n  it(\"should not change file if there are no fixable errors/warnings\", async () => {\n    const compiler = pack(\"nonfixable-clone\", { fix: true });\n\n    await compiler.runAsync();\n    expect(changed).toBe(false);\n  });\n});\n"
  },
  {
    "path": "test/autofix.test.js",
    "content": "import { join } from \"node:path\";\n\nimport { copySync, readFileSync, removeSync } from \"fs-extra\";\n\nimport pack from \"./utils/pack\";\n\ndescribe(\"autofix stop\", () => {\n  const entry = join(__dirname, \"fixtures/fixable-clone.js\");\n\n  beforeAll(() => {\n    copySync(join(__dirname, \"fixtures/fixable.js\"), entry);\n  });\n\n  afterAll(() => {\n    removeSync(entry);\n  });\n\n  it.each([[{}]])(\n    \"should not throw error if file ok after auto-fixing\",\n    async (cfg) => {\n      const compiler = pack(\"fixable-clone\", {\n        ...cfg,\n        fix: true,\n        extensions: [\"js\", \"cjs\", \"mjs\"],\n        overrideConfig: {\n          rules: { semi: [\"error\", \"always\"] },\n        },\n      });\n\n      const stats = await compiler.runAsync();\n      expect(stats.hasWarnings()).toBe(false);\n      expect(stats.hasErrors()).toBe(false);\n      expect(readFileSync(entry).toString(\"utf8\")).toMatchInlineSnapshot(`\n        \"function foo() {\n          return true;\n        }\n\n        foo();\n        \"\n      `);\n    },\n  );\n});\n"
  },
  {
    "path": "test/cached.test.js",
    "content": "import { join } from \"node:path\";\n\nimport { removeSync } from \"fs-extra\";\n\nimport webpack from \"webpack\";\n\nimport conf from \"./utils/conf\";\n\ndescribe(\"error (cached module)\", () => {\n  const cacheLocation = join(__dirname, \"cache\");\n\n  beforeEach(() => {\n    removeSync(cacheLocation);\n  });\n\n  afterAll(() => {\n    removeSync(cacheLocation);\n  });\n\n  it(\"should return error even if module is cached\", (done) => {\n    const config = conf(\"error\");\n    config.cache = {\n      type: \"filesystem\",\n      idleTimeout: 0,\n      idleTimeoutAfterLargeChanges: 0,\n      idleTimeoutForInitialStore: 0,\n      cacheLocation,\n    };\n\n    const c1 = webpack(config);\n\n    c1.run((err1, stats1) => {\n      expect(err1).toBeNull();\n      expect(stats1.hasWarnings()).toBe(false);\n      expect(stats1.hasErrors()).toBe(true);\n\n      c1.close(() => {\n        const c2 = webpack(config);\n        c2.run((err2, stats2) => {\n          expect(err2).toBeNull();\n          expect(stats2.hasWarnings()).toBe(false);\n          expect(stats2.hasErrors()).toBe(true);\n\n          done();\n        });\n      });\n    });\n  });\n});\n"
  },
  {
    "path": "test/child-compiler.test.js",
    "content": "import webpack from \"webpack\";\n\nimport conf from \"./utils/conf\";\n\nconst PLUGIN_NAME = \"ChildPlugin\";\nclass ChildPlugin {\n  constructor(options) {\n    this.options = webpack.config.getNormalizedWebpackOptions(options);\n  }\n\n  apply(compiler) {\n    compiler.hooks.make.tapAsync(PLUGIN_NAME, (compilation, callback) => {\n      const childCompiler = compilation.createChildCompiler(PLUGIN_NAME);\n      webpack.EntryOptionPlugin.applyEntryOption(\n        childCompiler,\n        compilation.compiler.context,\n        this.options.entry,\n      );\n      childCompiler.runAsChild(() => {\n        callback();\n      });\n    });\n  }\n}\n\ndescribe(\"child compiler\", () => {\n  it(\"should have linting process\", (done) => {\n    const config = conf(\"good\");\n    config.plugins.push(\n      new ChildPlugin({\n        entry: {\n          child: \"./child-entry\",\n        },\n      }),\n    );\n    webpack(config).run((err, stats) => {\n      expect(err).toBeNull();\n      expect(stats.hasErrors()).toBe(false);\n      expect(stats.hasWarnings()).toBe(true);\n      done();\n    });\n  });\n});\n"
  },
  {
    "path": "test/circular-plugin.test.js",
    "content": "import pack from \"./utils/pack\";\n\ndescribe(\"circular plugin\", () => {\n  it(\"should support plugins with circular configs\", async () => {\n    const plugin = {\n      configs: {},\n      rules: {},\n      processors: {},\n    };\n\n    Object.assign(plugin.configs, {\n      recommended: {\n        plugins: {\n          self: plugin,\n        },\n        rules: {},\n      },\n    });\n\n    const loaderOptions = {\n      overrideConfig: {\n        plugins: { plugin },\n      },\n      overrideConfigFile: true,\n    };\n\n    const compiler = pack(\"good\", loaderOptions);\n\n    const stats = await compiler.runAsync();\n    expect(stats.hasWarnings()).toBe(false);\n    expect(stats.hasErrors()).toBe(false);\n  });\n});\n"
  },
  {
    "path": "test/config-for-tests/.eslintrc.js",
    "content": "module.exports = {\n  ignorePatterns: [\"**/ignore.js\"],\n  globals: {\n    __dirname: \"readonly\",\n    __filename: \"readonly\",\n    exports: \"writable\",\n    module: \"readonly\",\n    require: \"readonly\",\n    console: \"readonly\",\n  },\n  parserOptions: {\n    ecmaVersion: 2018,\n    env: {\n      browser: true,\n      node: true,\n      es6: true,\n    },\n    sourceType: \"module\",\n  },\n  rules: {\n    \"no-console\": \"warn\",\n\n    \"no-undef\": \"error\",\n    \"no-var\": \"error\",\n    \"no-unused-vars\": \"error\",\n    \"prefer-const\": \"error\",\n  },\n};\n"
  },
  {
    "path": "test/config-for-tests/eslint.config.mjs",
    "content": "import { defineConfig } from \"eslint/config\";\nimport globals from \"globals\";\n\nexport default defineConfig({\n  languageOptions: {\n    globals: {\n      ...globals.node,\n    },\n  },\n  rules: {\n    \"no-console\": \"warn\",\n\n    \"no-undef\": \"error\",\n    \"no-var\": \"error\",\n    \"no-unused-vars\": \"error\",\n    \"prefer-const\": \"error\",\n  },\n});\n"
  },
  {
    "path": "test/context.test.js",
    "content": "import { join } from \"node:path\";\n\nimport pack from \"./utils/pack\";\n\ndescribe(\"context\", () => {\n  it(\"absolute\", async () => {\n    const compiler = pack(\"good\", { context: join(__dirname, \"fixtures\") });\n\n    const stats = await compiler.runAsync();\n    expect(stats.hasWarnings()).toBe(false);\n    expect(stats.hasErrors()).toBe(false);\n  });\n\n  it(\"relative\", async () => {\n    const compiler = pack(\"good\", { context: \"../fixtures/\" });\n\n    const stats = await compiler.runAsync();\n    expect(stats.hasWarnings()).toBe(false);\n    expect(stats.hasErrors()).toBe(false);\n  });\n});\n"
  },
  {
    "path": "test/emit-error.test.js",
    "content": "import pack from \"./utils/pack\";\n\ndescribe(\"emit error\", () => {\n  it(\"should not emit errors if emitError is false\", async () => {\n    const compiler = pack(\"error\", { emitError: false });\n\n    const stats = await compiler.runAsync();\n    expect(stats.hasErrors()).toBe(false);\n  });\n\n  it(\"should emit errors if emitError is undefined\", async () => {\n    const compiler = pack(\"error\", {});\n\n    const stats = await compiler.runAsync();\n    expect(stats.hasErrors()).toBe(true);\n  });\n\n  it(\"should emit errors if emitError is true\", async () => {\n    const compiler = pack(\"error\", { emitError: true });\n\n    const stats = await compiler.runAsync();\n    expect(stats.hasErrors()).toBe(true);\n  });\n\n  it(\"should emit errors, but not warnings if emitError is true and emitWarning is false\", async () => {\n    const compiler = pack(\"full-of-problems\", {\n      emitError: true,\n      emitWarning: false,\n    });\n\n    const stats = await compiler.runAsync();\n    expect(stats.hasWarnings()).toBe(false);\n    expect(stats.hasErrors()).toBe(true);\n  });\n\n  it(\"should emit errors and warnings if emitError is true and emitWarning is undefined\", async () => {\n    const compiler = pack(\"full-of-problems\", { emitError: true });\n\n    const stats = await compiler.runAsync();\n    expect(stats.hasWarnings()).toBe(true);\n    expect(stats.hasErrors()).toBe(true);\n  });\n});\n"
  },
  {
    "path": "test/emit-warning.test.js",
    "content": "import pack from \"./utils/pack\";\n\ndescribe(\"emit warning\", () => {\n  it(\"should not emit warnings if emitWarning is false\", async () => {\n    const compiler = pack(\"warn\", { emitWarning: false });\n\n    const stats = await compiler.runAsync();\n    expect(stats.hasWarnings()).toBe(false);\n  });\n\n  it(\"should emit warnings if emitWarning is undefined\", async () => {\n    const compiler = pack(\"warn\", {});\n\n    const stats = await compiler.runAsync();\n    expect(stats.hasWarnings()).toBe(true);\n  });\n\n  it(\"should emit warnings if emitWarning is true\", async () => {\n    const compiler = pack(\"warn\", { emitWarning: true });\n\n    const stats = await compiler.runAsync();\n    expect(stats.hasWarnings()).toBe(true);\n  });\n\n  it(\"should emit warnings, but not warnings if emitWarning is true and emitError is false\", async () => {\n    const compiler = pack(\"full-of-problems\", {\n      emitWarning: true,\n      emitError: false,\n    });\n\n    const stats = await compiler.runAsync();\n    expect(stats.hasWarnings()).toBe(true);\n    expect(stats.hasErrors()).toBe(false);\n  });\n\n  it(\"should emit warnings and errors if emitWarning is true and emitError is undefined\", async () => {\n    const compiler = pack(\"full-of-problems\", { emitWarning: true });\n\n    const stats = await compiler.runAsync();\n    expect(stats.hasWarnings()).toBe(true);\n    expect(stats.hasErrors()).toBe(true);\n  });\n});\n"
  },
  {
    "path": "test/empty.test.js",
    "content": "import { join } from \"node:path\";\n\nimport webpack from \"webpack\";\n\nimport ESLintPlugin from \"../src\";\n\ndescribe(\"empty\", () => {\n  it(\"no error when no files matching\", (done) => {\n    const compiler = webpack({\n      context: join(__dirname, \"fixtures\", \"empty\"),\n      mode: \"development\",\n      entry: \"../\",\n      plugins: [new ESLintPlugin()],\n    });\n\n    compiler.run((err, stats) => {\n      expect(stats.hasWarnings()).toBe(false);\n      expect(stats.hasErrors()).toBe(false);\n      done();\n    });\n  });\n});\n"
  },
  {
    "path": "test/error.test.js",
    "content": "import pack from \"./utils/pack\";\n\ndescribe(\"error\", () => {\n  afterEach(() => {\n    jest.restoreAllMocks();\n  });\n\n  it(\"should return error if file is bad\", async () => {\n    const compiler = pack(\"error\");\n\n    const stats = await compiler.runAsync();\n    expect(stats.hasWarnings()).toBe(false);\n    expect(stats.hasErrors()).toBe(true);\n  });\n\n  it(\"should propagate eslint exceptions as errors\", async () => {\n    jest.mock(\"eslint\", () => ({\n      ESLint: function ESLint() {\n        this.lintFiles = async () => {\n          throw new Error(\"Oh no!\");\n        };\n      },\n    }));\n\n    const compiler = pack(\"good\");\n\n    const stats = await compiler.runAsync();\n    expect(stats.hasWarnings()).toBe(false);\n    expect(stats.hasErrors()).toBe(true);\n  });\n});\n"
  },
  {
    "path": "test/eslint-lint.test.js",
    "content": "import pack from \"./utils/pack\";\n\ndescribe(\"eslint lint\", () => {\n  const mockLintFiles = jest.fn().mockReturnValue([]);\n\n  beforeAll(() => {\n    jest.mock(\"eslint\", () => {\n      function ESLint() {\n        this.lintFiles = mockLintFiles;\n      }\n\n      ESLint.version = \"9.0.0\";\n\n      return {\n        ESLint,\n        async loadESLint() {\n          return ESLint;\n        },\n      };\n    });\n  });\n\n  beforeEach(() => {\n    mockLintFiles.mockClear();\n  });\n\n  it(\"should lint one file\", async () => {\n    const compiler = pack(\"lint-one\");\n\n    await compiler.runAsync();\n    expect(mockLintFiles).toHaveBeenCalledTimes(1);\n  });\n\n  it(\"should lint two files\", async () => {\n    const compiler = pack(\"lint-two\");\n\n    await compiler.runAsync();\n    const files = [\n      expect.stringMatching(\"lint-two-entry.js\"),\n      expect.stringMatching(\"lint.js\"),\n    ];\n    expect(mockLintFiles).toHaveBeenCalledWith(files);\n  });\n\n  it(\"should lint more files\", async () => {\n    const compiler = pack(\"lint-more\");\n\n    await compiler.runAsync();\n    const files = [\n      expect.stringMatching(\"lint-more-entry.js\"),\n      expect.stringMatching(\"lint-more.js\"),\n      expect.stringMatching(\"lint.js\"),\n    ];\n    expect(mockLintFiles).toHaveBeenCalledWith(files);\n  });\n});\n"
  },
  {
    "path": "test/eslint-options.test.js",
    "content": "import { getESLintOptions } from \"../src/options\";\n\ndescribe(\"eslint options\", () => {\n  it(\"should filter loader options\", () => {\n    const options = {\n      formatter: \"table\",\n      ignore: false,\n    };\n    expect(getESLintOptions(options)).toStrictEqual({\n      ignore: false,\n    });\n  });\n\n  it(\"should keep the fix option\", () => {\n    // The fix option should be kept because it is common to both the loader and ESLint.\n    const options = {\n      eslintPath: \"some/place/where/eslint/lives\",\n      formatter: \"table\",\n      fix: true,\n      emitError: false,\n      emitWarning: false,\n      failOnError: true,\n      failOnWarning: true,\n      quiet: false,\n      outputReport: true,\n    };\n    expect(getESLintOptions(options)).toStrictEqual({\n      fix: true,\n    });\n  });\n});\n"
  },
  {
    "path": "test/eslint-path.test.js",
    "content": "import { join } from \"node:path\";\n\nimport pack from \"./utils/pack\";\n\ndescribe(\"eslint path\", () => {\n  it(\"should use another instance of eslint via eslintPath config\", async () => {\n    const eslintPath = join(__dirname, \"mock/eslint\");\n    const compiler = pack(\"good\", { eslintPath });\n\n    const stats = await compiler.runAsync();\n    expect(stats.hasWarnings()).toBe(false);\n    expect(stats.hasErrors()).toBe(true);\n    expect(stats.compilation.errors[0].message).toContain(\"Fake error\");\n  });\n});\n"
  },
  {
    "path": "test/eslintrc-config.test.js",
    "content": "import { join } from \"node:path\";\n\nimport { ESLint } from \"eslint\";\nimport pack from \"./utils/pack\";\n\n(ESLint && Number.parseFloat(ESLint.version) >= 10 ? describe.skip : describe)(\n  \"succeed on eslintrc-configuration\",\n  () => {\n    // eslint-disable-next-line jest/require-top-level-describe, jest/consistent-test-it\n    it(\"should work with eslintrc configuration type\", async () => {\n      const overrideConfigFile = join(\n        __dirname,\n        \"fixtures\",\n        \"eslintrc-config.js\",\n      );\n      const compiler = pack(\"full-of-problems\", {\n        configType: \"eslintrc\",\n        overrideConfigFile,\n      });\n\n      const stats = await compiler.runAsync();\n      const { errors } = stats.compilation;\n\n      expect(stats.hasErrors()).toBe(true);\n      expect(errors).toHaveLength(1);\n      expect(errors[0].message).toContain(\"full-of-problems.js\");\n      expect(stats.hasWarnings()).toBe(true);\n    });\n  },\n);\n"
  },
  {
    "path": "test/exclude.test.js",
    "content": "import pack from \"./utils/pack\";\n\ndescribe(\"exclude\", () => {\n  it(\"should exclude with globs\", async () => {\n    const compiler = pack(\"exclude\", { exclude: [\"*error*\"] });\n\n    const stats = await compiler.runAsync();\n    expect(stats.hasWarnings()).toBe(false);\n    expect(stats.hasErrors()).toBe(false);\n  });\n\n  it(\"should exclude files\", async () => {\n    const compiler = pack(\"exclude\", { exclude: [\"error.js\"] });\n\n    const stats = await compiler.runAsync();\n    expect(stats.hasWarnings()).toBe(false);\n    expect(stats.hasErrors()).toBe(false);\n  });\n\n  it(\"should exclude folders\", async () => {\n    const compiler = pack(\"exclude-folder\", { exclude: [\"folder\"] });\n\n    const stats = await compiler.runAsync();\n    expect(stats.hasWarnings()).toBe(false);\n    expect(stats.hasErrors()).toBe(false);\n  });\n});\n"
  },
  {
    "path": "test/fail-on-config.test.js",
    "content": "import { join } from \"node:path\";\n\nimport { ESLint } from \"eslint\";\nimport pack from \"./utils/pack\";\n\n(ESLint && Number.parseFloat(ESLint.version) >= 10 ? describe.skip : describe)(\n  \"fail on config\",\n  () => {\n    // eslint-disable-next-line jest/require-top-level-describe, jest/consistent-test-it\n    it(\"fails when .eslintrc is not a proper format\", async () => {\n      const overrideConfigFile = join(__dirname, \".badeslintrc\");\n      const compiler = pack(\"error\", {\n        configType: \"eslintrc\",\n        overrideConfigFile,\n      });\n\n      const stats = await compiler.runAsync();\n      const { errors } = stats.compilation;\n      expect(stats.hasWarnings()).toBe(false);\n      expect(stats.hasErrors()).toBe(true);\n      expect(errors).toHaveLength(1);\n      expect(errors[0].message).toMatch(\n        /ESLint configuration in --config is invalid/i,\n      );\n    });\n  },\n);\n"
  },
  {
    "path": "test/fail-on-error.test.js",
    "content": "import pack from \"./utils/pack\";\n\ndescribe(\"fail on error\", () => {\n  it(\"should emits errors\", async () => {\n    const compiler = pack(\"error\", { failOnError: true });\n\n    await expect(compiler.runAsync()).rejects.toThrow(\"error\");\n  });\n\n  it(\"should emit warnings when disabled\", async () => {\n    const compiler = pack(\"error\", { failOnError: false });\n\n    const stats = await compiler.runAsync();\n    expect(stats.hasErrors()).toBe(true);\n  });\n\n  it(\"should correctly identifies a success\", async () => {\n    const compiler = pack(\"good\", { failOnError: true });\n\n    const stats = await compiler.runAsync();\n    expect(stats.hasErrors()).toBe(false);\n  });\n});\n"
  },
  {
    "path": "test/fail-on-warning.test.js",
    "content": "import pack from \"./utils/pack\";\n\ndescribe(\"fail on warning\", () => {\n  it(\"should emits errors\", async () => {\n    const compiler = pack(\"warn\", { failOnWarning: true });\n\n    await expect(compiler.runAsync()).rejects.toThrow(\"warning\");\n  });\n\n  it(\"should correctly identifies a success\", async () => {\n    const compiler = pack(\"good\", { failOnWarning: true });\n\n    const stats = await compiler.runAsync();\n    expect(stats.hasErrors()).toBe(false);\n  });\n});\n"
  },
  {
    "path": "test/fixtures/[symbols]/error.js",
    "content": "var foo = stuff\n"
  },
  {
    "path": "test/fixtures/[symbols]/symbols-entry.js",
    "content": "require('./error');\n"
  },
  {
    "path": "test/fixtures/cache.js",
    "content": "\"use strict\"\n\nrequire(\"./require\")\n\nfunction cacheIt() {\n  return \"cache\"\n}\n\ncacheIt()\n"
  },
  {
    "path": "test/fixtures/child-entry.js",
    "content": "console.log(\"Hello from child-entry.js\");\n"
  },
  {
    "path": "test/fixtures/error-entry.js",
    "content": "require('./error');\n"
  },
  {
    "path": "test/fixtures/error-warn-entry.js",
    "content": "require('./error');\nrequire('./warn');\n"
  },
  {
    "path": "test/fixtures/error.js",
    "content": "var foo = stuff\n"
  },
  {
    "path": "test/fixtures/eslintrc-config.js",
    "content": "module.exports = {\n  root: true,\n  parserOptions: {\n    ecmaVersion: 2018,\n    env: {\n      es6: true,\n      jest: true,\n    },\n    sourceType: 'module',\n  },\n  rules: {\n    strict: 'error',\n    'global-require': 'off',\n  },\n};\n"
  },
  {
    "path": "test/fixtures/exclude-entry.js",
    "content": "require(\"./error\")\n"
  },
  {
    "path": "test/fixtures/exclude-folder-entry.js",
    "content": "require(\"./folder/error\")\n"
  },
  {
    "path": "test/fixtures/fixable-clone-entry.js",
    "content": "require('./fixable-clone');\n"
  },
  {
    "path": "test/fixtures/fixable.js",
    "content": "function foo() {\n  return true\n}\n\nfoo()\n"
  },
  {
    "path": "test/fixtures/flat-config.js",
    "content": "\nmodule.exports = [\n    {\n        files: [\"*.js\"],\n        rules: {}\n    }\n];\n"
  },
  {
    "path": "test/fixtures/folder/error.js",
    "content": "var foo = stuff\n"
  },
  {
    "path": "test/fixtures/folder/readme.md",
    "content": "This folder is used as a fixture for dirty file watching.\n"
  },
  {
    "path": "test/fixtures/full-of-problems-entry.js",
    "content": "require('./full-of-problems');"
  },
  {
    "path": "test/fixtures/full-of-problems.js",
    "content": "/* eslint consistent-return: \"error\" */\n/* eslint indent: [\"warn\", 4] */\n/* eslint no-else-return: \"warn\" */\n/* eslint semi: [\"warn\", \"always\"] */\n/* eslint space-unary-ops: \"error\" */\n\nfunction addOne(i) {\n  if (i != NaN) {\n    return i ++\n  } else {\n    return\n  }\n};"
  },
  {
    "path": "test/fixtures/good-entry.js",
    "content": "require(\"./good\");\n"
  },
  {
    "path": "test/fixtures/good.js",
    "content": "/**\n * @returns {string} value\n */\nfunction test() {\n  return \"value\"\n}\n\ntest()\n"
  },
  {
    "path": "test/fixtures/ignore-entry.js",
    "content": "require('./ignore');\n"
  },
  {
    "path": "test/fixtures/ignore.js",
    "content": "// this file should be totally ignore since it's present in .eslintignore\nvar -dasdas;\n"
  },
  {
    "path": "test/fixtures/index.js",
    "content": "module.exports = {}\n"
  },
  {
    "path": "test/fixtures/lint-more-entry.js",
    "content": "require('./lint-more')\n"
  },
  {
    "path": "test/fixtures/lint-more.js",
    "content": "require('./lint')\n"
  },
  {
    "path": "test/fixtures/lint-one-entry.js",
    "content": "//\n"
  },
  {
    "path": "test/fixtures/lint-two-entry.js",
    "content": "require('./lint')\nrequire('./lint?foo=bar')\n"
  },
  {
    "path": "test/fixtures/lint.js",
    "content": "function test() {\n  return \"value\"\n}\n\ntest()\n"
  },
  {
    "path": "test/fixtures/multiple-entry.js",
    "content": "require(\"./good\");\nrequire(\"./error\");\n"
  },
  {
    "path": "test/fixtures/nonfixable-clone-entry.js",
    "content": "require('./nonfixable-clone');\n"
  },
  {
    "path": "test/fixtures/nonfixable.js",
    "content": "function foo() {\n  return stuff;\n}\n\nfoo();\n"
  },
  {
    "path": "test/fixtures/query-entry.js",
    "content": "// disable: eslint-disable-next-line import/no-unresolved\nrequire('./good?some-query=1234');\n// disable: eslint-disable-next-line import/no-unresolved\nrequire('alias-ignore');\n"
  },
  {
    "path": "test/fixtures/require.js",
    "content": "\"use strict\"\n\nrequire(\"./good\")"
  },
  {
    "path": "test/fixtures/resource-query-entry.js",
    "content": "// disable: eslint-disable-next-line import/no-unresolved\nrequire('./media/some-video.ts?media');\n"
  },
  {
    "path": "test/fixtures/warn-entry.js",
    "content": "require('./warn');\n"
  },
  {
    "path": "test/fixtures/warn-error-entry.js",
    "content": "require('./warn');\nrequire('./error');\n"
  },
  {
    "path": "test/fixtures/warn.js",
    "content": "/* eslint no-unused-vars: warn */\nconst foo = this\n"
  },
  {
    "path": "test/flat-config.test.js",
    "content": "import { join } from \"node:path\";\nimport pack from \"./utils/pack\";\n\ndescribe(\"succeed on flat-configuration\", () => {\n  it(\"should work with flat configuration type\", async () => {\n    const overrideConfigFile = join(__dirname, \"fixtures\", \"flat-config.js\");\n    const compiler = pack(\"full-of-problems\", {\n      configType: \"flat\",\n      overrideConfigFile,\n    });\n\n    const stats = await compiler.runAsync();\n    const { errors } = stats.compilation;\n\n    expect(stats.hasErrors()).toBe(true);\n    expect(errors).toHaveLength(1);\n    expect(errors[0].message).toMatch(/full-of-problems\\.js/i);\n    expect(stats.hasWarnings()).toBe(true);\n  });\n});\n"
  },
  {
    "path": "test/formatter-custom.test.js",
    "content": "import pack from \"./utils/pack\";\n\ndescribe(\"formatter eslint\", () => {\n  it(\"should use custom formatter as function\", async () => {\n    const formatter = require(\"./mock/formatter\");\n\n    const compiler = pack(\"error\", { formatter });\n\n    const stats = await compiler.runAsync();\n    expect(stats.hasWarnings()).toBe(false);\n    expect(stats.hasErrors()).toBe(true);\n    expect(stats.compilation.errors[0].message).toBeTruthy();\n    const message = JSON.parse(\n      stats.compilation.errors[0].message.replace(\"[eslint] \", \"\"),\n    );\n    expect(message.formatter).toBe(\"mock\");\n    expect(message.results).toBeTruthy();\n  });\n\n  it(\"should use custom formatter as string\", async () => {\n    const formatter = \"./test/mock/formatter\";\n    const compiler = pack(\"error\", { formatter });\n\n    const stats = await compiler.runAsync();\n    expect(stats.hasWarnings()).toBe(false);\n    expect(stats.hasErrors()).toBe(true);\n    expect(stats.compilation.errors[0].message).toBeTruthy();\n    const message = JSON.parse(\n      stats.compilation.errors[0].message.replace(\"[eslint] \", \"\"),\n    );\n    expect(message.formatter).toBe(\"mock\");\n    expect(message.results).toBeTruthy();\n  });\n});\n"
  },
  {
    "path": "test/formatter-eslint.test.js",
    "content": "import pack from \"./utils/pack\";\n\ndescribe(\"formatter eslint\", () => {\n  it(\"should use eslint formatter\", async () => {\n    const compiler = pack(\"error\");\n\n    const stats = await compiler.runAsync();\n    expect(stats.hasWarnings()).toBe(false);\n    expect(stats.hasErrors()).toBe(true);\n    expect(stats.compilation.errors[0].message).toBeTruthy();\n  });\n});\n"
  },
  {
    "path": "test/formatter-official.test.js",
    "content": "import pack from \"./utils/pack\";\n\ndescribe(\"formatter official\", () => {\n  it(\"should use official formatter\", async () => {\n    const compiler = pack(\"error\", { formatter: \"json\" });\n\n    const stats = await compiler.runAsync();\n    expect(stats.hasWarnings()).toBe(false);\n    expect(stats.hasErrors()).toBe(true);\n    expect(stats.compilation.errors[0].message).toBeTruthy();\n  });\n});\n"
  },
  {
    "path": "test/formatter-write.test.js",
    "content": "import { join } from \"node:path\";\n\nimport { readFileSync, removeSync } from \"fs-extra\";\nimport webpack from \"webpack\";\n\nimport conf from \"./utils/conf\";\n\ndescribe(\"formatter write\", () => {\n  it(\"should write results to relative file with a custom formatter\", (done) => {\n    const outputFilename = \"outputReport-relative.txt\";\n    const config = conf(\"error\", {\n      formatter: \"json\",\n      outputReport: {\n        formatter: \"json\",\n        filePath: outputFilename,\n      },\n    });\n\n    const outputFilepath = join(config.output.path, outputFilename);\n    removeSync(outputFilepath);\n\n    const compiler = webpack(config);\n    compiler.run((err, stats) => {\n      const contents = readFileSync(outputFilepath, \"utf8\");\n\n      expect(err).toBeNull();\n      expect(stats.hasWarnings()).toBe(false);\n      expect(stats.hasErrors()).toBe(true);\n      expect(stats.compilation.errors[0].message).toBe(`[eslint] ${contents}`);\n      done();\n    });\n  });\n\n  it(\"should write results to absolute file with a same formatter\", (done) => {\n    const outputFilename = \"outputReport-absolute.txt\";\n    const outputFilepath = join(__dirname, \"outputs\", outputFilename);\n    const config = conf(\"error\", {\n      outputReport: {\n        filePath: outputFilepath,\n      },\n    });\n\n    removeSync(outputFilepath);\n\n    const compiler = webpack(config);\n    compiler.run((err, stats) => {\n      const contents = readFileSync(outputFilepath, \"utf8\");\n\n      expect(err).toBeNull();\n      expect(stats.hasWarnings()).toBe(false);\n      expect(stats.hasErrors()).toBe(true);\n      expect(stats.compilation.errors[0].message).toBe(`[eslint] ${contents}`);\n      done();\n    });\n  });\n});\n"
  },
  {
    "path": "test/ignore.test.js",
    "content": "import ESLintError from \"../src/ESLintError\";\nimport pack from \"./utils/pack\";\n\ndescribe(\"eslintignore\", () => {\n  it(\"should ignores files present in .eslintignore\", async () => {\n    const compiler = pack(\"ignore\", {\n      ignore: true,\n      ignorePatterns: [\"**/ignore.js\"],\n    });\n\n    const stats = await compiler.runAsync();\n    expect(stats.hasWarnings()).toBe(false);\n    expect(\n      stats.compilation.errors.filter((x) => x instanceof ESLintError),\n    ).toEqual([]);\n  });\n});\n"
  },
  {
    "path": "test/lint-dirty-modules-only.test.js",
    "content": "import { writeFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\n\nimport { removeSync } from \"fs-extra\";\n\nimport pack from \"./utils/pack\";\n\nconst target = join(__dirname, \"fixtures\", \"lint-dirty-modules-only-entry.js\");\n\ndescribe(\"lint dirty modules only\", () => {\n  let watch;\n\n  afterEach(() => {\n    if (watch) {\n      watch.close();\n    }\n    removeSync(target);\n  });\n\n  it(\"skips linting on initial run\", (done) => {\n    writeFileSync(target, \"const foo = false\\n\");\n\n    // eslint-disable-next-line no-use-before-define\n    let next = firstPass;\n    const compiler = pack(\"lint-dirty-modules-only\", {\n      lintDirtyModulesOnly: true,\n    });\n    watch = compiler.watch({}, (err, stats) => next(err, stats));\n\n    function secondPass(err, stats) {\n      expect(err).toBeNull();\n      expect(stats.hasWarnings()).toBe(false);\n      expect(stats.hasErrors()).toBe(true);\n      const { errors } = stats.compilation;\n      expect(errors).toHaveLength(1);\n      expect(stats.compilation.errors[0].message).toEqual(\n        expect.stringMatching(\"no-unused-vars\"),\n      );\n      done();\n    }\n\n    function firstPass(err, stats) {\n      expect(err).toBeNull();\n      expect(stats.hasWarnings()).toBe(false);\n      expect(stats.hasErrors()).toBe(false);\n\n      next = secondPass;\n\n      writeFileSync(target, \"const bar = false;\\n\");\n    }\n  });\n});\n"
  },
  {
    "path": "test/mock/eslint/index.js",
    "content": "class ESLintMock {\n  // Disabled because these are simplified mock methods.\n\n  async lintFiles() {\n    return [\n      {\n        filePath: \"\",\n        messages: [\n          {\n            ruleId: \"no-undef\",\n            severity: 2,\n            message: \"Fake error\",\n            line: 1,\n            column: 11,\n          },\n        ],\n        errorCount: 2,\n        warningCount: 0,\n        fixableErrorCount: 0,\n        fixableWarningCount: 0,\n        source: \"\",\n      },\n    ];\n  }\n\n  async loadFormatter() {\n    return {\n      format(results) {\n        return JSON.stringify(results);\n      },\n    };\n  }\n}\n\nESLintMock.version = \"9\";\n\nmodule.exports = {\n  ESLint: ESLintMock,\n  loadESLint: async () => ESLintMock,\n};\n"
  },
  {
    "path": "test/mock/eslint/package.json",
    "content": "{\n  \"name\": \"eslint\",\n  \"version\": \"7.0.0\"\n}\n"
  },
  {
    "path": "test/mock/formatter/index.js",
    "content": "module.exports = function format(results) {\n  return JSON.stringify({\n    formatter: \"mock\",\n    results,\n  });\n};\n"
  },
  {
    "path": "test/multiple-instances.test.js",
    "content": "import { join } from \"node:path\";\nimport ESLintPlugin from \"../src\";\nimport pack from \"./utils/pack\";\n\ndescribe(\"multiple instances\", () => {\n  it(\"should don't fail\", async () => {\n    const compiler = pack(\n      \"multiple\",\n      {},\n      {\n        plugins: [\n          new ESLintPlugin({\n            failOnError: true,\n            overrideConfigFile: join(\n              __dirname,\n              \"./config-for-tests/eslint.config.mjs\",\n            ),\n            ignore: false,\n            exclude: \"error.js\",\n          }),\n          new ESLintPlugin({\n            failOnError: true,\n            overrideConfigFile: join(\n              __dirname,\n              \"./config-for-tests/eslint.config.mjs\",\n            ),\n            ignore: false,\n            exclude: \"error.js\",\n          }),\n        ],\n      },\n    );\n\n    const stats = await compiler.runAsync();\n    expect(stats.hasWarnings()).toBe(false);\n    expect(stats.hasErrors()).toBe(false);\n  });\n\n  it(\"should fail on first instance\", async () => {\n    const compiler = pack(\n      \"multiple\",\n      {},\n      {\n        plugins: [\n          new ESLintPlugin({\n            failOnError: true,\n            overrideConfigFile: join(\n              __dirname,\n              \"./config-for-tests/eslint.config.mjs\",\n            ),\n            ignore: false,\n            exclude: \"good.js\",\n          }),\n          new ESLintPlugin({\n            failOnError: true,\n            overrideConfigFile: join(\n              __dirname,\n              \"./config-for-tests/eslint.config.mjs\",\n            ),\n            ignore: false,\n            exclude: \"error.js\",\n          }),\n        ],\n      },\n    );\n\n    await expect(compiler.runAsync()).rejects.toThrow(\"error.js\");\n  });\n\n  it(\"should fail on second instance\", async () => {\n    const compiler = pack(\n      \"multiple\",\n      {},\n      {\n        plugins: [\n          new ESLintPlugin({\n            failOnError: true,\n            overrideConfigFile: join(\n              __dirname,\n              \"./config-for-tests/eslint.config.mjs\",\n            ),\n            ignore: false,\n            exclude: \"error.js\",\n          }),\n          new ESLintPlugin({\n            failOnError: true,\n            overrideConfigFile: join(\n              __dirname,\n              \"./config-for-tests/eslint.config.mjs\",\n            ),\n            ignore: false,\n            exclude: \"good.js\",\n          }),\n        ],\n      },\n    );\n\n    await expect(compiler.runAsync()).rejects.toThrow(\"error.js\");\n  });\n});\n"
  },
  {
    "path": "test/ok.test.js",
    "content": "import pack from \"./utils/pack\";\n\ndescribe(\"ok\", () => {\n  it(\"should don't throw error if file is ok\", async () => {\n    const compiler = pack(\"good\");\n\n    const stats = await compiler.runAsync();\n    expect(stats.hasWarnings()).toBe(false);\n    expect(stats.hasErrors()).toBe(false);\n  });\n});\n"
  },
  {
    "path": "test/parameters.test.js",
    "content": "import pack from \"./utils/pack\";\n\ndescribe(\"parameters\", () => {\n  it(\"should supports query strings parameters\", async () => {\n    const loaderOptions = {\n      overrideConfig: {\n        rules: { semi: 0 },\n      },\n    };\n    const compiler = pack(\"good\", loaderOptions);\n\n    const stats = await compiler.runAsync();\n    expect(stats.hasWarnings()).toBe(false);\n    expect(stats.hasErrors()).toBe(false);\n  });\n});\n"
  },
  {
    "path": "test/query.test.js",
    "content": "import pack from \"./utils/pack\";\n\ndescribe(\"query\", () => {\n  it(\"should correctly resolve file despite query path\", async () => {\n    const compiler = pack(\n      \"query\",\n      {},\n      {\n        resolve: {\n          alias: {\n            \"alias-ignore\": false,\n          },\n        },\n      },\n    );\n\n    const stats = await compiler.runAsync();\n    expect(stats.hasWarnings()).toBe(false);\n    expect(stats.hasErrors()).toBe(false);\n  });\n});\n"
  },
  {
    "path": "test/quiet.test.js",
    "content": "import pack from \"./utils/pack\";\n\ndescribe(\"quiet\", () => {\n  it(\"should not emit warnings if quiet is set\", async () => {\n    const compiler = pack(\"warn\", { quiet: true });\n\n    const stats = await compiler.runAsync();\n    expect(stats.hasWarnings()).toBe(false);\n    expect(stats.hasErrors()).toBe(false);\n  });\n\n  it(\"should emit errors, but not emit warnings if quiet is set\", async () => {\n    const compiler = pack(\"full-of-problems\", { quiet: true });\n\n    const stats = await compiler.runAsync();\n    expect(stats.hasWarnings()).toBe(false);\n    expect(stats.hasErrors()).toBe(true);\n  });\n});\n"
  },
  {
    "path": "test/resource-query.test.js",
    "content": "import pack from \"./utils/pack\";\n\ndescribe(\"resource-query\", () => {\n  it(\"should exclude the match resource query\", async () => {\n    const compiler = pack(\n      \"resource-query\",\n      {\n        resourceQueryExclude: /media/,\n        extensions: [\".js\", \".ts\"],\n      },\n      {\n        module: { rules: [{ resourceQuery: /media/, type: \"asset/source\" }] },\n      },\n    );\n\n    const stats = await compiler.runAsync();\n    expect(stats.hasWarnings()).toBe(false);\n    expect(stats.hasErrors()).toBe(false);\n  });\n});\n"
  },
  {
    "path": "test/symbols.test.js",
    "content": "import { join } from \"node:path\";\n\nimport pack from \"./utils/pack\";\n\ndescribe(\"symbols\", () => {\n  afterEach(() => {\n    jest.restoreAllMocks();\n  });\n\n  it(\"should return error\", async () => {\n    const compiler = pack(\n      \"symbols\",\n      {},\n      { context: join(__dirname, \"fixtures/[symbols]\") },\n    );\n\n    const stats = await compiler.runAsync();\n    expect(stats.hasWarnings()).toBe(false);\n    expect(stats.hasErrors()).toBe(true);\n  });\n});\n"
  },
  {
    "path": "test/threads.test.js",
    "content": "import workerThreads from \"node:worker_threads\";\nimport pack from \"./utils/pack\";\n\ndescribe(\"Multithread\", () => {\n  let workerCount;\n  let originalWorker;\n\n  beforeEach(() => {\n    workerCount = 0;\n    originalWorker = workerThreads.Worker;\n    workerThreads.Worker = class TrackedWorker extends originalWorker {\n      constructor(...args) {\n        super(...args);\n        workerCount++;\n      }\n    };\n  });\n\n  afterEach(() => {\n    workerThreads.Worker = originalWorker;\n  });\n\n  it(\"should spawn worker threads with concurrency=2\", async () => {\n    const compiler = pack(\"good\", { concurrency: 2 });\n\n    const stats = await compiler.runAsync();\n\n    expect(stats.hasErrors()).toBe(false);\n    expect(workerCount).toBeGreaterThanOrEqual(2);\n  });\n\n  it(\"should not spawn worker threads with concurrency=off\", async () => {\n    const compiler = pack(\"good\", { concurrency: \"off\" });\n\n    const stats = await compiler.runAsync();\n\n    expect(stats.hasErrors()).toBe(false);\n    expect(workerCount).toBe(0);\n  });\n});\n"
  },
  {
    "path": "test/utils/conf.js",
    "content": "import { join } from \"node:path\";\nimport ESLintPlugin from \"../../src\";\n\nexport default (entry, pluginConf = {}, webpackConf = {}) => {\n  const testDir = join(__dirname, \"..\");\n\n  return {\n    entry: `./${entry}-entry.js`,\n    context: join(testDir, \"fixtures\"),\n    mode: \"development\",\n    output: {\n      path: join(testDir, \"outputs\"),\n    },\n    plugins: [\n      new ESLintPlugin({\n        // Do not cache for tests\n        cache: false,\n        overrideConfigFile: join(\n          testDir,\n          \"./config-for-tests/eslint.config.mjs\",\n        ),\n        // this disables the use of .eslintignore, since it contains the fixtures\n        // folder to skip it on the global linting, but here we want the opposite\n        ignore: false,\n        ...pluginConf,\n      }),\n    ],\n    ...webpackConf,\n  };\n};\n"
  },
  {
    "path": "test/utils/pack.js",
    "content": "import webpack from \"webpack\";\n\nimport conf from \"./conf\";\n\n/**\n * new a test webpack compiler\n * @param {string} context context\n * @param {import(\"../../src/options\").Options} pluginConf plugin options\n * @param {webpack.Configuration} webpackConf webpack configuration\n * @returns {ReturnType<webpack>} return result from webpack\n */\nexport default (context, pluginConf = {}, webpackConf = {}) => {\n  const compiler = webpack(conf(context, pluginConf, webpackConf));\n\n  return {\n    runAsync() {\n      return new Promise((resolve, reject) => {\n        compiler.run((err, stats) => {\n          if (err) {\n            reject(err);\n          } else {\n            resolve(stats);\n          }\n        });\n      });\n    },\n    watch(options, fn) {\n      return compiler.watch(options, fn);\n    },\n  };\n};\n"
  },
  {
    "path": "test/utils.test.js",
    "content": "import { parseFiles, parseFoldersToGlobs } from \"../src/utils\";\n\njest.mock(\"fs\", () => ({\n  statSync(pattern) {\n    return {\n      isDirectory() {\n        return pattern.indexOf(\"/path/\") === 0;\n      },\n    };\n  },\n}));\n\ndescribe(\"utils\", () => {\n  it(\"parseFiles should return relative files from context\", () => {\n    expect(\n      parseFiles(\n        [\"**/*\", \"../package-a/src/**/\", \"../package-b/src/**/\"],\n        \"main/src\",\n      ),\n    ).toEqual(\n      expect.arrayContaining([\n        expect.stringContaining(\"main/src/**/*\"),\n        expect.stringContaining(\"main/package-a/src/**\"),\n        expect.stringContaining(\"main/package-b/src/**\"),\n      ]),\n    );\n  });\n\n  it(\"parseFoldersToGlobs should return globs for folders\", () => {\n    const withoutSlash = \"/path/to/code\";\n    const withSlash = `${withoutSlash}/`;\n\n    expect(parseFoldersToGlobs(withoutSlash, \"js\")).toMatchInlineSnapshot(`\n    [\n      \"/path/to/code/**/*.js\",\n    ]\n  `);\n    expect(parseFoldersToGlobs(withSlash, \"js\")).toMatchInlineSnapshot(`\n    [\n      \"/path/to/code/**/*.js\",\n    ]\n  `);\n\n    expect(\n      parseFoldersToGlobs(\n        [withoutSlash, withSlash, \"/some/file.js\"],\n        [\"js\", \"cjs\", \"mjs\"],\n      ),\n    ).toMatchInlineSnapshot(`\n    [\n      \"/path/to/code/**/*.{js,cjs,mjs}\",\n      \"/path/to/code/**/*.{js,cjs,mjs}\",\n      \"/some/file.js\",\n    ]\n  `);\n\n    expect(parseFoldersToGlobs(withoutSlash)).toMatchInlineSnapshot(`\n    [\n      \"/path/to/code/**\",\n    ]\n  `);\n\n    expect(parseFoldersToGlobs(withSlash)).toMatchInlineSnapshot(`\n    [\n      \"/path/to/code/**\",\n    ]\n  `);\n  });\n\n  it(\"parseFoldersToGlobs should return unmodified globs for globs (ignoring extensions)\", () => {\n    expect(parseFoldersToGlobs(\"**.notjs\", \"js\")).toMatchInlineSnapshot(`\n    [\n      \"**.notjs\",\n    ]\n  `);\n  });\n});\n"
  },
  {
    "path": "test/warning.test.js",
    "content": "import pack from \"./utils/pack\";\n\ndescribe(\"warning\", () => {\n  it(\"should emit warnings\", async () => {\n    const compiler = pack(\"warn\");\n\n    const stats = await compiler.runAsync();\n    expect(stats.hasWarnings()).toBe(true);\n    expect(stats.hasErrors()).toBe(false);\n  });\n});\n"
  },
  {
    "path": "test/watch.test.js",
    "content": "import { writeFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\n\nimport { removeSync } from \"fs-extra\";\n\nimport pack from \"./utils/pack\";\n\nconst target = join(__dirname, \"fixtures\", \"watch-entry.js\");\nconst target2 = join(__dirname, \"fixtures\", \"watch-leaf.js\");\nconst targetExpectedPattern = expect.stringMatching(\n  target.replaceAll(\"\\\\\", \"\\\\\\\\\"),\n);\n\ndescribe(\"watch\", () => {\n  let watch;\n\n  afterEach(() => {\n    if (watch) {\n      watch.close();\n    }\n    removeSync(target);\n    removeSync(target2);\n  });\n\n  it(\"should watch\", (done) => {\n    const compiler = pack(\"good\");\n\n    watch = compiler.watch({}, (err, stats) => {\n      expect(err).toBeNull();\n      expect(stats.hasWarnings()).toBe(false);\n      expect(stats.hasErrors()).toBe(false);\n      done();\n    });\n  });\n\n  it(\"should watch with unique messages\", (done) => {\n    writeFileSync(target, \"var foo = stuff\\n\");\n\n    // eslint-disable-next-line no-use-before-define\n    let next = firstPass;\n    const compiler = pack(\"watch\");\n    watch = compiler.watch({}, (err, stats) => next(err, stats));\n\n    function finish(err, stats) {\n      expect(err).toBeNull();\n      expect(stats.hasWarnings()).toBe(false);\n      expect(stats.hasErrors()).toBe(false);\n      done();\n    }\n\n    function thirdPass(err, stats) {\n      expect(err).toBeNull();\n      expect(stats.hasWarnings()).toBe(false);\n      expect(stats.hasErrors()).toBe(true);\n      const { errors } = stats.compilation;\n      expect(errors).toHaveLength(1);\n      const [{ message }] = errors;\n      expect(message).toEqual(targetExpectedPattern);\n      expect(message).toEqual(expect.stringMatching(\"no-unused-vars\"));\n      // `prefer-const` fails here\n      expect(message).toEqual(expect.stringMatching(\"prefer-const\"));\n      expect(message).toEqual(expect.stringMatching(\"\\\\(4 errors,\"));\n\n      next = finish;\n\n      writeFileSync(\n        target,\n        \"/* eslint-disable no-unused-vars */\\nconst foo = false;\\n\",\n      );\n    }\n\n    function secondPass(err, stats) {\n      expect(err).toBeNull();\n      expect(stats.hasWarnings()).toBe(false);\n      expect(stats.hasErrors()).toBe(true);\n      const { errors } = stats.compilation;\n      expect(errors).toHaveLength(1);\n      const [{ message }] = errors;\n      expect(message).toEqual(targetExpectedPattern);\n      expect(message).toEqual(expect.stringMatching(\"no-unused-vars\"));\n      // `prefer-const` passes here\n      expect(message).toEqual(expect.stringMatching(\"prefer-const\"));\n      expect(message).toEqual(expect.stringMatching(\"\\\\(4 errors,\"));\n\n      next = thirdPass;\n\n      writeFileSync(\n        target,\n        \"const x = require('./watch-leaf')\\nconst foo = 0\\n\",\n      );\n    }\n\n    function firstPass(err, stats) {\n      expect(err).toBeNull();\n      expect(stats.hasWarnings()).toBe(false);\n      expect(stats.hasErrors()).toBe(true);\n      const { errors } = stats.compilation;\n      expect(errors).toHaveLength(1);\n      const [{ message }] = errors;\n      expect(message).toEqual(targetExpectedPattern);\n      expect(message).toEqual(expect.stringMatching(\"\\\\(3 errors,\"));\n\n      next = secondPass;\n\n      writeFileSync(target2, \"let bar = false;\\n\");\n      writeFileSync(\n        target,\n        \"const x = require('./watch-leaf')\\n\\nconst foo = false;\\n\",\n      );\n    }\n  });\n});\n"
  },
  {
    "path": "tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"target\": \"esnext\",\n    \"moduleResolution\": \"node\",\n    \"allowJs\": true,\n    \"checkJs\": true,\n    \"strict\": true,\n    \"useUnknownInCatchVariables\": false,\n    \"types\": [\"node\"],\n    \"resolveJsonModule\": true\n  },\n  \"include\": [\"./src/**/*\"]\n}\n"
  },
  {
    "path": "types/ESLintError.d.ts",
    "content": "export = ESLintError;\ndeclare class ESLintError extends Error {\n  /**\n   * @param {string=} messages messages\n   */\n  constructor(messages?: string | undefined);\n  stack: string;\n}\n"
  },
  {
    "path": "types/getESLint.d.ts",
    "content": "export type ESLint = import(\"eslint\").ESLint;\nexport type LintResult = import(\"eslint\").ESLint.LintResult;\nexport type Options = import(\"./options\").Options;\nexport type LintTask = (files: string | string[]) => Promise<LintResult[]>;\nexport type Linter = {\n  eslint: ESLint;\n  lintFiles: LintTask;\n};\nexport type ESLintOptions = import(\"eslint\").ESLint.Options;\nexport type ESLintClass = {\n  new (arg0: ESLintOptions): ESLint;\n  outputFixes: (arg0: LintResult[]) => Promise<void>;\n};\n/** @typedef {import(\"eslint\").ESLint} ESLint */\n/** @typedef {import(\"eslint\").ESLint.LintResult} LintResult */\n/** @typedef {import(\"./options\").Options} Options */\n/** @typedef {(files: string | string[]) => Promise<LintResult[]>} LintTask */\n/** @typedef {{ eslint: ESLint, lintFiles: LintTask }} Linter */\n/** @typedef {import(\"eslint\").ESLint.Options} ESLintOptions */\n/** @typedef {{ new (arg0: ESLintOptions): ESLint, outputFixes: (arg0: LintResult[]) => Promise<void> }} ESLintClass */\n/**\n * @param {Options} options options\n * @returns {Promise<Linter>} linter\n */\nexport function getESLint(options: Options): Promise<Linter>;\n"
  },
  {
    "path": "types/index.d.ts",
    "content": "export = ESLintWebpackPlugin;\ndeclare class ESLintWebpackPlugin {\n  /**\n   * @param {Options=} options options\n   */\n  constructor(options?: Options | undefined);\n  key: string;\n  options: import(\"./options\").PluginOptions;\n  /**\n   * @param {Compiler} compiler compiler\n   * @param {Omit<Options, \"resourceQueryExclude\"> & { resourceQueryExclude: RegExp[] }} options options\n   * @param {string[]} wanted wanted files\n   * @param {string[]} exclude excluded files\n   */\n  run(\n    compiler: Compiler,\n    options: Omit<Options, \"resourceQueryExclude\"> & {\n      resourceQueryExclude: RegExp[];\n    },\n    wanted: string[],\n    exclude: string[],\n  ): Promise<void>;\n  /**\n   * @param {Compiler} compiler compiler\n   * @returns {void}\n   */\n  apply(compiler: Compiler): void;\n  /**\n   * @param {Compiler} compiler compiler\n   * @returns {string} context\n   */\n  getContext(compiler: Compiler): string;\n}\ndeclare namespace ESLintWebpackPlugin {\n  export { Compiler, Module, NormalModule, Options };\n}\ntype Compiler = import(\"webpack\").Compiler;\ntype Module = import(\"webpack\").Module;\ntype NormalModule = import(\"webpack\").NormalModule;\ntype Options = import(\"./options\").Options;\n"
  },
  {
    "path": "types/linter.d.ts",
    "content": "export = linter;\n/**\n * @param {Options} options options\n * @param {Compilation} compilation compilation\n * @returns {Promise<{ lint: Linter, report: Reporter }>} linter with additional functions\n */\ndeclare function linter(\n  options: Options,\n  compilation: Compilation,\n): Promise<{\n  lint: Linter;\n  report: Reporter;\n}>;\ndeclare namespace linter {\n  export {\n    ESLint,\n    Formatter,\n    LintResult,\n    Compiler,\n    Compilation,\n    Options,\n    FormatterFunction,\n    GenerateReport,\n    Report,\n    Reporter,\n    Linter,\n    LintResultMap,\n  };\n}\ntype ESLint = import(\"eslint\").ESLint;\ntype Formatter = import(\"eslint\").ESLint.Formatter;\ntype LintResult = import(\"eslint\").ESLint.LintResult;\ntype Compiler = import(\"webpack\").Compiler;\ntype Compilation = import(\"webpack\").Compilation;\ntype Options = import(\"./options\").Options;\ntype FormatterFunction = import(\"./options\").FormatterFunction;\ntype GenerateReport = (compilation: Compilation) => Promise<void>;\ntype Report = {\n  errors?: ESLintError;\n  warnings?: ESLintError;\n  generateReportAsset?: GenerateReport;\n};\ntype Reporter = () => Promise<Report>;\ntype Linter = (files: string | string[]) => void;\ntype LintResultMap = {\n  [files: string]: LintResult;\n};\nimport ESLintError = require(\"./ESLintError\");\n"
  },
  {
    "path": "types/options.d.ts",
    "content": "export type ESLintOptions = import(\"eslint\").ESLint.Options;\nexport type LintResult = import(\"eslint\").ESLint.LintResult;\nexport type FormatterFunction = (results: LintResult[]) => string;\nexport type OutputReport = {\n  /**\n   * a file path\n   */\n  filePath?: string | undefined;\n  /**\n   * a formatter\n   */\n  formatter?: (string | FormatterFunction) | undefined;\n};\nexport type PluginOptions = {\n  /**\n   * a string indicating the root of your files\n   */\n  context?: string | undefined;\n  /**\n   * the errors found will always be emitted\n   */\n  emitError?: boolean | undefined;\n  /**\n   * the warnings found will always be emitted\n   */\n  emitWarning?: boolean | undefined;\n  /**\n   * specify the files and/or directories to exclude\n   */\n  exclude?: (string | string[]) | undefined;\n  /**\n   * specify the extensions that should be checked\n   */\n  extensions?: (string | string[]) | undefined;\n  /**\n   * will cause the module build to fail if there are any errors\n   */\n  failOnError?: boolean | undefined;\n  /**\n   * will cause the module build to fail if there are any warning\n   */\n  failOnWarning?: boolean | undefined;\n  /**\n   * specify directories, files, or globs\n   */\n  files?: (string | string[]) | undefined;\n  /**\n   * apply fixes\n   */\n  fix?: boolean | undefined;\n  /**\n   * specify the formatter you would like to use to format your results\n   */\n  formatter?: (string | FormatterFunction) | undefined;\n  /**\n   * lint only changed files, skip linting on start\n   */\n  lintDirtyModulesOnly?: boolean | undefined;\n  /**\n   * will process and report errors only and ignore warnings\n   */\n  quiet?: boolean | undefined;\n  /**\n   * path to `eslint` instance that will be used for linting\n   */\n  eslintPath?: string | undefined;\n  /**\n   * writes the output of the errors to a file - for example, a `json` file for use for reporting\n   */\n  outputReport?: OutputReport | undefined;\n  /**\n   * Specify the resource query to exclude\n   */\n  resourceQueryExclude?: (RegExp | RegExp[]) | undefined;\n  /**\n   * config type\n   */\n  configType?: string | undefined;\n};\nexport type Options = PluginOptions & ESLintOptions;\n/**\n * @param {Options} loaderOptions loader options\n * @returns {ESLintOptions} eslint options\n */\nexport function getESLintOptions(loaderOptions: Options): ESLintOptions;\n/** @typedef {import(\"eslint\").ESLint.Options} ESLintOptions */\n/** @typedef {import(\"eslint\").ESLint.LintResult} LintResult */\n/**\n * @callback FormatterFunction\n * @param {LintResult[]} results results\n * @returns {string} formatted result\n */\n/**\n * @typedef {object} OutputReport\n * @property {string=} filePath a file path\n * @property {string | FormatterFunction=} formatter a formatter\n */\n/**\n * @typedef {object} PluginOptions\n * @property {string=} context a string indicating the root of your files\n * @property {boolean=} emitError the errors found will always be emitted\n * @property {boolean=} emitWarning the warnings found will always be emitted\n * @property {string | string[]=} exclude specify the files and/or directories to exclude\n * @property {string | string[]=} extensions specify the extensions that should be checked\n * @property {boolean=} failOnError will cause the module build to fail if there are any errors\n * @property {boolean=} failOnWarning will cause the module build to fail if there are any warning\n * @property {string | string[]=} files specify directories, files, or globs\n * @property {boolean=} fix apply fixes\n * @property {string | FormatterFunction=} formatter specify the formatter you would like to use to format your results\n * @property {boolean=} lintDirtyModulesOnly lint only changed files, skip linting on start\n * @property {boolean=} quiet will process and report errors only and ignore warnings\n * @property {string=} eslintPath path to `eslint` instance that will be used for linting\n * @property {OutputReport=} outputReport writes the output of the errors to a file - for example, a `json` file for use for reporting\n * @property {RegExp | RegExp[]=} resourceQueryExclude Specify the resource query to exclude\n * @property {string=} configType config type\n */\n/** @typedef {PluginOptions & ESLintOptions} Options */\n/**\n * @param {Options} pluginOptions plugin options\n * @returns {PluginOptions} normalized plugin options\n */\nexport function getOptions(pluginOptions: Options): PluginOptions;\n"
  },
  {
    "path": "types/utils.d.ts",
    "content": "export type ArrifyResult<T> = T extends null | undefined\n  ? []\n  : T extends string\n    ? [string]\n    : T extends readonly unknown[]\n      ? T\n      : T extends Iterable<infer T_1>\n        ? T_1[]\n        : [T];\nexport type EXPECTED_ANY = any;\n/**\n * @template T\n * @typedef {T extends (null | undefined)\n * ? []\n * : T extends string\n * ? [string]\n * : T extends readonly unknown[]\n * ? T\n * : T extends Iterable<infer T>\n * ? T[]\n * : [T]} ArrifyResult\n */\n/**\n * @template T\n * @param {T} value value\n * @returns {ArrifyResult<T>} array of values\n */\nexport function arrify<T>(value: T): ArrifyResult<T>;\n/**\n * @param {string | string[]} files files\n * @param {string} context context\n * @returns {string[]} normalized paths\n */\nexport function parseFiles(files: string | string[], context: string): string[];\n/**\n * @param {string | string[]} patterns patterns\n * @param {string | string[]} extensions extensions\n * @returns {string[]} globs\n */\nexport function parseFoldersToGlobs(\n  patterns: string | string[],\n  extensions?: string | string[],\n): string[];\n"
  }
]