Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 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/**"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's save it in test/outputs, we are ignoring this path by default - https://github.com/webpack/eslint-config-webpack/blob/main/ignore-paths.js#L55C8-L55C15, just change a test

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2025-07-26 at 8 58 24 PM we need to ignore it in cspell.json

]
}
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/**
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And remove it from here

Copy link
Contributor Author

@ersachin3112 ersachin3112 Jul 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2025-07-26 at 8 56 11 PM we need to ignore it in prettier too

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/**"],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And here

},
{
extends: [configs["recommended-dirty"]],
},
]);
Loading
Loading