Skip to content

chore: migrate to eslint version 9 #288

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Aug 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .eslintignore

This file was deleted.

24 changes: 0 additions & 24 deletions .eslintrc.js

This file was deleted.

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ yarn-debug.log*
/local
/reports
/node_modules
/test/output
/test/outputs

.DS_Store
Thumbs.db
Expand Down
1 change: 0 additions & 1 deletion .prettierrc.js

This file was deleted.

26 changes: 14 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ pnpm add -D eslint
Then add the plugin to your webpack configuration. For example:

```js
const ESLintPlugin = require('eslint-webpack-plugin');
const ESLintPlugin = require("eslint-webpack-plugin");

module.exports = {
// ...
Expand Down Expand Up @@ -111,7 +111,7 @@ Specify the path to the cache location. Can be a file or a directory.
- Type:

```ts
type configType = 'flat' | 'eslintrc';
type configType = "flat" | "eslintrc";
```

- Default: `flat`
Expand Down Expand Up @@ -154,7 +154,7 @@ If the `eslintPath` is a folder like a official ESlint, or specify a `formatter`
- Type:

```ts
type extensions = string | Array<string>;
type extensions = string | string[];
```

- Default: `'js'`
Expand All @@ -166,7 +166,7 @@ Specify file extensions that should be checked.
- Type:

```ts
type exclude = string | Array<string>;
type exclude = string | string[];
```

- Default: `'node_modules'`
Expand All @@ -178,7 +178,7 @@ Specify the files/directories to exclude. Must be relative to `options.context`.
- Type:

```ts
type resourceQueryExclude = RegExp | Array<RegExp>;
type resourceQueryExclude = RegExp | RegExp[];
```

- Default: `[]`
Expand All @@ -190,7 +190,7 @@ Specify the resource query to exclude.
- Type:

```ts
type files = string | Array<string>;
type files = string | string[];
```

- Default: `null`
Expand Down Expand Up @@ -218,10 +218,12 @@ Will enable [ESLint autofix feature](https://eslint.org/docs/developer-guide/nod
- Type:

```ts
type formatter = string| (
results: Array<import('eslint').ESLint.LintResult>,
data?: import('eslint').ESLint.LintResultData | undefined
) => string
type formatter =
| string
| ((
results: import("eslint").ESLint.LintResult[],
data?: import("eslint").ESLint.LintResultData | undefined,
) => string);
```

- Default: `'stylish'`
Expand Down Expand Up @@ -333,8 +335,8 @@ type outputReport =
| (
| string
| ((
results: Array<import('eslint').ESLint.LintResult>,
data?: import('eslint').ESLint.LintResultData | undefined,
results: import("eslint").ESLint.LintResult[],
data?: import("eslint").ESLint.LintResultData | undefined,
) => string)
)
| undefined;
Expand Down
4 changes: 2 additions & 2 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ module.exports = (api) => {
return {
presets: [
[
'@babel/preset-env',
"@babel/preset-env",
{
targets: {
node: '14.15.0',
node: "14.15.0",
},
},
],
Expand Down
8 changes: 4 additions & 4 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
extends: ["@commitlint/config-conventional"],
rules: {
'header-max-length': [0],
'body-max-line-length': [0],
'footer-max-line-length': [0],
"header-max-length": [0],
"body-max-line-length": [0],
"footer-max-line-length": [0],
},
};
8 changes: 8 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { defineConfig } from "eslint/config";
import configs from "eslint-config-webpack/configs.js";

export default defineConfig([
{
extends: [configs["recommended-dirty"]],
},
]);
4 changes: 2 additions & 2 deletions husky.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
hooks: {
'pre-commit': 'lint-staged',
'commit-msg': 'commitlint -E HUSKY_GIT_PARAMS',
"pre-commit": "lint-staged",
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
},
};
5 changes: 3 additions & 2 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module.exports = {
collectCoverage: true,
testEnvironment: 'node',
collectCoverageFrom: ["src/**/*"],
testEnvironment: "node",
testTimeout: 60000,
transformIgnorePatterns: ['node_modules/(?!(arrify)/)'],
transformIgnorePatterns: ["node_modules/(?!(arrify)/)"],
};
4 changes: 2 additions & 2 deletions lint-staged.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
'*.js': ['eslint --fix', 'prettier --write', 'cspell'],
'*.{json,md,yml,css,ts}': ['prettier --write'],
"*.js": ["eslint --fix", "prettier --write", "cspell"],
"*.{json,md,yml,css,ts}": ["prettier --write"],
};
Loading
Loading