Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions .prettierrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
* @format
*/

let plugins = ['prettier-plugin-hermes-parser'];
try {
plugins = require('./.prettier-plugins.fb.js');
} catch {}

module.exports = {
arrowParens: 'avoid',
bracketSameLine: true,
Expand All @@ -15,14 +20,7 @@ module.exports = {
singleQuote: true,
trailingComma: 'all',
endOfLine: 'lf',
plugins: [
// Using module.parent and createRequire hack to simulate prettier v2 plugin resolution behavior.
// The hack allows us to resolve the plugin from the install location of prettier.
(module.parent
? require('module').createRequire(module.parent.id)
: require
).resolve('prettier-plugin-hermes-parser'),
],
plugins,
overrides: [
{
files: ['*.code-workspace'],
Expand Down
Loading