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

chore: improve eslint performance #2166

Merged
merged 1 commit into from
May 10, 2024
Merged

chore: improve eslint performance #2166

merged 1 commit into from
May 10, 2024

Conversation

anuraghazra
Copy link
Member

@anuraghazra anuraghazra commented May 9, 2024

Description

Eslint timing analysis before optimizations:

Rule Time (ms) Relative
import/no-cycle 30863.247 49.3%
prettier/prettier 10177.949 16.3%
import/no-deprecated 6499.778 10.4%
@typescript-eslint/no-unused-vars 3014.236 4.8%
@typescript-eslint/no-floating-promises 1632.403 2.6%
@typescript-eslint/no-unnecessary-qualifier 1472.390 2.4%
@typescript-eslint/no-misused-promises 932.970 1.5%
import/order 644.840 1.0%
import/no-extraneous-dependencies 494.785 0.8%
react/default-props-match-prop-types 416.096 0.7%
  • There's a bug in import/cycle where setting ignoreExternal: true causes the performance to tank, and also changed the maxDepth from infinity to 4, I think 4 is enough to detect any cycles.
  • Disabled import/no-deprecated, this rule is the 3rd most expensive rule that was being run. This rule isn't really useful for blade.

On average a 30s improvement.

Before: ~2.30s

image

After: 2m

image

Eslint timing analysis after optimizations:

Rule Time (ms) Relative
import/no-cycle 14836.976 34.9%
prettier/prettier 11104.337 26.1%
@typescript-eslint/no-unused-vars 3313.766 7.8%
@typescript-eslint/no-floating-promises 1712.215 4.0%
@typescript-eslint/no-unnecessary-qualifier 1511.020 3.6%
import/order 1191.725 2.8%
@typescript-eslint/no-misused-promises 920.061 2.2%
import/no-extraneous-dependencies 544.165 1.3%
react/no-unstable-nested-components 453.095 1.1%
react/default-props-match-prop-types 415.856 1.0%

Changes

Additional Information

Component Checklist

  • Update Component Status Page
  • Perform Manual Testing in Other Browsers
  • Add KitchenSink Story
  • Add Interaction Tests (if applicable)
  • Add changeset

Copy link

changeset-bot bot commented May 9, 2024

⚠️ No Changeset found

Latest commit: 73b3ca9

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

Copy link
Contributor

github-actions bot commented May 9, 2024

✅ PR title follows Conventional Commits specification.

Copy link

codesandbox-ci bot commented May 9, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 73b3ca9:

Sandbox Source
razorpay/blade: basic Configuration

@rzpcibot
Copy link
Collaborator

rzpcibot commented May 9, 2024

Bundle Size Report

No bundle size changes detected.

Generated by 🚫 dangerJS against 73b3ca9

@snitin315 snitin315 changed the title fix: improve eslint performance chore: improve eslint performance May 10, 2024
@snitin315 snitin315 merged commit c481e15 into master May 10, 2024
19 of 20 checks passed
@snitin315 snitin315 deleted the anu/eslint-perf branch May 10, 2024 02:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants