From cc9e05a0a97a708d2a3f24ff077be3c7dd07447f Mon Sep 17 00:00:00 2001 From: Lucas Azzola Date: Fri, 12 Jan 2018 23:41:30 +1100 Subject: [PATCH] fix: pass filepath to prettier --- eslint-plugin-prettier.js | 3 ++- package.json | 2 +- yarn.lock | 6 +++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/eslint-plugin-prettier.js b/eslint-plugin-prettier.js index 139faa14..17726508 100644 --- a/eslint-plugin-prettier.js +++ b/eslint-plugin-prettier.js @@ -371,7 +371,8 @@ module.exports = { const prettierOptions = Object.assign( {}, prettierRcOptions, - eslintPrettierOptions + eslintPrettierOptions, + { filepath: context.getFilename() } ); const prettierSource = prettier.format(source, prettierOptions); diff --git a/package.json b/package.json index 91fb551a..84c6533c 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "eslint-plugin-self": "^1.0.1", "mocha": "^3.1.2", "moment": "^2.18.1", - "prettier": "^1.6.1", + "prettier": "^1.10.2", "semver": "^5.3.0" }, "engines": { diff --git a/yarn.lock b/yarn.lock index ffb88b94..782b6d3b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -762,9 +762,9 @@ prelude-ls@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" -prettier@^1.6.1: - version "1.7.0" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.7.0.tgz#47481588f41f7c90f63938feb202ac82554e7150" +prettier@^1.10.2: + version "1.10.2" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.10.2.tgz#1af8356d1842276a99a5b5529c82dd9e9ad3cc93" process-nextick-args@~1.0.6: version "1.0.7"