Skip to content

Commit 2d93e6c

Browse files
authored
chore: upgrade eslint from v8 to v9 (#536)
1 parent 55ecdaa commit 2d93e6c

Some content is hidden

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

42 files changed

+9678
-5457
lines changed

.cspell.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"version": "0.2",
33
"language": "en,en-gb",
44
"words": [
5-
"Krasnoyarov",
65
"lastname",
76
"firstname",
87
"memfs",
@@ -38,7 +37,8 @@
3837
"Gitter",
3938
"commitlint",
4039
"postprocessor",
41-
"eslintcache"
40+
"eslintcache",
41+
"cspellcache"
4242
],
4343
"ignorePaths": [
4444
"CHANGELOG.md",
@@ -52,6 +52,7 @@
5252
"*.webp",
5353
"node_modules",
5454
"coverage",
55-
"*.log"
55+
"*.log",
56+
"test/outputs/url/**"
5657
]
5758
}

.eslintignore

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

.eslintrc.js

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

.prettierignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
/dist
33
/node_modules
44
/test/fixtures
5-
CHANGELOG.md
5+
CHANGELOG.md
6+
test/outputs/url/**

README.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ Type:
7575
type sources =
7676
| boolean
7777
| {
78-
list?: Array<{
78+
list?: {
7979
tag?: string;
8080
attribute?: string;
8181
type?: string;
@@ -85,7 +85,7 @@ type sources =
8585
attributes: string,
8686
resourcePath: string,
8787
) => boolean;
88-
}>;
88+
}[];
8989
urlFilter?: (
9090
attribute: string,
9191
value: string,
@@ -204,7 +204,7 @@ module.exports = {
204204
Type:
205205

206206
```ts
207-
type list = Array<{
207+
type list = {
208208
tag?: string;
209209
attribute?: string;
210210
type?: string;
@@ -214,7 +214,7 @@ type list = Array<{
214214
attributes: string,
215215
resourcePath: string,
216216
) => boolean;
217-
}>;
217+
}[];
218218
```
219219

220220
Default: [supported tags and attributes](#sources).
@@ -314,15 +314,14 @@ module.exports = {
314314
// Type of processing, can be `src` or `scrset`
315315
type: "src",
316316
// Allow to filter some attributes (optional)
317-
filter: (tag, attribute, attributes, resourcePath) => {
317+
filter: (tag, attribute, attributes, resourcePath) =>
318318
// The `tag` argument contains a name of the HTML tag.
319319
// The `attribute` argument contains a name of the HTML attribute.
320320
// The `attributes` argument contains all attributes of the tag.
321321
// The `resourcePath` argument contains a path to the loaded HTML file.
322322

323323
// choose all HTML tags except img tag
324-
return tag.toLowerCase() !== "img";
325-
},
324+
tag.toLowerCase() !== "img",
326325
},
327326
],
328327
},
@@ -633,8 +632,8 @@ module.exports = {
633632
const isTemplateLiteralSupported = content[0] === "`";
634633

635634
return content
636-
.replace(/<%=/g, isTemplateLiteralSupported ? `\${` : '" +')
637-
.replace(/%>/g, isTemplateLiteralSupported ? "}" : '+ "');
635+
.replaceAll("<%=", isTemplateLiteralSupported ? "${" : '" +')
636+
.replaceAll("%>", isTemplateLiteralSupported ? "}" : '+ "');
638637
},
639638
},
640639
},
@@ -665,8 +664,8 @@ module.exports = {
665664
const isTemplateLiteralSupported = content[0] === "`";
666665

667666
return content
668-
.replace(/<%=/g, isTemplateLiteralSupported ? `\${` : '" +')
669-
.replace(/%>/g, isTemplateLiteralSupported ? "}" : '+ "')
667+
.replaceAll("<%=", isTemplateLiteralSupported ? "${" : '" +')
668+
.replaceAll("%>", isTemplateLiteralSupported ? "}" : '+ "')
670669
.replace("my-value", value);
671670
},
672671
},

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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
module.exports = {
2+
testTimeout: 20000,
23
collectCoverageFrom: ["src/**/*.js"],
3-
setupFilesAfterEnv: ["<rootDir>/setupTest.js"],
44
};

0 commit comments

Comments
 (0)