-
-
Notifications
You must be signed in to change notification settings - Fork 185
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
Avoid clearing Prettier cache when not using prettierrc #303
Conversation
At Airbnb we've noticed that the Prettier ESLint rule is extraordinarily slow. When running ESLint with `TIMING=1`, Prettier is two orders of magnitude slower than our other slowest rules (which come from eslint-plugin-import mostly). I spent some time investigating this today. I ran the Chrome DevTools profiler while running ESLint on a directory with 480 files in it. Looking at the flame charts, I noticed that this plugin ended up calling Prettier's pluginSearchDirs.map.pluginSearchDir for every file that was being linted, even though it was being memoized. Through some logging, I determined that the Prettier cache was being cleared between every file, and narrowed it down to this line, which was added here: prettier#55 (comment) It looks like this cache busting was added to make it so long-running ESLint processes (e.g. for vscode-eslint) would be able to pick up changes to prettierrc files without having to reload the process. Thankfully, we don't use a prettierrc file at Airbnb right now, in favor of putting our Prettier config inline with our ESLint config. So the quick performance fix for us is to simply skip the cache busting when this option is not enabled. In my profiling, this reduces the time spent in ESLint's verifyAndFix when running on the same 480 files from 34 seconds to 26 seconds, for a total savings of 8 seconds. For folks who are using prettierrc files, this is still pretty crappy, so it would be great to find a better way to do this. Unfortunately my knowledge of the inner workings of vscode-eslint and ESLint are not enough to know if there might be a better way to do this--e.g. maybe there's some ESLint option that we can respect here?
Ooof that's a chunky speedup. Great investigating! I've just tried this out with my go-to codebase that's a bit bigger (~700 files for eslint) and am seeing an 8 second speedup too - time to run just the prettier rule goes from ~16s to ~8s. Uncached total runtime goes from ~72s to ~64s. Our of interest what's the speedup for just the prettier rule on your codebase? This is a big speedup so given most people are going to be spending time running lints rather than editing configs I'm rather tempted to say we straight up remove the clearCacheConfig call entirely and document that people are gonna need to reload their vscode windows if they edit their config. VSCode eslint already requires you to reload the window to cachebust other plugin configs such as Yo @dbaeumer, sorry for the wild ping, but it looks like vscode-eslint handles "if the .eslintrc changes then bust caches and reload eslint" here. It's not really vscode-eslint's problem but would you consider accepting adding |
Even if the vscode plugin does this, there area bunch of others that would also need to have this special case, like sublime, atom, and eslint_d. One option would be to add an async thing that clears the cache later, but I suspect that won't be ideal now that eslint has gone async. I think this would be ideal if node had requestIdleCallback (nodejs/node#2543), but we could probably mimic something pretty decent without too much overhead using recursive setTimeouts. I think ideally eslint would have an API for rules to do some cleanup work after all the rules finished. Obviously, that won't be backwards compatible though. In any case, my preference would be to get this change published as is ASAP, since it is a strict improvement, and then follow up with deeper changes. Then we can decide if we want to break people's workflows or try to make it just work. I'd be happy to submit a separate PR that does the setTimeouts shenanigans if you like that idea. |
ESLint takes too long to run locally on our entire codebase right now. In CI, we use jest-runner-eslint to speed things up a lot. We also have a large monorepo and do some things to only run ESLint on parts of the monorepo that might be affected by any given change. With all of this in place, and running on some pretty beefy boxes, we see max run times around 14 minutes lately. I'd be happy to report back with new numbers after this change is published, but I'm expecting that this will drop that time considerably. |
178: Update dependency eslint-plugin-prettier to v3.1.4 r=renovate[bot] a=renovate[bot] This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [eslint-plugin-prettier](https://togithub.com/prettier/eslint-plugin-prettier) | dependencies | patch | [`3.1.3` -> `3.1.4`](https://renovatebot.com/diffs/npm/eslint-plugin-prettier/3.1.3/3.1.4) | --- ### Release Notes <details> <summary>prettier/eslint-plugin-prettier</summary> ### [`v3.1.4`](https://togithub.com/prettier/eslint-plugin-prettier/blob/master/CHANGELOG.md#v314-2020-06-14) [Compare Source](https://togithub.com/prettier/eslint-plugin-prettier/compare/v3.1.3...v3.1.4) - Avoid clearing Prettier cache when not using prettierrc ([#​303]([email protected]:prettier/eslint-plugin-prettier/issues/303)) ([3c8e2d9]([email protected]:prettier/eslint-plugin-prettier/commit/3c8e2d9871d86a82b10fe3d54f32bb5a54f2913b)) - build(deps-dev): bump eslint-plugin-eslint-plugin from 2.2.1 to 2.2.2 ([93f7c8b]([email protected]:prettier/eslint-plugin-prettier/commit/93f7c8be7c99a0c3e4b11be6a5311316f76e6e08)) - build(deps-dev): bump eslint from 7.1.0 to 7.2.0 ([650ac7a]([email protected]:prettier/eslint-plugin-prettier/commit/650ac7a40c1f4d46b0bd37efad3eed84f8155a44)) - build(deps-dev): bump eslint-plugin-self from 1.2.0 to 1.2.1 ([6449ec1]([email protected]:prettier/eslint-plugin-prettier/commit/6449ec151f119e98d69da91ad6d10dbb374162d8)) - build(deps-dev): bump eslint from 7.0.0 to 7.1.0 ([fd30022]([email protected]:prettier/eslint-plugin-prettier/commit/fd30022a51a57a4e96dd4ab3e04956b945886874)) - Chore: Add CI tests for ESLint 7 ([#​291]([email protected]:prettier/eslint-plugin-prettier/issues/291)) ([cc2979b]([email protected]:prettier/eslint-plugin-prettier/commit/cc2979b68258b8545931ce37168adfe17b1d3a7b)) - build(deps-dev): bump eslint-config-prettier from 6.10.1 to 6.11.0 ([35a7ee6]([email protected]:prettier/eslint-plugin-prettier/commit/35a7ee68b02ea3088270210ac8dc85ff47ef65a9)) </details> --- ### Renovate configuration :date: **Schedule**: At any time (no schedule defined). :vertical_traffic_light: **Automerge**: Enabled. :recycle: **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#mythmon/corsica-tree-status). Co-authored-by: Renovate Bot <[email protected]>
@BPScott yes, I would accept suc a PR since there is a huge likelihood that if a prettier config file is present and eslint is running that the corresponding plugin is used. |
Thanks for the quick publish on this! I've updated our plugin and early results look like it saves us 1-2 minutes in CI, which is somewhere around 10-15% of the total job runtime. This is now the
|
Yepyep, and I'm trying to say that all of those also need some mechanism to solve e.g. cachebusting after graphql schema changes if consumers are using eslint-plugin-graphql. So I think the responsibility of specifying and handling that mechanism lies with the tools that are creating long-running eslint processes rather than the plugins themselves. |
[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [eslint-plugin-prettier](https://togithub.com/prettier/eslint-plugin-prettier) | [`^3.1.0` -> `3.4.1`](https://renovatebot.com/diffs/npm/eslint-plugin-prettier/3.1.3/3.4.1) | [![age](https://badges.renovateapi.com/packages/npm/eslint-plugin-prettier/3.4.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/eslint-plugin-prettier/3.4.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/eslint-plugin-prettier/3.4.1/compatibility-slim/3.1.3)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/eslint-plugin-prettier/3.4.1/confidence-slim/3.1.3)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>prettier/eslint-plugin-prettier</summary> ### [`v3.4.1`](https://togithub.com/prettier/eslint-plugin-prettier/blob/master/CHANGELOG.md#v341-2021-08-20) [Compare Source](https://togithub.com/prettier/eslint-plugin-prettier/compare/0813a83512ab52194b4e8da7193daf880a8cbef5...e53f23b890c9c6e73ba6e58db0d05eb91d962b71) - build(deps): Bump glob-parent from 5.0.0 to 5.1.2 ([#​420]([email protected]:prettier/eslint-plugin-prettier/issues/420)) ([b6d075c]([email protected]:prettier/eslint-plugin-prettier/commit/b6d075cf7111468e8af4161c306c7f37f09f220e)) - build(deps): Bump path-parse from 1.0.6 to 1.0.7 ([#​425]([email protected]:prettier/eslint-plugin-prettier/issues/425)) ([24f957e]([email protected]:prettier/eslint-plugin-prettier/commit/24f957ee2a5476bb9cc8e64921b9841fc751391e)) - feat: support `@graphql-eslint/eslint-plugin` out of box ([#​413]([email protected]:prettier/eslint-plugin-prettier/issues/413)) ([ec6fbb1]([email protected]:prettier/eslint-plugin-prettier/commit/ec6fbb159e2454c6e145db55480932dc953cf7c1)) - chore: add tests for Node 16 ([#​410]([email protected]:prettier/eslint-plugin-prettier/issues/410)) ([76bd45e]([email protected]:prettier/eslint-plugin-prettier/commit/76bd45ece6d56eb52f75db6b4a1efdd2efb56392)) ### [`v3.4.0`](https://togithub.com/prettier/eslint-plugin-prettier/blob/master/CHANGELOG.md#v340-2021-04-15) [Compare Source](https://togithub.com/prettier/eslint-plugin-prettier/compare/v3.3.1...0813a83512ab52194b4e8da7193daf880a8cbef5) - feat: support processor virtual filename ([#​401]([email protected]:prettier/eslint-plugin-prettier/issues/401)) ([ee0ccc6]([email protected]:prettier/eslint-plugin-prettier/commit/ee0ccc6ac06d13cd546e78b444e53164f59eb27f)) - Simplify report logic ([#​380]([email protected]:prettier/eslint-plugin-prettier/issues/380)) ([d993f24]([email protected]:prettier/eslint-plugin-prettier/commit/d993f247b5661683af031ab3b93955a0dfe448fa)) - Update: README.md ([#​375]([email protected]:prettier/eslint-plugin-prettier/issues/375)) ([3ea4242]([email protected]:prettier/eslint-plugin-prettier/commit/3ea4242a8d4acdb76eb7e7dca9e44d3e87db70e3)) ### [`v3.3.1`](https://togithub.com/prettier/eslint-plugin-prettier/blob/master/CHANGELOG.md#v331-2021-01-04) [Compare Source](https://togithub.com/prettier/eslint-plugin-prettier/compare/v3.3.0...v3.3.1) - fix: add eslint-config-prettier as an optional peer dependency ([#​374]([email protected]:prettier/eslint-plugin-prettier/issues/374)) ([d59df27]([email protected]:prettier/eslint-plugin-prettier/commit/d59df27890aaffec9e528ceb3155831a0261848d)) - build(deps-dev): bump eslint from 7.16.0 to 7.17.0 ([b87985d]([email protected]:prettier/eslint-plugin-prettier/commit/b87985d8b1986743374b56691bcc1633df8f4eae)) - build(deps-dev): bump eslint from 7.15.0 to 7.16.0 ([11e427e]([email protected]:prettier/eslint-plugin-prettier/commit/11e427e5d6cedeb26e3e03c8143be3496a24955a)) ### [`v3.3.0`](https://togithub.com/prettier/eslint-plugin-prettier/blob/master/CHANGELOG.md#v330-2020-12-13) [Compare Source](https://togithub.com/prettier/eslint-plugin-prettier/compare/v3.2.0...v3.3.0) - Minor: Perf improvement: Do not clear the config cache on each run ([#​368]([email protected]:prettier/eslint-plugin-prettier/issues/368)) ([1b90ea7]([email protected]:prettier/eslint-plugin-prettier/commit/1b90ea752636959babb27ebca5d67093c346dab9)) - Add peerDependenciesMeta block ([#​367]([email protected]:prettier/eslint-plugin-prettier/issues/367)) ([86608d5]([email protected]:prettier/eslint-plugin-prettier/commit/86608d5084692ab0d1f2f49a3df4909d04c39ae7)) - build(deps-dev): bump eslint from 7.14.0 to 7.15.0 ([885f484]([email protected]:prettier/eslint-plugin-prettier/commit/885f48405e0fc9f312acdd3e3487c824bd59c102)) - build(deps-dev): bump eslint from 7.3.1 to 7.14.0 ([cebc80b]([email protected]:prettier/eslint-plugin-prettier/commit/cebc80b39d3d09f957a73536e54f6d8dd4567080)) ### [`v3.2.0`](https://togithub.com/prettier/eslint-plugin-prettier/blob/master/CHANGELOG.md#v320-2020-12-03) [Compare Source](https://togithub.com/prettier/eslint-plugin-prettier/compare/v3.1.4...v3.2.0) - Skip CI for eslint 6 + node 8 ([#​364]([email protected]:prettier/eslint-plugin-prettier/issues/364)) ([f8f08e4]([email protected]:prettier/eslint-plugin-prettier/commit/f8f08e483522d74bc4dd93d9813914aa7ba9314b)) - Turn off problematic rules in recommended config (prepare for next eslint-config-prettier version) ([#​360]([email protected]:prettier/eslint-plugin-prettier/issues/360)) ([a1e5591]([email protected]:prettier/eslint-plugin-prettier/commit/a1e559112073eedfb0dd2041b9c2f6ef775844ec)) - Create dependabot.yml ([f58b6c7]([email protected]:prettier/eslint-plugin-prettier/commit/f58b6c7c356a37b437593cd6ff8d1dca1c437b13)) - docs(README): fix prettier getFileInfo link ([#​335]([email protected]:prettier/eslint-plugin-prettier/issues/335)) ([5a690f1]([email protected]:prettier/eslint-plugin-prettier/commit/5a690f14d793ba5a08c55287fa3d6338dcda21ba)) - build(deps-dev): bump eslint-plugin-eslint-plugin from 2.2.2 to 2.3.0 ([8614c45]([email protected]:prettier/eslint-plugin-prettier/commit/8614c458ed284bc126034d432b49b07d7d67ef06)) - build(deps-dev): bump eslint from 7.3.0 to 7.3.1 ([12d9ed8]([email protected]:prettier/eslint-plugin-prettier/commit/12d9ed877aacfad2c27f01161cc2eb28a445725f)) - build(deps-dev): bump eslint from 7.2.0 to 7.3.0 ([5a6f42e]([email protected]:prettier/eslint-plugin-prettier/commit/5a6f42e4eda871a294da1eb55f214c475450faa6)) - chore: update CI badge in readme ([5012b66]([email protected]:prettier/eslint-plugin-prettier/commit/5012b665f981edbc21feaaccb3cd297f49ca40d3)) - Use Github Actions for CI ([#​305]([email protected]:prettier/eslint-plugin-prettier/issues/305)) ([41eb64f]([email protected]:prettier/eslint-plugin-prettier/commit/41eb64fda33663ed1c43a85218f390c6cd4b6191)) ### [`v3.1.4`](https://togithub.com/prettier/eslint-plugin-prettier/blob/master/CHANGELOG.md#v314-2020-06-14) [Compare Source](https://togithub.com/prettier/eslint-plugin-prettier/compare/v3.1.3...v3.1.4) - Avoid clearing Prettier cache when not using prettierrc ([#​303]([email protected]:prettier/eslint-plugin-prettier/issues/303)) ([3c8e2d9]([email protected]:prettier/eslint-plugin-prettier/commit/3c8e2d9871d86a82b10fe3d54f32bb5a54f2913b)) - build(deps-dev): bump eslint-plugin-eslint-plugin from 2.2.1 to 2.2.2 ([93f7c8b]([email protected]:prettier/eslint-plugin-prettier/commit/93f7c8be7c99a0c3e4b11be6a5311316f76e6e08)) - build(deps-dev): bump eslint from 7.1.0 to 7.2.0 ([650ac7a]([email protected]:prettier/eslint-plugin-prettier/commit/650ac7a40c1f4d46b0bd37efad3eed84f8155a44)) - build(deps-dev): bump eslint-plugin-self from 1.2.0 to 1.2.1 ([6449ec1]([email protected]:prettier/eslint-plugin-prettier/commit/6449ec151f119e98d69da91ad6d10dbb374162d8)) - build(deps-dev): bump eslint from 7.0.0 to 7.1.0 ([fd30022]([email protected]:prettier/eslint-plugin-prettier/commit/fd30022a51a57a4e96dd4ab3e04956b945886874)) - Chore: Add CI tests for ESLint 7 ([#​291]([email protected]:prettier/eslint-plugin-prettier/issues/291)) ([cc2979b]([email protected]:prettier/eslint-plugin-prettier/commit/cc2979b68258b8545931ce37168adfe17b1d3a7b)) - build(deps-dev): bump eslint-config-prettier from 6.10.1 to 6.11.0 ([35a7ee6]([email protected]:prettier/eslint-plugin-prettier/commit/35a7ee68b02ea3088270210ac8dc85ff47ef65a9)) </details> --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/carbon-design-system/carbon-for-ibm-dotcom-nextjs-template).
[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [eslint-plugin-prettier](https://togithub.com/prettier/eslint-plugin-prettier) | [`^3.1.0` -> `^4.0.0`](https://renovatebot.com/diffs/npm/eslint-plugin-prettier/3.1.3/4.0.0) | [![age](https://badges.renovateapi.com/packages/npm/eslint-plugin-prettier/4.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/eslint-plugin-prettier/4.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/eslint-plugin-prettier/4.0.0/compatibility-slim/3.1.3)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/eslint-plugin-prettier/4.0.0/confidence-slim/3.1.3)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>prettier/eslint-plugin-prettier</summary> ### [`v4.0.0`](https://togithub.com/prettier/eslint-plugin-prettier/blob/master/CHANGELOG.md#v400-2021-08-30) [Compare Source](https://togithub.com/prettier/eslint-plugin-prettier/compare/e53f23b890c9c6e73ba6e58db0d05eb91d962b71...v4.0.0) This breaking change drops support for old versions of ESLint, Prettier and Node. You must use at least ESLint v7.28.0, Prettier v2.0.0 and Node v12.0.0. Aside from that, usage of this plugin remains identical. - v4 - Drop support for eslint 5/6, prettier 1, node 6/8 ([#​429]([email protected]:prettier/eslint-plugin-prettier/issues/429)) ([acb56f3]([email protected]:prettier/eslint-plugin-prettier/commit/acb56f3b2891b2a6998a75a7d4406183d452ba16)) ### [`v3.4.1`](https://togithub.com/prettier/eslint-plugin-prettier/blob/master/CHANGELOG.md#v341-2021-08-20) [Compare Source](https://togithub.com/prettier/eslint-plugin-prettier/compare/0813a83512ab52194b4e8da7193daf880a8cbef5...e53f23b890c9c6e73ba6e58db0d05eb91d962b71) - build(deps): Bump glob-parent from 5.0.0 to 5.1.2 ([#​420]([email protected]:prettier/eslint-plugin-prettier/issues/420)) ([b6d075c]([email protected]:prettier/eslint-plugin-prettier/commit/b6d075cf7111468e8af4161c306c7f37f09f220e)) - build(deps): Bump path-parse from 1.0.6 to 1.0.7 ([#​425]([email protected]:prettier/eslint-plugin-prettier/issues/425)) ([24f957e]([email protected]:prettier/eslint-plugin-prettier/commit/24f957ee2a5476bb9cc8e64921b9841fc751391e)) - feat: support `@graphql-eslint/eslint-plugin` out of box ([#​413]([email protected]:prettier/eslint-plugin-prettier/issues/413)) ([ec6fbb1]([email protected]:prettier/eslint-plugin-prettier/commit/ec6fbb159e2454c6e145db55480932dc953cf7c1)) - chore: add tests for Node 16 ([#​410]([email protected]:prettier/eslint-plugin-prettier/issues/410)) ([76bd45e]([email protected]:prettier/eslint-plugin-prettier/commit/76bd45ece6d56eb52f75db6b4a1efdd2efb56392)) ### [`v3.4.0`](https://togithub.com/prettier/eslint-plugin-prettier/blob/master/CHANGELOG.md#v340-2021-04-15) [Compare Source](https://togithub.com/prettier/eslint-plugin-prettier/compare/v3.3.1...0813a83512ab52194b4e8da7193daf880a8cbef5) - feat: support processor virtual filename ([#​401]([email protected]:prettier/eslint-plugin-prettier/issues/401)) ([ee0ccc6]([email protected]:prettier/eslint-plugin-prettier/commit/ee0ccc6ac06d13cd546e78b444e53164f59eb27f)) - Simplify report logic ([#​380]([email protected]:prettier/eslint-plugin-prettier/issues/380)) ([d993f24]([email protected]:prettier/eslint-plugin-prettier/commit/d993f247b5661683af031ab3b93955a0dfe448fa)) - Update: README.md ([#​375]([email protected]:prettier/eslint-plugin-prettier/issues/375)) ([3ea4242]([email protected]:prettier/eslint-plugin-prettier/commit/3ea4242a8d4acdb76eb7e7dca9e44d3e87db70e3)) ### [`v3.3.1`](https://togithub.com/prettier/eslint-plugin-prettier/blob/master/CHANGELOG.md#v331-2021-01-04) [Compare Source](https://togithub.com/prettier/eslint-plugin-prettier/compare/v3.3.0...v3.3.1) - fix: add eslint-config-prettier as an optional peer dependency ([#​374]([email protected]:prettier/eslint-plugin-prettier/issues/374)) ([d59df27]([email protected]:prettier/eslint-plugin-prettier/commit/d59df27890aaffec9e528ceb3155831a0261848d)) - build(deps-dev): bump eslint from 7.16.0 to 7.17.0 ([b87985d]([email protected]:prettier/eslint-plugin-prettier/commit/b87985d8b1986743374b56691bcc1633df8f4eae)) - build(deps-dev): bump eslint from 7.15.0 to 7.16.0 ([11e427e]([email protected]:prettier/eslint-plugin-prettier/commit/11e427e5d6cedeb26e3e03c8143be3496a24955a)) ### [`v3.3.0`](https://togithub.com/prettier/eslint-plugin-prettier/blob/master/CHANGELOG.md#v330-2020-12-13) [Compare Source](https://togithub.com/prettier/eslint-plugin-prettier/compare/v3.2.0...v3.3.0) - Minor: Perf improvement: Do not clear the config cache on each run ([#​368]([email protected]:prettier/eslint-plugin-prettier/issues/368)) ([1b90ea7]([email protected]:prettier/eslint-plugin-prettier/commit/1b90ea752636959babb27ebca5d67093c346dab9)) - Add peerDependenciesMeta block ([#​367]([email protected]:prettier/eslint-plugin-prettier/issues/367)) ([86608d5]([email protected]:prettier/eslint-plugin-prettier/commit/86608d5084692ab0d1f2f49a3df4909d04c39ae7)) - build(deps-dev): bump eslint from 7.14.0 to 7.15.0 ([885f484]([email protected]:prettier/eslint-plugin-prettier/commit/885f48405e0fc9f312acdd3e3487c824bd59c102)) - build(deps-dev): bump eslint from 7.3.1 to 7.14.0 ([cebc80b]([email protected]:prettier/eslint-plugin-prettier/commit/cebc80b39d3d09f957a73536e54f6d8dd4567080)) ### [`v3.2.0`](https://togithub.com/prettier/eslint-plugin-prettier/blob/master/CHANGELOG.md#v320-2020-12-03) [Compare Source](https://togithub.com/prettier/eslint-plugin-prettier/compare/v3.1.4...v3.2.0) - Skip CI for eslint 6 + node 8 ([#​364]([email protected]:prettier/eslint-plugin-prettier/issues/364)) ([f8f08e4]([email protected]:prettier/eslint-plugin-prettier/commit/f8f08e483522d74bc4dd93d9813914aa7ba9314b)) - Turn off problematic rules in recommended config (prepare for next eslint-config-prettier version) ([#​360]([email protected]:prettier/eslint-plugin-prettier/issues/360)) ([a1e5591]([email protected]:prettier/eslint-plugin-prettier/commit/a1e559112073eedfb0dd2041b9c2f6ef775844ec)) - Create dependabot.yml ([f58b6c7]([email protected]:prettier/eslint-plugin-prettier/commit/f58b6c7c356a37b437593cd6ff8d1dca1c437b13)) - docs(README): fix prettier getFileInfo link ([#​335]([email protected]:prettier/eslint-plugin-prettier/issues/335)) ([5a690f1]([email protected]:prettier/eslint-plugin-prettier/commit/5a690f14d793ba5a08c55287fa3d6338dcda21ba)) - build(deps-dev): bump eslint-plugin-eslint-plugin from 2.2.2 to 2.3.0 ([8614c45]([email protected]:prettier/eslint-plugin-prettier/commit/8614c458ed284bc126034d432b49b07d7d67ef06)) - build(deps-dev): bump eslint from 7.3.0 to 7.3.1 ([12d9ed8]([email protected]:prettier/eslint-plugin-prettier/commit/12d9ed877aacfad2c27f01161cc2eb28a445725f)) - build(deps-dev): bump eslint from 7.2.0 to 7.3.0 ([5a6f42e]([email protected]:prettier/eslint-plugin-prettier/commit/5a6f42e4eda871a294da1eb55f214c475450faa6)) - chore: update CI badge in readme ([5012b66]([email protected]:prettier/eslint-plugin-prettier/commit/5012b665f981edbc21feaaccb3cd297f49ca40d3)) - Use Github Actions for CI ([#​305]([email protected]:prettier/eslint-plugin-prettier/issues/305)) ([41eb64f]([email protected]:prettier/eslint-plugin-prettier/commit/41eb64fda33663ed1c43a85218f390c6cd4b6191)) ### [`v3.1.4`](https://togithub.com/prettier/eslint-plugin-prettier/blob/master/CHANGELOG.md#v314-2020-06-14) [Compare Source](https://togithub.com/prettier/eslint-plugin-prettier/compare/v3.1.3...v3.1.4) - Avoid clearing Prettier cache when not using prettierrc ([#​303]([email protected]:prettier/eslint-plugin-prettier/issues/303)) ([3c8e2d9]([email protected]:prettier/eslint-plugin-prettier/commit/3c8e2d9871d86a82b10fe3d54f32bb5a54f2913b)) - build(deps-dev): bump eslint-plugin-eslint-plugin from 2.2.1 to 2.2.2 ([93f7c8b]([email protected]:prettier/eslint-plugin-prettier/commit/93f7c8be7c99a0c3e4b11be6a5311316f76e6e08)) - build(deps-dev): bump eslint from 7.1.0 to 7.2.0 ([650ac7a]([email protected]:prettier/eslint-plugin-prettier/commit/650ac7a40c1f4d46b0bd37efad3eed84f8155a44)) - build(deps-dev): bump eslint-plugin-self from 1.2.0 to 1.2.1 ([6449ec1]([email protected]:prettier/eslint-plugin-prettier/commit/6449ec151f119e98d69da91ad6d10dbb374162d8)) - build(deps-dev): bump eslint from 7.0.0 to 7.1.0 ([fd30022]([email protected]:prettier/eslint-plugin-prettier/commit/fd30022a51a57a4e96dd4ab3e04956b945886874)) - Chore: Add CI tests for ESLint 7 ([#​291]([email protected]:prettier/eslint-plugin-prettier/issues/291)) ([cc2979b]([email protected]:prettier/eslint-plugin-prettier/commit/cc2979b68258b8545931ce37168adfe17b1d3a7b)) - build(deps-dev): bump eslint-config-prettier from 6.10.1 to 6.11.0 ([35a7ee6]([email protected]:prettier/eslint-plugin-prettier/commit/35a7ee68b02ea3088270210ac8dc85ff47ef65a9)) </details> --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/carbon-design-system/carbon-for-ibm-dotcom-web-components-test).
At Airbnb we've noticed that the Prettier ESLint rule is extraordinarily
slow. When running ESLint with
TIMING=1
, Prettier is two orders ofmagnitude slower than our other slowest rules (which come from
eslint-plugin-import mostly).
I spent some time investigating this today. I ran the Chrome DevTools
profiler while running ESLint on a directory with 480 files in it.
Looking at the flame charts, I noticed that this plugin ended up calling
Prettier's pluginSearchDirs.map.pluginSearchDir for every file that was
being linted, even though it was being memoized. Through some logging, I
determined that the Prettier cache was being cleared between every file,
and narrowed it down to this line, which was added here:
#55 (comment)
It looks like this cache busting was added to make it so long-running
ESLint processes (e.g. for vscode-eslint) would be able to pick up
changes to prettierrc files without having to reload the process.
Thankfully, we don't use a prettierrc file at Airbnb right now, in favor
of putting our Prettier config inline with our ESLint config. So the
quick performance fix for us is to simply skip the cache busting when
this option is not enabled.
In my profiling, this reduces the time spent in ESLint's verifyAndFix
when running on the same 480 files from 34 seconds to 26 seconds, for a
total savings of 8 seconds.
For folks who are using prettierrc files, this is still pretty crappy,
so it would be great to find a better way to do this. Unfortunately my
knowledge of the inner workings of vscode-eslint and ESLint are not
enough to know if there might be a better way to do this--e.g. maybe
there's some ESLint option that we can respect here?
Before:
After: