Skip to content

Commit 1518bd1

Browse files
committed
chore: upgrade eslint from v8 to v9
1 parent 55ecdaa commit 1518bd1

34 files changed

+5658
-1610
lines changed

.eslintignore

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

.eslintrc.js

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

README.md

Lines changed: 11 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,15 @@ 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"
325+
,
326326
},
327327
],
328328
},
@@ -633,8 +633,8 @@ module.exports = {
633633
const isTemplateLiteralSupported = content[0] === "`";
634634

635635
return content
636-
.replace(/<%=/g, isTemplateLiteralSupported ? `\${` : '" +')
637-
.replace(/%>/g, isTemplateLiteralSupported ? "}" : '+ "');
636+
.replaceAll("<%=", isTemplateLiteralSupported ? "${" : '" +')
637+
.replaceAll("%>", isTemplateLiteralSupported ? "}" : '+ "');
638638
},
639639
},
640640
},
@@ -665,8 +665,8 @@ module.exports = {
665665
const isTemplateLiteralSupported = content[0] === "`";
666666

667667
return content
668-
.replace(/<%=/g, isTemplateLiteralSupported ? `\${` : '" +')
669-
.replace(/%>/g, isTemplateLiteralSupported ? "}" : '+ "')
668+
.replaceAll("<%=", isTemplateLiteralSupported ? "${" : '" +')
669+
.replaceAll("%>", isTemplateLiteralSupported ? "}" : '+ "')
670670
.replace("my-value", value);
671671
},
672672
},

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+
]);

0 commit comments

Comments
 (0)