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

ESLINTJS-56 Improve the performances of package manifest search #4840

Merged
merged 4 commits into from
Sep 24, 2024

Conversation

ericmorand-sonarsource
Copy link
Contributor

Fixes ESLINTJS-56

Copy link
Contributor

@vdiez vdiez left a comment

Choose a reason for hiding this comment

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

Really nice! Just please try to avoid adding a new dependency (sinon) as jest already provides spy functionality


cache.set(from, cacheContent);

for (const entry of filesystem.readdirSync(from)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

if you are listing and stating, better use filesystem.readdirSync(dir, { withFileTypes: true }); which makes both in the same call

if (stats.isFile()) {
const basename = Path.basename(fullEntryPath);

if (new Minimatch(pattern).match(basename)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

new Minimatch(pattern) will always be the same. I think we could extract from here and pass it in the constructor createFindUp. WDYT?

Copy link

sonarqube-next bot commented Sep 23, 2024

Copy link
Contributor

@vdiez vdiez left a comment

Choose a reason for hiding this comment

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

LGTM!

@ericmorand-sonarsource ericmorand-sonarsource merged commit a5f02df into master Sep 24, 2024
15 of 16 checks passed
@ericmorand-sonarsource ericmorand-sonarsource deleted the ESLINTJS-56 branch September 24, 2024 07:32
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.

2 participants