Skip to content
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

feat: allow '*' wild card for tag option #273

Merged
merged 11 commits into from Apr 1, 2020

Conversation

EslamHiko
Copy link
Contributor

This PR contains a:

  • bugfix
  • new feature
  • code refactor
  • test update
  • typo fix
  • metadata update

Motivation / Use-Case

solve : #267

Breaking Changes

No

Additional Info

README.md Outdated
list: [
{
// Tag name
tag: '*', // or tag: ''
Copy link
Member

Choose a reason for hiding this comment

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

No need to support tag: '*', if you don't provide tag try to use on all attributes, i.e tag can be string or undefined (not specify)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It will work now when the string is empty or it's undefined

src/options.json Outdated
@@ -5,8 +5,7 @@
"type": "object",
"properties": {
"tag": {
"type": "string",
"minLength": 1
"type": "string"
Copy link
Member

Choose a reason for hiding this comment

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

Need to return it to minLength to 1

// eslint-disable-next-line no-undefined
element.tag === undefined ||
// eslint-disable-next-line no-undefined
(element.tag !== undefined && !element.tag.length)) &&
Copy link
Member

Choose a reason for hiding this comment

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

I think we can simplify it

attributes: {
list: [
{
tag: '',
Copy link
Member

Choose a reason for hiding this comment

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

Should throw a validation error

} catch (e) {
expect(e.message.search('ValidationError')).not.toEqual(-1);
}
});
Copy link
Member

Choose a reason for hiding this comment

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

Move it to validation.test.js

// eslint-disable-next-line no-undefined
(element.tag === undefined ||
// eslint-disable-next-line no-undefined
(element.tag !== undefined &&
Copy link
Member

Choose a reason for hiding this comment

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

Use type of value === "undefined" to avoid disable the rule

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done 👍

@alexander-akait alexander-akait merged commit c0d6d5b into webpack-contrib:master Apr 1, 2020
@alexander-akait
Copy link
Member

Thanks!

@EslamHiko EslamHiko deleted the issue-267 branch April 1, 2020 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants