Skip to content

Commit

Permalink
Fix TypeError for shorthand animation in time-min-milliseconds (#4783)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeddy3 committed May 18, 2020
1 parent f88bcd5 commit 90d4fe2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
18 changes: 18 additions & 0 deletions lib/rules/time-min-milliseconds/__tests__/index.js
Expand Up @@ -9,6 +9,15 @@ testRule({
config: [MIN_VALUE],

accept: [
{
code: 'a { animation: none; }',
},
{
code: 'a { animation: none, my-animation; }',
},
{
code: 'a { transition: opacity var(--x) var(--y) ease-out }',
},
{
code: 'a { transition-delay: 0.1s; }',
},
Expand Down Expand Up @@ -314,6 +323,15 @@ testRule({
config: [MIN_VALUE, { ignore: ['delay'] }],

accept: [
{
code: 'a { animation: none; }',
},
{
code: 'a { animation: none, my-animation; }',
},
{
code: 'a { transition: opacity var(--x) var(--y) ease-out }',
},
{
code: 'a { transition-duration: 0.15s; }',
},
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/time-min-milliseconds/index.js
Expand Up @@ -63,7 +63,7 @@ function rule(minimum, options) {
// Check only duration time values
const duration = getDuration(valueList);

if (!isAcceptableTime(duration)) {
if (duration && !isAcceptableTime(duration)) {
complain(decl, decl.value.indexOf(duration));
}
} else {
Expand Down

0 comments on commit 90d4fe2

Please sign in to comment.