Skip to content

Commit 3d7d7d3

Browse files
chore: migrate to eslint version 9 (#371)
1 parent 9a062d9 commit 3d7d7d3

Some content is hidden

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

52 files changed

+3475
-1179
lines changed

.eslintignore

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

.eslintrc.js

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

.prettierrc.js

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

README.md

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ pnpm add -D stylelint
6363
Then add the plugin to your webpack configuration. For example:
6464

6565
```js
66-
const StylelintPlugin = require('stylelint-webpack-plugin');
66+
const StylelintPlugin = require("stylelint-webpack-plugin");
6767

6868
module.exports = {
6969
// ...
@@ -133,7 +133,7 @@ A string indicating the root of your files.
133133
- Type:
134134

135135
```ts
136-
type exclude = string | Array<string>;
136+
type exclude = string | string[];
137137
```
138138

139139
- Default: `['node_modules', compiler.options.output.path]`
@@ -145,7 +145,7 @@ Specify the files and/or directories to exclude. Must be relative to `options.co
145145
- Type:
146146

147147
```ts
148-
type extensions = string | Array<string>;
148+
type extensions = string | string[];
149149
```
150150

151151
- Default: `['css', 'scss', 'sass']`
@@ -157,7 +157,7 @@ Specify the extensions that should be checked.
157157
- Type:
158158

159159
```ts
160-
type files = string | Array<string>;
160+
type files = string | string[];
161161
```
162162

163163
- Default: `null`
@@ -181,9 +181,9 @@ If `true`, `stylelint` will fix as many errors as possible. The fixes are made t
181181
- Type:
182182

183183
```ts
184-
type formatter = string | (
185-
results: Array<import('stylelint').LintResult>
186-
) => string
184+
type formatter =
185+
| string
186+
| ((results: import("stylelint").LintResult[]) => string);
187187
```
188188

189189
- Default: `'string'`
@@ -304,10 +304,7 @@ type outputReport =
304304
| {
305305
filePath?: string | undefined;
306306
formatter?:
307-
| (
308-
| string
309-
| ((results: Array<import('stylelint').LintResult>) => string)
310-
)
307+
| (string | ((results: import("stylelint").LintResult[]) => string))
311308
| undefined;
312309
};
313310
```
@@ -321,10 +318,10 @@ The `filePath` is relative to the webpack config: `output.path`.
321318
You can pass in a different formatter for the output file. If none is passed in the default/configured formatter will be used.
322319

323320
```js
324-
{
325-
filePath: 'path/to/file';
326-
formatter: 'json';
327-
}
321+
const outputReport = {
322+
filePath: "path/to/file",
323+
formatter: "json",
324+
};
328325
```
329326

330327
## Changelog

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: '18.12.0',
13+
node: "18.12.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+
]);

jest.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = {
2-
collectCoverageFrom: ['src/**/*.js'],
2+
collectCoverageFrom: ["src/**/*.js"],
33
collectCoverage: true,
4-
testEnvironment: 'node',
4+
testEnvironment: "node",
55
testTimeout: 60000,
66
};

lint-staged.config.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module.exports = {
2-
'*': [
3-
'prettier --cache --write --ignore-unknown',
4-
'cspell --cache --no-must-find-files',
2+
"*": [
3+
"prettier --cache --write --ignore-unknown",
4+
"cspell --cache --no-must-find-files",
55
],
6-
'*.js': ['eslint --cache --fix'],
6+
"*.js": ["eslint --cache --fix"],
77
};

0 commit comments

Comments
 (0)