Skip to content

Commit

Permalink
Minor: Do not clear the config cache on each run (#368)
Browse files Browse the repository at this point in the history
This halfs the time taken on CLI runs. However when you make a config
change your editor won't pick up that change until you reload your
editor window (either by restarting your editor, or in VSCode there is a
"Reload window" command).

Given that most of the time you're not adjusting your config, this
speedup is worth that extra bit of friction
  • Loading branch information
BPScott authored Dec 13, 2020
1 parent 86608d5 commit 1b90ea7
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions eslint-plugin-prettier.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,15 +154,6 @@ module.exports = {
const filepath = context.getFilename();
const source = sourceCode.text;

// This allows long-running ESLint processes (e.g. vscode-eslint) to
// pick up changes to .prettierrc without restarting the editor. This
// will invalidate the prettier plugin cache on every file as well which
// will make ESLint very slow, so it would probably be a good idea to
// find a better way to do this.
if (usePrettierrc && prettier && prettier.clearConfigCache) {
prettier.clearConfigCache();
}

return {
Program() {
if (!prettier) {
Expand Down

0 comments on commit 1b90ea7

Please sign in to comment.