Skip to content
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

Fix function-calc-no-unspaced-operator performance #7505

Merged
merged 5 commits into from Jan 30, 2024

Conversation

ybiquitous
Copy link
Member

@ybiquitous ybiquitous commented Jan 30, 2024

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

Follow-up to #6923

Wait for #7504 (Note that the base branch is fix-benchmark-script)

Is there anything in the PR that needs further explanation?

How to measure:

npm run -s benchmark-rule -- function-calc-no-unspaced-operator true

Before:

Warnings: 0
Mean: 125.72145828571429 ms
Deviation: 14.960783775263804 ms

After:

Warnings: 0
Mean: 110.21394642857142 ms
Deviation: 10.1318139617483 ms

This fixes the broken benchmark script (`npm run benchmark`)
The error reason is that `rules[ruleName]` has returned a `Promise` since 16.0.0.

```sh-session
$ npm run benchmark-rule -- value-keyword-case lower
...
const rule = ruleFunc(primary, secondary, context);
             ^

TypeError: ruleFunc is not a function
...
```

Also, this changes `parserOptions.ecmaVersion` in the ESLint config to allow top-level `await`.
How to measure:

```shell
npm run -s benchmark-rule -- function-calc-no-unspaced-operator true
```

Before:

```
Warnings: 0
Mean: 125.72145828571429 ms
Deviation: 14.960783775263804 ms
```

After:

```
Warnings: 0
Mean: 110.21394642857142 ms
Deviation: 10.1318139617483 ms
```
Copy link

changeset-bot bot commented Jan 30, 2024

🦋 Changeset detected

Latest commit: cebe29f

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

@ybiquitous ybiquitous mentioned this pull request Jan 30, 2024
4 tasks
Copy link
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.

LGTM!

Thank you for this 🙇

@ybiquitous
Copy link
Member Author

@romainmenke Thanks for the quick review! Can you take a quick look at #7504, too? It's a blocker for this PR.

Base automatically changed from fix-benchmark-script to main January 30, 2024 15:37
@ybiquitous ybiquitous merged commit 5e2eff7 into main Jan 30, 2024
16 checks passed
@ybiquitous ybiquitous deleted the fix-function-calc-no-unspaced-operator-performance branch January 30, 2024 15:44
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.

None yet

2 participants