Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
romainmenke committed Jun 3, 2023
1 parent b9647c9 commit f807664
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
11 changes: 3 additions & 8 deletions lib/rules/unit-disallowed-list/__tests__/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,9 @@ testRule({
{
code: 'a { margin: min(calc(50px * 2)) }',
},
{
code: 'a { margin: calc(max(50px)) }',
},
{
code: 'a { transform: translate(100px, 100px) }',
},
Expand All @@ -422,14 +425,6 @@ testRule({
endLine: 1,
endColumn: 18,
},
{
code: 'a { margin: calc(max(50px)) }',
message: messages.rejected('px'),
line: 1,
column: 24,
endLine: 1,
endColumn: 26,
},
{
code: 'a { translate: 100px }',
message: messages.rejected('px'),
Expand Down
6 changes: 5 additions & 1 deletion lib/rules/unit-disallowed-list/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ const rule = (primary, secondaryOptions) => {
(entry) => {
if (!entry.state) return;

if (entry.state.ignored) return;

if (isTokenNode(entry.node) && !entry.state.ignored) {
check(
decl,
Expand All @@ -181,7 +183,9 @@ const rule = (primary, secondaryOptions) => {
);
}

entry.state.ignored = componentValueIsIgnored(entry.node);
if (componentValueIsIgnored(entry.node)) {
entry.state.ignored = true;
}
},
{
ignored: componentValueIsIgnored(componentValue),
Expand Down

0 comments on commit f807664

Please sign in to comment.