Skip to content

Commit cd4a328

Browse files
SamChou19815facebook-github-bot
authored andcommitted
Prepare relay for prettier v3
Reviewed By: pieterv Differential Revision: D78686859 fbshipit-source-id: 88daa2d20abcce4721d689a661d68c4448bbd195
1 parent cbd9c0f commit cd4a328

File tree

2 files changed

+27
-9
lines changed

2 files changed

+27
-9
lines changed

.prettierrc.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/**
2+
* Copyright (c) Meta Platforms, Inc. and affiliates.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*
7+
* @format
8+
* @oncall relay
9+
*/
10+
11+
module.exports = {
12+
arrowParens: 'avoid',
13+
bracketSameLine: true,
14+
bracketSpacing: false,
15+
requirePragma: true,
16+
singleQuote: true,
17+
trailingComma: 'all',
18+
parser: 'hermes',
19+
plugins: [
20+
// Using module.parent and createRequire hack to simulate prettier v2 plugin resolution behavior.
21+
// The hack allows us to resolve the plugin from the install location of prettier.
22+
(module.parent
23+
? require('module').createRequire(module.parent.id)
24+
: require
25+
).resolve('prettier-plugin-hermes-parser'),
26+
],
27+
};

package.json

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,6 @@
8888
"node": ">=18.x",
8989
"npm": ">=8.x"
9090
},
91-
"prettier": {
92-
"arrowParens": "avoid",
93-
"bracketSameLine": true,
94-
"bracketSpacing": false,
95-
"requirePragma": true,
96-
"singleQuote": true,
97-
"trailingComma": "all",
98-
"parser": "hermes"
99-
},
10091
"jest": {
10192
"testMatch": [
10293
"<rootDir>/packages/**/__tests__/**/*-test.js"

0 commit comments

Comments
 (0)