Skip to content

Fix declaration-property-value-no-unknown performance#9090

Merged
jeddy3 merged 6 commits intomainfrom
fix-dpvnp-perf
Feb 20, 2026
Merged

Fix declaration-property-value-no-unknown performance#9090
jeddy3 merged 6 commits intomainfrom
fix-dpvnp-perf

Conversation

@jeddy3
Copy link
Copy Markdown
Member

@jeddy3 jeddy3 commented Feb 18, 2026

Which issue, if any, is this issue related to?

Performance fix.

Is there anything in the PR that needs further explanation?

The rule checks every property-value pair, but these are often repeated within and across files, e.g. margin: 0 or display: block.

This PR adds a cache to reduce repeated parsing and lexer matching.

Comparison between main and this branch (extending the standard config in the workspaces):

  Size      Baseline    Current     Diff        Change    Status    
  ────────────────────────────────────────────────────────────────────────────
  Small     161.29ms    157.00ms    4.29ms      -2.7%     ≈ Same    
  Medium    318.08ms    295.18ms    22.90ms     -7.2%     ✓ Faster  
  Large     994.32ms    893.72ms    100.60ms    -10.1%    ✓ Faster  
  X-Large   1.78s       1.54s       239.68ms    -13.5%    ✓ Faster  
  ────────────────────────────────────────────────────────────────────────────

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Feb 18, 2026

🦋 Changeset detected

Latest commit: 2c71316

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
stylelint Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@jeddy3 jeddy3 changed the title Fix dpvnp perf Fix declaration-property-value-no-unknown performance Feb 18, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 18, 2026

This PR is packaged and the instant preview is available (2c71316). View the demo website.

Install it locally:

npm i -D https://pkg.pr.new/stylelint@2c71316

Copy link
Copy Markdown
Member

@romainmenke romainmenke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it maybe sufficient to only cache those inputs that are valid?
Most CSS bits will be valid or gravitate towards becoming valid as most authors use Stylelint to remove issues.

This can simplify the cache mechanics to use a Set.

@jeddy3
Copy link
Copy Markdown
Member Author

jeddy3 commented Feb 19, 2026

That's a cleaner approach, thanks!

I've pushed a commit to simplify the implementation. Performance gains are comparable.

Copy link
Copy Markdown
Member

@romainmenke romainmenke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, indeed much cleaner :)

I have one remaining concern with a caching approach but the performance improvements look really promising.

Comment thread lib/rules/declaration-property-value-no-unknown/index.mjs
Copy link
Copy Markdown
Member

@romainmenke romainmenke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!
Thank you for continuing to work on improving performance 🚀

@jeddy3 jeddy3 merged commit 5cb93be into main Feb 20, 2026
19 checks passed
@jeddy3 jeddy3 deleted the fix-dpvnp-perf branch February 20, 2026 14:33
robbevp pushed a commit to robbevp/website-robbevanpetegem that referenced this pull request Feb 28, 2026
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [eslint](https://eslint.org) ([source](https://github.com/eslint/eslint)) | devDependencies | patch | [`9.39.2` -> `9.39.3`](https://renovatebot.com/diffs/npm/eslint/9.39.2/9.39.3) |
| [prettier](https://prettier.io) ([source](https://github.com/prettier/prettier)) | devDependencies | patch | [`3.8.0` -> `3.8.1`](https://renovatebot.com/diffs/npm/prettier/3.8.0/3.8.1) |
| [stylelint](https://stylelint.io) ([source](https://github.com/stylelint/stylelint)) | devDependencies | minor | [`17.0.0` -> `17.4.0`](https://renovatebot.com/diffs/npm/stylelint/17.0.0/17.4.0) |

---

### Release Notes

<details>
<summary>eslint/eslint (eslint)</summary>

### [`v9.39.3`](https://github.com/eslint/eslint/releases/tag/v9.39.3)

[Compare Source](eslint/eslint@v9.39.2...v9.39.3)

#### Bug Fixes

- [`791bf8d`](eslint/eslint@791bf8d) fix: restore TypeScript 4.0 compatibility in types ([#&#8203;20504](eslint/eslint#20504)) (sethamus)

#### Chores

- [`8594a43`](eslint/eslint@8594a43) chore: upgrade [@&#8203;eslint/js](https://github.com/eslint/js)@&#8203;9.39.3 ([#&#8203;20529](eslint/eslint#20529)) (Milos Djermanovic)
- [`9ceef92`](eslint/eslint@9ceef92) chore: package.json update for [@&#8203;eslint/js](https://github.com/eslint/js) release (Jenkins)
- [`af498c6`](eslint/eslint@af498c6) chore: ignore `/docs/v9.x` in link checker ([#&#8203;20453](eslint/eslint#20453)) (Milos Djermanovic)

</details>

<details>
<summary>prettier/prettier (prettier)</summary>

### [`v3.8.1`](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#381)

[Compare Source](prettier/prettier@3.8.0...3.8.1)

[diff](prettier/prettier@3.8.0...3.8.1)

##### Include available `printers` in plugin type declarations ([#&#8203;18706](prettier/prettier#18706) by [@&#8203;porada](https://github.com/porada))

<!-- prettier-ignore -->

```ts
// Input
import * as prettierPluginEstree from "prettier/plugins/estree";

// Prettier 3.8.0
// Property 'printers' does not exist on type 'typeof import("prettier/plugins/estree")'. ts(2339)
prettierPluginEstree.printers.estree; //=> any

// Prettier 3.8.1
prettierPluginEstree.printers.estree; //=> Printer
prettierPluginEstree.printers["estree-json"]; //=> Printer
```

</details>

<details>
<summary>stylelint/stylelint (stylelint)</summary>

### [`v17.4.0`](https://github.com/stylelint/stylelint/blob/HEAD/CHANGELOG.md#1740---2026-02-25)

[Compare Source](stylelint/stylelint@17.3.0...17.4.0)

It adds 2 options to the rules and fixes 7 bugs.

- Added: `ignoreAtRules: []` to `at-rule-no-vendor-prefix` ([#&#8203;9096](stylelint/stylelint#9096)) ([@&#8203;theacrat](https://github.com/theacrat)).
- Added: `ignoreMediaFeatureNames: []` to `media-feature-name-no-vendor-prefix` ([#&#8203;9097](stylelint/stylelint#9097)) ([@&#8203;theacrat](https://github.com/theacrat)).
- Fixed: performance of selector cloning rules ([#&#8203;9089](stylelint/stylelint#9089)) ([@&#8203;jeddy3](https://github.com/jeddy3)).
- Fixed: `*-empty-line-before` performance ([#&#8203;9092](stylelint/stylelint#9092)) ([@&#8203;jeddy3](https://github.com/jeddy3)).
- Fixed: `declaration-property-value-no-unknown` performance ([#&#8203;9090](stylelint/stylelint#9090)) ([@&#8203;jeddy3](https://github.com/jeddy3)).
- Fixed: `no-irregular-whitespace` performance ([#&#8203;9091](stylelint/stylelint#9091)) ([@&#8203;jeddy3](https://github.com/jeddy3)).
- Fixed: `property-no-unknown` false negatives for at-rule descriptors ([#&#8203;9109](stylelint/stylelint#9109)) ([@&#8203;jeddy3](https://github.com/jeddy3)).
- Fixed: `property-no-unknown` false positives for `corner-shape` ([#&#8203;9099](stylelint/stylelint#9099)) ([@&#8203;jeddy3](https://github.com/jeddy3)).
- Fixed: `property-no-unknown` false positives for double-slashed properties ([#&#8203;9099](stylelint/stylelint#9099)) ([@&#8203;jeddy3](https://github.com/jeddy3)).

### [`v17.3.0`](https://github.com/stylelint/stylelint/blob/HEAD/CHANGELOG.md#1730---2026-02-13)

[Compare Source](stylelint/stylelint@17.2.0...17.3.0)

It fixes 17 bugs. 3 related to supporting `calc()` in `declaration-property-value-no-unknown`, and 13 performance ones that make Stylelint a further 3x faster when using the rules in our [standard config](https://www.npmjs.com/package/stylelint-config-standard).

- Fixed: performance of rule sequencing ([#&#8203;9055](stylelint/stylelint#9055)) ([@&#8203;jeddy3](https://github.com/jeddy3)).
- Fixed: `*-list` performance ([#&#8203;9056](stylelint/stylelint#9056)) ([@&#8203;jeddy3](https://github.com/jeddy3)).
- Fixed: `*-notation` performance ([#&#8203;9044](stylelint/stylelint#9044)) ([@&#8203;jeddy3](https://github.com/jeddy3)).
- Fixed: `declaration-property-max-values` performance ([#&#8203;9057](stylelint/stylelint#9057)) ([@&#8203;jeddy3](https://github.com/jeddy3)).
- Fixed: `declaration-property-value-keyword-no-deprecated` performance ([#&#8203;9058](stylelint/stylelint#9058)) ([@&#8203;jeddy3](https://github.com/jeddy3)).
- Fixed: `declaration-property-value-no-unknown` false negatives for math functions inside of non-math functions ([#&#8203;9064](stylelint/stylelint#9064)) ([@&#8203;romainmenke](https://github.com/romainmenke)).
- Fixed: `declaration-property-value-no-unknown` false positives for `calc()` with mixed operations ([#&#8203;9064](stylelint/stylelint#9064)) ([@&#8203;romainmenke](https://github.com/romainmenke)).
- Fixed: `declaration-property-value-no-unknown` performance ([#&#8203;9062](stylelint/stylelint#9062)) ([@&#8203;jeddy3](https://github.com/jeddy3)).
- Fixed: `declaration-property-value-no-unknown` reported ranges for multiple math functions ([#&#8203;9064](stylelint/stylelint#9064)) ([@&#8203;romainmenke](https://github.com/romainmenke)).
- Fixed: `length-zero-no-unit` performance ([#&#8203;9046](stylelint/stylelint#9046)) ([@&#8203;jeddy3](https://github.com/jeddy3)).
- Fixed: `named-grid-areas-no-invalid` false positives for mix of tabs and spaces ([#&#8203;9039](stylelint/stylelint#9039)) ([@&#8203;adalinesimonian](https://github.com/adalinesimonian)).
- Fixed: `no-unknown-custom-media` performance ([#&#8203;9059](stylelint/stylelint#9059)) ([@&#8203;jeddy3](https://github.com/jeddy3)).
- Fixed: `selector-max-*` performance ([#&#8203;9042](stylelint/stylelint#9042)) ([@&#8203;jeddy3](https://github.com/jeddy3)).
- Fixed: `shorthand-property-no-redundant-values` performance ([#&#8203;9047](stylelint/stylelint#9047)) ([@&#8203;jeddy3](https://github.com/jeddy3)).
- Fixed: `syntax-string-no-invalid` performance ([#&#8203;9061](stylelint/stylelint#9061)) ([@&#8203;jeddy3](https://github.com/jeddy3)).
- Fixed: `time-min-milliseconds` performance ([#&#8203;9060](stylelint/stylelint#9060)) ([@&#8203;jeddy3](https://github.com/jeddy3)).
- Fixed: `value-keyword-case` performance ([#&#8203;9048](stylelint/stylelint#9048)) ([@&#8203;jeddy3](https://github.com/jeddy3)).

### [`v17.2.0`](https://github.com/stylelint/stylelint/blob/HEAD/CHANGELOG.md#1720---2026-02-10)

[Compare Source](stylelint/stylelint@17.1.1...17.2.0)

It fixes 7 bugs, including 5 performance ones that make Stylelint 7x faster and use 3x less memory on larger codebases such as design systems and monorepos. We also restructured our docs to create a [contributor guide](CONTRIBUTING.md). If you'd like to help out and contribute to Stylelint, that's the place to start.

- Fixed: performance of config augmentation and module imports ([#&#8203;9021](stylelint/stylelint#9021)) ([@&#8203;adalinesimonian](https://github.com/adalinesimonian)).
- Fixed: performance of config override matching ([#&#8203;9023](stylelint/stylelint#9023)) ([@&#8203;adalinesimonian](https://github.com/adalinesimonian)).
- Fixed: performance of config resolution ([#&#8203;9033](stylelint/stylelint#9033)) ([@&#8203;adalinesimonian](https://github.com/adalinesimonian)).
- Fixed: performance of rule resolution ([#&#8203;9022](stylelint/stylelint#9022)) ([@&#8203;adalinesimonian](https://github.com/adalinesimonian)).
- Fixed: `declaration-property-value-no-unknown` false negatives for math functions ([#&#8203;9011](stylelint/stylelint#9011)) ([@&#8203;ragini-pandey](https://github.com/ragini-pandey)).
- Fixed: `no-duplicate-selectors` false negatives for matching escaped selectors ([#&#8203;8953](stylelint/stylelint#8953)) ([@&#8203;bjnewman](https://github.com/bjnewman)).
- Fixed: `no-invalid-position-at-import-rule` false negatives for layers with blocks ([#&#8203;9026](stylelint/stylelint#9026)) ([@&#8203;romainmenke](https://github.com/romainmenke)).

### [`v17.1.1`](https://github.com/stylelint/stylelint/blob/HEAD/CHANGELOG.md#1711---2026-02-03)

[Compare Source](stylelint/stylelint@17.1.0...17.1.1)

It fixes 2 bugs.

- Fixed: resolution of configs, plugins, processors, and custom syntaxes in Yarn PnP environments ([#&#8203;9010](stylelint/stylelint#9010)) ([@&#8203;adalinesimonian](https://github.com/adalinesimonian)).
- Fixed: `lightness-notation` autofix for decimals ([#&#8203;9009](stylelint/stylelint#9009)) ([@&#8203;IlyaSemenov](https://github.com/IlyaSemenov)).

### [`v17.1.0`](https://github.com/stylelint/stylelint/blob/HEAD/CHANGELOG.md#1710---2026-01-30)

[Compare Source](stylelint/stylelint@17.0.0...17.1.0)

It fixes 5 bugs and adds the `display-notation` rule. Before we turn it on in our [standard config](https://www.npmjs.com/package/stylelint-config-standard), we'd like to [hear the community's thoughts](stylelint/stylelint-config-standard#387) on which options to use.

- Added: `display-notation` rule ([#&#8203;8981](stylelint/stylelint#8981)) ([@&#8203;romainmenke](https://github.com/romainmenke)).
- Fixed: `GlobbyOptions` TypeScript errors ([#&#8203;8992](stylelint/stylelint#8992)) ([@&#8203;zalishchuk](https://github.com/zalishchuk)).
- Fixed: `hue-degree-notation` false negatives and positives for relative colors ([#&#8203;8985](stylelint/stylelint#8985)) ([@&#8203;jamesnw](https://github.com/jamesnw)).
- Fixed: `lightness-notation` false negatives for relative colors ([#&#8203;8987](stylelint/stylelint#8987)) ([@&#8203;jamesnw](https://github.com/jamesnw)).
- Fixed: `selector-type-no-unknown` false positives for `geolocation` and `usermedia` ([#&#8203;9004](stylelint/stylelint#9004)) ([@&#8203;Mouvedia](https://github.com/Mouvedia)).
- Fixed: `selector-type-no-unknown` false positives for `rb`, `rtc` and `menuitem` ([#&#8203;8972](stylelint/stylelint#8972)) ([@&#8203;Mouvedia](https://github.com/Mouvedia)).

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://github.com/renovatebot/renovate/discussions) if that's undesired.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS42MS4wIiwidXBkYXRlZEluVmVyIjoiNDEuNjEuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Reviewed-on: https://git.robbevp.be/robbevp/website-robbevanpetegem/pulls/505
Co-authored-by: Renovate Bot <renovate@robbevp.be>
Co-committed-by: Renovate Bot <renovate@robbevp.be>
renovate Bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request Mar 2, 2026
| datasource | package   | from   | to     |
| ---------- | --------- | ------ | ------ |
| npm        | stylelint | 17.3.0 | 17.4.0 |


## [v17.4.0](https://github.com/stylelint/stylelint/blob/HEAD/CHANGELOG.md#1740---2026-02-25)

It adds 2 options to the rules and fixes 7 bugs.

- Added: `ignoreAtRules: []` to `at-rule-no-vendor-prefix` ([#9096](stylelint/stylelint#9096)) ([@theacrat](https://github.com/theacrat)).
- Added: `ignoreMediaFeatureNames: []` to `media-feature-name-no-vendor-prefix` ([#9097](stylelint/stylelint#9097)) ([@theacrat](https://github.com/theacrat)).
- Fixed: performance of selector cloning rules ([#9089](stylelint/stylelint#9089)) ([@jeddy3](https://github.com/jeddy3)).
- Fixed: `*-empty-line-before` performance ([#9092](stylelint/stylelint#9092)) ([@jeddy3](https://github.com/jeddy3)).
- Fixed: `declaration-property-value-no-unknown` performance ([#9090](stylelint/stylelint#9090)) ([@jeddy3](https://github.com/jeddy3)).
- Fixed: `no-irregular-whitespace` performance ([#9091](stylelint/stylelint#9091)) ([@jeddy3](https://github.com/jeddy3)).
- Fixed: `property-no-unknown` false negatives for at-rule descriptors ([#9109](stylelint/stylelint#9109)) ([@jeddy3](https://github.com/jeddy3)).
- Fixed: `property-no-unknown` false positives for `corner-shape` ([#9099](stylelint/stylelint#9099)) ([@jeddy3](https://github.com/jeddy3)).
- Fixed: `property-no-unknown` false positives for double-slashed properties ([#9099](stylelint/stylelint#9099)) ([@jeddy3](https://github.com/jeddy3)).
renovate Bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request Mar 2, 2026
| datasource | package   | from   | to     |
| ---------- | --------- | ------ | ------ |
| npm        | stylelint | 17.3.0 | 17.4.0 |


## [v17.4.0](https://github.com/stylelint/stylelint/blob/HEAD/CHANGELOG.md#1740---2026-02-25)

It adds 2 options to the rules and fixes 7 bugs.

- Added: `ignoreAtRules: []` to `at-rule-no-vendor-prefix` ([#9096](stylelint/stylelint#9096)) ([@theacrat](https://github.com/theacrat)).
- Added: `ignoreMediaFeatureNames: []` to `media-feature-name-no-vendor-prefix` ([#9097](stylelint/stylelint#9097)) ([@theacrat](https://github.com/theacrat)).
- Fixed: performance of selector cloning rules ([#9089](stylelint/stylelint#9089)) ([@jeddy3](https://github.com/jeddy3)).
- Fixed: `*-empty-line-before` performance ([#9092](stylelint/stylelint#9092)) ([@jeddy3](https://github.com/jeddy3)).
- Fixed: `declaration-property-value-no-unknown` performance ([#9090](stylelint/stylelint#9090)) ([@jeddy3](https://github.com/jeddy3)).
- Fixed: `no-irregular-whitespace` performance ([#9091](stylelint/stylelint#9091)) ([@jeddy3](https://github.com/jeddy3)).
- Fixed: `property-no-unknown` false negatives for at-rule descriptors ([#9109](stylelint/stylelint#9109)) ([@jeddy3](https://github.com/jeddy3)).
- Fixed: `property-no-unknown` false positives for `corner-shape` ([#9099](stylelint/stylelint#9099)) ([@jeddy3](https://github.com/jeddy3)).
- Fixed: `property-no-unknown` false positives for double-slashed properties ([#9099](stylelint/stylelint#9099)) ([@jeddy3](https://github.com/jeddy3)).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants