We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bca77e6 commit 1385310Copy full SHA for 1385310
eslint-plugin-prettier.js
@@ -210,7 +210,13 @@ module.exports = {
210
if (
211
parserBlocklist.indexOf(prettierFileInfo.inferredParser) !== -1
212
) {
213
- initialOptions.parser = 'babylon';
+ // Prettier v1.16.0 renamed the `babylon` parser to `babel`
214
+ // Use the modern name if available
215
+ const supportBabelParser = prettier
216
+ .getSupportInfo()
217
+ .languages.some(language => language.parsers.includes('babel'));
218
+
219
+ initialOptions.parser = supportBabelParser ? 'babel' : 'babylon';
220
}
221
222
const prettierOptions = Object.assign(
0 commit comments