Skip to content

Commit

Permalink
Fix function-calc-no-unspaced-operator performance (#6923)
Browse files Browse the repository at this point in the history
Co-authored-by: Masafumi Koba <473530+ybiquitous@users.noreply.github.com>
  • Loading branch information
romainmenke and ybiquitous committed Jun 17, 2023
1 parent aba1d97 commit 0e4d302
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/wet-countries-think.md
@@ -0,0 +1,5 @@
---
"stylelint": patch
---

Fixed: `function-calc-no-unspaced-operator` performance
6 changes: 5 additions & 1 deletion lib/rules/function-calc-no-unspaced-operator/index.js
Expand Up @@ -48,9 +48,13 @@ const rule = (primary, _secondaryOptions, context) => {
}

root.walkDecls((decl) => {
const value = getDeclarationValue(decl);

if (!OPERATOR_REGEX.test(value)) return;

let needsFix = false;
const valueIndex = declarationValueIndex(decl);
const parsedValue = valueParser(getDeclarationValue(decl));
const parsedValue = valueParser(value);

/**
* @param {import('postcss-value-parser').Node} operatorNode
Expand Down

0 comments on commit 0e4d302

Please sign in to comment.