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

feat: provide config options for schemastore cache #180

Open
twelvelabs opened this issue Oct 16, 2022 · 4 comments
Open

feat: provide config options for schemastore cache #180

twelvelabs opened this issue Oct 16, 2022 · 4 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@twelvelabs
Copy link

Would it be possible to provide options for json-schema-validator/no-invalid:

  1. Cache location. It seems to currently be hard coded to ./.cached_schemastore, but I'm using it in a docker container and that location isn't persisted between runs. I already have a persistent volume setup and I'd like to tell json-schema-validator to use that location.

  2. Cache TTL. Once I have json-schema-validator caching to a persistent location, I would like to tell it when to re-fetch the cached schema files.

@ota-meshi
Copy link
Owner

Thank you for posting issue!

I think it makes sense to add your suggested options.
However, we might be better off using settings rather than rule options.
https://eslint.org/docs/latest/user-guide/configuring/configuration-files#adding-shared-settings

@ota-meshi ota-meshi added the enhancement New feature or request label Oct 16, 2022
@ota-meshi ota-meshi added the help wanted Extra attention is needed label Nov 16, 2022
@anothermh
Copy link

The lack of configuration raises an error with Yarn 2:

EROFS: read-only filesystem, mkdir '/node_modules/eslint-plugin-json-schema-validator/.cached_schemastore

It can be worked around with the following addition to package.json:

  "dependenciesMeta": {
    "eslint-plugin-json-schema-validator": {
      "unplugged": true
    }
  }

This makes it an unplugged package in .yarn/unplugged where it can write files. This isn't ideal for yarn zero-installs, so having options to configure it would be nice.

@ota-meshi
Copy link
Owner

Please consider opening a pull request if you want that feature sooner.

@anothermh
Copy link

I've chosen instead to use your other package eslint-plugin-jsonc. I don't strictly require the schema validation and can work with just JSON validation.

Thank you for your continued development of your packages. Your plugins and parsers are high quality and provide a wonderful developer experience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants