Skip to content

chore: upgrade eslint from v8 to v9 #536

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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
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
3 changes: 2 additions & 1 deletion .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"*.webp",
"node_modules",
"coverage",
"*.log"
"*.log",
"test/lock-files/url/**"
]
}
4 changes: 0 additions & 4 deletions .eslintignore

This file was deleted.

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

This file was deleted.

3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
/dist
/node_modules
/test/fixtures
CHANGELOG.md
CHANGELOG.md
test/lock-files/url/**
21 changes: 10 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Type:
type sources =
| boolean
| {
list?: Array<{
list?: {
tag?: string;
attribute?: string;
type?: string;
Expand All @@ -85,7 +85,7 @@ type sources =
attributes: string,
resourcePath: string,
) => boolean;
}>;
}[];
urlFilter?: (
attribute: string,
value: string,
Expand Down Expand Up @@ -204,7 +204,7 @@ module.exports = {
Type:

```ts
type list = Array<{
type list = {
tag?: string;
attribute?: string;
type?: string;
Expand All @@ -214,7 +214,7 @@ type list = Array<{
attributes: string,
resourcePath: string,
) => boolean;
}>;
}[];
```

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

// choose all HTML tags except img tag
return tag.toLowerCase() !== "img";
},
tag.toLowerCase() !== "img",
},
],
},
Expand Down Expand Up @@ -633,8 +632,8 @@ module.exports = {
const isTemplateLiteralSupported = content[0] === "`";

return content
.replace(/<%=/g, isTemplateLiteralSupported ? `\${` : '" +')
.replace(/%>/g, isTemplateLiteralSupported ? "}" : '+ "');
.replaceAll("<%=", isTemplateLiteralSupported ? "${" : '" +')
.replaceAll("%>", isTemplateLiteralSupported ? "}" : '+ "');
},
},
},
Expand Down Expand Up @@ -665,8 +664,8 @@ module.exports = {
const isTemplateLiteralSupported = content[0] === "`";

return content
.replace(/<%=/g, isTemplateLiteralSupported ? `\${` : '" +')
.replace(/%>/g, isTemplateLiteralSupported ? "}" : '+ "')
.replaceAll("<%=", isTemplateLiteralSupported ? "${" : '" +')
.replaceAll("%>", isTemplateLiteralSupported ? "}" : '+ "')
.replace("my-value", value);
},
},
Expand Down
11 changes: 11 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { defineConfig } from "eslint/config";
import configs from "eslint-config-webpack/configs.js";

export default defineConfig([
{
ignores: ["test/lock-files/url/**"],
},
{
extends: [configs["recommended-dirty"]],
},
]);
Loading
Loading