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
Conversation
README.md
Outdated
list: [ | ||
{ | ||
// Tag name | ||
tag: '*', // or tag: '' |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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
src/plugins/source-plugin.js
Outdated
// eslint-disable-next-line no-undefined | ||
element.tag === undefined || | ||
// eslint-disable-next-line no-undefined | ||
(element.tag !== undefined && !element.tag.length)) && |
There was a problem hiding this comment.
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
test/attributes-option.test.js
Outdated
attributes: { | ||
list: [ | ||
{ | ||
tag: '', |
There was a problem hiding this comment.
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
test/attributes-option.test.js
Outdated
} catch (e) { | ||
expect(e.message.search('ValidationError')).not.toEqual(-1); | ||
} | ||
}); |
There was a problem hiding this comment.
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
src/plugins/source-plugin.js
Outdated
// eslint-disable-next-line no-undefined | ||
(element.tag === undefined || | ||
// eslint-disable-next-line no-undefined | ||
(element.tag !== undefined && |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done 👍
Thanks! |
This PR contains a:
Motivation / Use-Case
solve : #267
Breaking Changes
No
Additional Info