Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: prettier/eslint-plugin-prettier
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v3.1.3
Choose a base ref
...
head repository: prettier/eslint-plugin-prettier
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v3.1.4
Choose a head ref
  • 8 commits
  • 5 files changed
  • 4 contributors

Commits on Apr 22, 2020

  1. Copy the full SHA
    35a7ee6 View commit details

Commits on May 9, 2020

  1. Copy the full SHA
    cc2979b View commit details

Commits on May 25, 2020

  1. build(deps-dev): bump eslint from 7.0.0 to 7.1.0

    Bumps [eslint](https://github.com/eslint/eslint) from 7.0.0 to 7.1.0.
    - [Release notes](https://github.com/eslint/eslint/releases)
    - [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
    - [Commits](eslint/eslint@v7.0.0...v7.1.0)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    dependabot-preview[bot] committed May 25, 2020
    Copy the full SHA
    fd30022 View commit details

Commits on May 27, 2020

  1. Copy the full SHA
    6449ec1 View commit details

Commits on Jun 8, 2020

  1. build(deps-dev): bump eslint from 7.1.0 to 7.2.0

    Bumps [eslint](https://github.com/eslint/eslint) from 7.1.0 to 7.2.0.
    - [Release notes](https://github.com/eslint/eslint/releases)
    - [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
    - [Commits](eslint/eslint@v7.1.0...v7.2.0)
    
    Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
    dependabot-preview[bot] committed Jun 8, 2020
    Copy the full SHA
    650ac7a View commit details

Commits on Jun 10, 2020

  1. Copy the full SHA
    93f7c8b View commit details

Commits on Jun 14, 2020

  1. Avoid clearing Prettier cache when not using prettierrc (#303)

    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:
    
      #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?
    lencioni authored Jun 14, 2020
    Copy the full SHA
    3c8e2d9 View commit details
  2. Copy the full SHA
    f0394c4 View commit details
Showing with 230 additions and 123 deletions.
  1. +12 −4 .travis.yml
  2. +10 −0 CHANGELOG.md
  3. +6 −1 eslint-plugin-prettier.js
  4. +4 −4 package.json
  5. +198 −114 yarn.lock
16 changes: 12 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
language: node_js
cache: yarn
node_js:
- "10"
- "8"
- "6"
- 14
- 12
- 10
- 8
- 6
env:
- ESLINT_VERSION=current
- ESLINT_VERSION=^6
- ESLINT_VERSION=^5
matrix:
exclude:
# eslint 7 only supports node ^10.12 || >=12
- node_js: 8
env: ESLINT_VERSION=current
# eslint 6 only supports node >=8.10
- node_js: "6"
- node_js: 6
env: ESLINT_VERSION=current
- node_js: 6
env: ESLINT_VERSION=^6
install:
- if [[ $ESLINT_VERSION != "current" ]]; then
yarn upgrade "eslint@$ESLINT_VERSION";
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## v3.1.4 (2020-06-14)

* Avoid clearing Prettier cache when not using prettierrc ([#303](git@github.com:prettier/eslint-plugin-prettier/issues/303)) ([3c8e2d9](git@github.com:prettier/eslint-plugin-prettier/commit/3c8e2d9871d86a82b10fe3d54f32bb5a54f2913b))
* build(deps-dev): bump eslint-plugin-eslint-plugin from 2.2.1 to 2.2.2 ([93f7c8b](git@github.com:prettier/eslint-plugin-prettier/commit/93f7c8be7c99a0c3e4b11be6a5311316f76e6e08))
* build(deps-dev): bump eslint from 7.1.0 to 7.2.0 ([650ac7a](git@github.com:prettier/eslint-plugin-prettier/commit/650ac7a40c1f4d46b0bd37efad3eed84f8155a44))
* build(deps-dev): bump eslint-plugin-self from 1.2.0 to 1.2.1 ([6449ec1](git@github.com:prettier/eslint-plugin-prettier/commit/6449ec151f119e98d69da91ad6d10dbb374162d8))
* build(deps-dev): bump eslint from 7.0.0 to 7.1.0 ([fd30022](git@github.com:prettier/eslint-plugin-prettier/commit/fd30022a51a57a4e96dd4ab3e04956b945886874))
* Chore: Add CI tests for ESLint 7 ([#291](git@github.com:prettier/eslint-plugin-prettier/issues/291)) ([cc2979b](git@github.com:prettier/eslint-plugin-prettier/commit/cc2979b68258b8545931ce37168adfe17b1d3a7b))
* build(deps-dev): bump eslint-config-prettier from 6.10.1 to 6.11.0 ([35a7ee6](git@github.com:prettier/eslint-plugin-prettier/commit/35a7ee68b02ea3088270210ac8dc85ff47ef65a9))

## v3.1.3 (2020-04-13)

* Fix: Set `meta.type` to "layout" ([#283](git@github.com:prettier/eslint-plugin-prettier/issues/283)) ([97152e2](git@github.com:prettier/eslint-plugin-prettier/commit/97152e2787bf9bb27f053d6a91ccf826dc96a505))
7 changes: 6 additions & 1 deletion eslint-plugin-prettier.js
Original file line number Diff line number Diff line change
@@ -152,7 +152,12 @@ module.exports = {
const filepath = context.getFilename();
const source = sourceCode.text;

if (prettier && prettier.clearConfigCache) {
// 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();
}

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-plugin-prettier",
"version": "3.1.3",
"version": "3.1.4",
"description": "Runs prettier as an eslint rule",
"keywords": [
"eslint",
@@ -31,12 +31,12 @@
"prettier-linter-helpers": "^1.0.0"
},
"peerDependencies": {
"eslint": ">= 5.0.0",
"prettier": ">= 1.13.0"
"eslint": ">=5.0.0",
"prettier": ">=1.13.0"
},
"devDependencies": {
"@not-an-aardvark/node-release-script": "^0.1.0",
"eslint": "^6.0.0",
"eslint": "^7.0.0",
"eslint-config-not-an-aardvark": "^2.1.0",
"eslint-config-prettier": "^6.0.0",
"eslint-plugin-eslint-plugin": "^2.0.0",
312 changes: 198 additions & 114 deletions yarn.lock

Large diffs are not rendered by default.