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

Do not implicitly cache `package.json` #4611

Closed
SpainTrain opened this Issue Dec 4, 2015 · 1 comment

Comments

Projects
None yet
3 participants
@SpainTrain
Copy link
Contributor

SpainTrain commented Dec 4, 2015

Currently eslint will load the config stored in a project's package.json using require. The downside to this is that the json is cached in require.cache. Thus, if eslint is executed twice in the same process, and the config has changed in the interim, it will not read the new config. For an example of this causing a downstream bug in the wild see AtomLinter/linter-eslint#349

@eslintbot

This comment has been minimized.

Copy link

eslintbot commented Dec 4, 2015

@SpainTrain Thanks for the issue! If you're reporting a bug, please be sure to include:

  1. The version of ESLint you are using (run eslint -v)
  2. What you did (the source code and ESLint configuration)
  3. The actual ESLint output complete with numbers
  4. What you expected to happen instead

Requesting a new rule? Please see Proposing a New Rule for instructions.

@eslintbot eslintbot added the triage label Dec 4, 2015

SpainTrain pushed a commit to SpainTrain/eslint that referenced this issue Dec 4, 2015

Spain
Fix: Do not implicitly cache `package.json`
* Read `package.json` on every config load by not using `require`

(fixes eslint#4611)

SpainTrain pushed a commit to SpainTrain/eslint that referenced this issue Dec 4, 2015

Spain
Fix: Do not cache `package.json` (fixes eslint#4611)
* Read `package.json` on every config load by not using `require`

@nzakas nzakas added bug cli accepted and removed triage labels Dec 5, 2015

SpainTrain pushed a commit to SpainTrain/eslint that referenced this issue Dec 5, 2015

Spain
Fix: Do not cache `package.json` (fixes eslint#4611)
* Read `package.json` on every config load by not using `require`

SpainTrain pushed a commit to SpainTrain/eslint that referenced this issue Dec 5, 2015

Spain
Fix: Do not cache `package.json` (fixes eslint#4611)
* Read `package.json` on every config load by not using `require`

@nzakas nzakas closed this in #4610 Dec 5, 2015

@eslint eslint bot locked and limited conversation to collaborators Feb 7, 2018

@eslint eslint bot added the archived due to age label Feb 7, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.