Skip to content

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
"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

@alexander-akait alexander-akait Mar 31, 2020

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.

2 participants