Skip to content

Commit f291d3f

Browse files
chore: migrate to eslint version 9 (#288)
1 parent ae99560 commit f291d3f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+3864
-1165
lines changed

.eslintignore

Lines changed: 0 additions & 6 deletions
This file was deleted.

.eslintrc.js

Lines changed: 0 additions & 24 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ yarn-debug.log*
99
/local
1010
/reports
1111
/node_modules
12-
/test/output
12+
/test/outputs
1313

1414
.DS_Store
1515
Thumbs.db

.prettierrc.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

README.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ pnpm add -D eslint
5959
Then add the plugin to your webpack configuration. For example:
6060

6161
```js
62-
const ESLintPlugin = require('eslint-webpack-plugin');
62+
const ESLintPlugin = require("eslint-webpack-plugin");
6363

6464
module.exports = {
6565
// ...
@@ -111,7 +111,7 @@ Specify the path to the cache location. Can be a file or a directory.
111111
- Type:
112112

113113
```ts
114-
type configType = 'flat' | 'eslintrc';
114+
type configType = "flat" | "eslintrc";
115115
```
116116

117117
- Default: `flat`
@@ -154,7 +154,7 @@ If the `eslintPath` is a folder like a official ESlint, or specify a `formatter`
154154
- Type:
155155

156156
```ts
157-
type extensions = string | Array<string>;
157+
type extensions = string | string[];
158158
```
159159

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

168168
```ts
169-
type exclude = string | Array<string>;
169+
type exclude = string | string[];
170170
```
171171

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

180180
```ts
181-
type resourceQueryExclude = RegExp | Array<RegExp>;
181+
type resourceQueryExclude = RegExp | RegExp[];
182182
```
183183

184184
- Default: `[]`
@@ -190,7 +190,7 @@ Specify the resource query to exclude.
190190
- Type:
191191

192192
```ts
193-
type files = string | Array<string>;
193+
type files = string | string[];
194194
```
195195

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

220220
```ts
221-
type formatter = string| (
222-
results: Array<import('eslint').ESLint.LintResult>,
223-
data?: import('eslint').ESLint.LintResultData | undefined
224-
) => string
221+
type formatter =
222+
| string
223+
| ((
224+
results: import("eslint").ESLint.LintResult[],
225+
data?: import("eslint").ESLint.LintResultData | undefined,
226+
) => string);
225227
```
226228

227229
- Default: `'stylish'`
@@ -333,8 +335,8 @@ type outputReport =
333335
| (
334336
| string
335337
| ((
336-
results: Array<import('eslint').ESLint.LintResult>,
337-
data?: import('eslint').ESLint.LintResultData | undefined,
338+
results: import("eslint").ESLint.LintResult[],
339+
data?: import("eslint").ESLint.LintResultData | undefined,
338340
) => string)
339341
)
340342
| undefined;

babel.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ module.exports = (api) => {
77
return {
88
presets: [
99
[
10-
'@babel/preset-env',
10+
"@babel/preset-env",
1111
{
1212
targets: {
13-
node: '14.15.0',
13+
node: "14.15.0",
1414
},
1515
},
1616
],

commitlint.config.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
module.exports = {
2-
extends: ['@commitlint/config-conventional'],
2+
extends: ["@commitlint/config-conventional"],
33
rules: {
4-
'header-max-length': [0],
5-
'body-max-line-length': [0],
6-
'footer-max-line-length': [0],
4+
"header-max-length": [0],
5+
"body-max-line-length": [0],
6+
"footer-max-line-length": [0],
77
},
88
};

eslint.config.mjs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { defineConfig } from "eslint/config";
2+
import configs from "eslint-config-webpack/configs.js";
3+
4+
export default defineConfig([
5+
{
6+
extends: [configs["recommended-dirty"]],
7+
},
8+
]);

husky.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = {
22
hooks: {
3-
'pre-commit': 'lint-staged',
4-
'commit-msg': 'commitlint -E HUSKY_GIT_PARAMS',
3+
"pre-commit": "lint-staged",
4+
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
55
},
66
};

jest.config.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
module.exports = {
22
collectCoverage: true,
3-
testEnvironment: 'node',
3+
collectCoverageFrom: ["src/**/*"],
4+
testEnvironment: "node",
45
testTimeout: 60000,
5-
transformIgnorePatterns: ['node_modules/(?!(arrify)/)'],
6+
transformIgnorePatterns: ["node_modules/(?!(arrify)/)"],
67
};

0 commit comments

Comments
 (0)