eslint-plugin-prettier
Advanced tools
Comparing version 2.2.0 to 2.3.0
# Changelog | ||
## v2.3.0 (2017-09-18) | ||
* Update: Support .prettierrc config files (fixes [#46](https://github.com/prettier/eslint-plugin-prettier/issues/46)) ([#55](https://github.com/prettier/eslint-plugin-prettier/issues/55)) ([bc89153](https://github.com/prettier/eslint-plugin-prettier/commit/bc89153ffa733b3b58f123849485d7990577c216)) | ||
* Docs: .eslintrc.json > .eslintrc ([#52](https://github.com/prettier/eslint-plugin-prettier/issues/52)) ([95f0808](https://github.com/prettier/eslint-plugin-prettier/commit/95f0808416f7493426c822790d79cf22b0db0f22)) | ||
* Upgrade: jest-docblock to ^21.0.0 ([#50](https://github.com/prettier/eslint-plugin-prettier/issues/50)) ([c777111](https://github.com/prettier/eslint-plugin-prettier/commit/c777111a526c87236b8853d7e253ee93ac1d988d)) | ||
* Chore: upgrade prettier to ^1.6.1 ([#49](https://github.com/prettier/eslint-plugin-prettier/issues/49)) ([56deffa](https://github.com/prettier/eslint-plugin-prettier/commit/56deffae056c0165a7ed2b993b7cf78b6c71148a)) | ||
* Chore: use eslint-plugin-self for linting ([#47](https://github.com/prettier/eslint-plugin-prettier/issues/47)) ([5ea0526](https://github.com/prettier/eslint-plugin-prettier/commit/5ea05269cc947c2e30a42e5101140ab6faac311a)) | ||
## v2.2.0 (2017-08-16) | ||
@@ -4,0 +12,0 @@ |
@@ -309,6 +309,2 @@ /** | ||
create(context) { | ||
const prettierOptions = context.options[0] === 'fb' | ||
? FB_PRETTIER_OPTIONS | ||
: context.options[0]; | ||
const pragma = context.options[1] | ||
@@ -330,6 +326,8 @@ ? context.options[1].slice(1) // Remove leading @ | ||
if ( | ||
!(firstComment && | ||
!( | ||
firstComment && | ||
firstComment.type === 'Block' && | ||
firstComment.loc.start.line === (hasShebang ? 2 : 1) && | ||
firstComment.loc.start.column === 0) | ||
firstComment.loc.start.column === 0 | ||
) | ||
) { | ||
@@ -344,2 +342,6 @@ return {}; | ||
if (prettier) { | ||
prettier.clearConfigCache(); | ||
} | ||
return { | ||
@@ -351,2 +353,17 @@ Program() { | ||
} | ||
const eslintPrettierOptions = | ||
context.options[0] === 'fb' | ||
? FB_PRETTIER_OPTIONS | ||
: context.options[0]; | ||
const prettierRcOptions = | ||
prettier.resolveConfig && prettier.resolveConfig.sync | ||
? prettier.resolveConfig.sync(context.getFilename()) | ||
: null; | ||
const prettierOptions = Object.assign( | ||
{}, | ||
prettierRcOptions, | ||
eslintPrettierOptions | ||
); | ||
const prettierSource = prettier.format(source, prettierOptions); | ||
@@ -353,0 +370,0 @@ if (source !== prettierSource) { |
{ | ||
"name": "eslint-plugin-prettier", | ||
"version": "2.2.0", | ||
"version": "2.3.0", | ||
"description": "Runs prettier as an eslint rule", | ||
@@ -30,3 +30,3 @@ "keywords": [ | ||
"fast-diff": "^1.1.1", | ||
"jest-docblock": "^20.0.1" | ||
"jest-docblock": "^21.0.0" | ||
}, | ||
@@ -42,5 +42,6 @@ "peerDependencies": { | ||
"eslint-plugin-node": "^4.2.2", | ||
"eslint-plugin-self": "^1.0.1", | ||
"mocha": "^3.1.2", | ||
"moment": "^2.18.1", | ||
"prettier": "^1.3.1", | ||
"prettier": "^1.6.1", | ||
"semver": "^5.3.0" | ||
@@ -47,0 +48,0 @@ }, |
@@ -41,3 +41,3 @@ # eslint-plugin-prettier [![Build Status](https://travis-ci.org/prettier/eslint-plugin-prettier.svg?branch=master)](https://travis-ci.org/prettier/eslint-plugin-prettier) | ||
Then, in your `.eslintrc`: | ||
Then, in your `.eslintrc.json`: | ||
@@ -58,4 +58,3 @@ ```json | ||
* The first option: | ||
- Objects are passed directly to Prettier as [options](https://github.com/prettier/prettier#api). Example: | ||
- Objects are passed directly to Prettier as [options](https://github.com/prettier/prettier#options). Example: | ||
@@ -83,2 +82,3 @@ ```json | ||
``` | ||
NB: This option will merge and override any config set with `.prettierrc` files (for Prettier < 1.7.0, [config files are ignored](https://github.com/prettier/eslint-plugin-prettier/issues/46)) | ||
@@ -85,0 +85,0 @@ * The second option: |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24722
371
10
+ Addedjest-docblock@21.2.0(transitive)
- Removedjest-docblock@20.0.3(transitive)
Updatedjest-docblock@^21.0.0