Skip to content

Commit

Permalink
Support Prettier <1.8.0 for getSupportInfo (prettier#707)
Browse files Browse the repository at this point in the history
  • Loading branch information
JHilker authored and CiGit committed Apr 25, 2019
1 parent 5800b23 commit 26fd942
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,10 @@ export function getGroup(group: string): PrettierSupportInfo['languages'] {
}

function getSupportLanguages(prettierInstance: Prettier = bundledPrettier) {
return prettierInstance.getSupportInfo(prettierInstance.version).languages;
// prettier.getSupportInfo was added in [email protected]
if (prettierInstance.getSupportInfo) {
return prettierInstance.getSupportInfo(prettierInstance.version).languages;
} else {
return bundledPrettier.getSupportInfo(prettierInstance.version).languages;
}
}

0 comments on commit 26fd942

Please sign in to comment.