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 #4610

Merged
merged 1 commit into from Dec 5, 2015

Conversation

SpainTrain
Copy link

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

Closes #4611

Review on Reviewable

@eslintbot
Copy link

Thanks for the pull request, @SpainTrain! It looks like this is your first time contributing to ESLint, so please take a moment to read over our contribution guidelines.

We'll also need you to sign our CLA, which is just a way for you to say that you give us permission to use your contribution.

If you have any questions about the process, don't hesitate to ask.

@SpainTrain SpainTrain force-pushed the dont-module-cache-package-json branch 2 times, most recently from f8240dd to 933cded Compare December 4, 2015 22:41
@michaelficarra
Copy link
Member

LGTM.

@nzakas
Copy link
Member

nzakas commented Dec 5, 2015

@SpainTrain Thanks. Can you add a test that validates the change?

@SpainTrain SpainTrain force-pushed the dont-module-cache-package-json branch from 933cded to 836e8ee Compare December 5, 2015 01:06
* Read `package.json` on every config load by not using `require`
@SpainTrain SpainTrain force-pushed the dont-module-cache-package-json branch from 836e8ee to f912e21 Compare December 5, 2015 01:10
@SpainTrain
Copy link
Author

@nzakas
Copy link
Member

nzakas commented Dec 5, 2015

Awesome, thanks!

nzakas added a commit that referenced this pull request Dec 5, 2015
@nzakas nzakas merged commit 9ca362d into eslint:master Dec 5, 2015
@SpainTrain SpainTrain deleted the dont-module-cache-package-json branch December 5, 2015 18:32
MethodGrab added a commit to MethodGrab/eslint that referenced this pull request Jan 25, 2016
Read `.eslintrc.js` on every config load by not using `require`
Related: eslint#4610
MethodGrab added a commit to MethodGrab/eslint that referenced this pull request Jan 25, 2016
Read `.eslintrc.js` on every config load by not using `require`
Related: eslint#4610
MethodGrab added a commit to MethodGrab/eslint that referenced this pull request Jan 25, 2016
Read `.eslintrc.js` on every config load by not using `require`
Related: eslint#4610
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 7, 2018
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Feb 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants