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: cache compiled config schema #9

Merged
merged 1 commit into from
Oct 23, 2020
Merged

Fix: cache compiled config schema #9

merged 1 commit into from
Oct 23, 2020

Conversation

mdjermanovic
Copy link
Member

Wanted to check again one part of the change from #5, and it turns out it didn't revert behavior regarding the config schema validation from ESLint v7.7.0.

In particular, ajv.compile is called every time validateConfigSchema is called.

In ESLint v7.7.0 the config schema used to be compiled only once and then cached at the module-level. Here's the original source file:

https://github.com/eslint/eslint/blob/v7.7.0/lib/shared/config-validator.js

This PR fixes the code to cache the compiled schema, as it was working in v7.7.0.

This is probably just a minor performance regression, I'm not sure if this needs another patch release for v7.8.0.

@mdjermanovic mdjermanovic added bug Something isn't working triage labels Sep 1, 2020
@kaicataldo kaicataldo added accepted and removed triage labels Sep 1, 2020
Copy link
Member

@nzakas nzakas left a comment

Choose a reason for hiding this comment

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

LGTM

@nzakas nzakas merged commit 04f3cae into main Oct 23, 2020
@nzakas nzakas deleted the cache-compiled-schema branch October 23, 2020 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants