Skip to content

Commit 209e124

Browse files
SamChou19815facebook-github-bot
authored andcommitted
Apply fix of #52787 to an inner prettier config (#52881)
Summary: Pull Request resolved: #52881 Changelog: [Internal] Reviewed By: cipolleschi Differential Revision: D79089990 fbshipit-source-id: 12d5a7defabf877c62113e72099c965351896cf7
1 parent 2532496 commit 209e124

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

private/helloworld/.prettierrc.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,18 @@
77
* @format
88
*/
99

10+
let plugins = ['prettier-plugin-hermes-parser'];
11+
try {
12+
plugins = require('../../.prettier-plugins.fb.js');
13+
} catch {}
14+
1015
module.exports = {
1116
arrowParens: 'avoid',
1217
bracketSameLine: true,
1318
bracketSpacing: false,
1419
singleQuote: true,
1520
trailingComma: 'all',
16-
plugins: [
17-
// Using module.parent and createRequire hack to simulate prettier v2 plugin resolution behavior.
18-
// The hack allows us to resolve the plugin from the install location of prettier.
19-
(module.parent
20-
? require('module').createRequire(module.parent.id)
21-
: require
22-
).resolve('prettier-plugin-hermes-parser'),
23-
],
21+
plugins,
2422
overrides: [
2523
{
2624
files: ['*.js', '*.js.flow'],

0 commit comments

Comments
 (0)