Skip to content

Commit

Permalink
Breaking: Update minimum required pretter version to 1.13.0
Browse files Browse the repository at this point in the history
This lets us remove some conditional checks for some APIs that we now
know will be present.

This shall also allow us to drop pragma support as people can use the
native pragma suppport in prettier (to be done in a later commit).
  • Loading branch information
BPScott authored and not-an-aardvark committed Oct 1, 2018
1 parent be460bd commit 29c0506
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 17 deletions.
25 changes: 9 additions & 16 deletions eslint-plugin-prettier.js
Expand Up @@ -399,22 +399,15 @@ module.exports = {
? FB_PRETTIER_OPTIONS
: context.options[0];

const prettierRcOptions =
usePrettierrc &&
prettier.resolveConfig &&
prettier.resolveConfig.sync
? prettier.resolveConfig.sync(filepath, {
editorconfig: true
})
: null;

// prettier.getFileInfo was added in v1.13
const prettierFileInfo =
prettier.getFileInfo && prettier.getFileInfo.sync
? prettier.getFileInfo.sync(filepath, {
ignorePath: '.prettierignore'
})
: { ignored: false, inferredParser: null };
const prettierRcOptions = usePrettierrc
? prettier.resolveConfig.sync(filepath, {
editorconfig: true
})
: null;

const prettierFileInfo = prettier.getFileInfo.sync(filepath, {
ignorePath: '.prettierignore'
});

// Skip if file is ignored using a .prettierignore file
if (prettierFileInfo.ignored) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -32,7 +32,7 @@
"jest-docblock": "^21.0.0"
},
"peerDependencies": {
"prettier": ">= 0.11.0"
"prettier": ">= 1.13.0"
},
"devDependencies": {
"@not-an-aardvark/node-release-script": "^0.1.0",
Expand Down

0 comments on commit 29c0506

Please sign in to comment.