react/.prettierrc.js
Jan Kassens 70484844bf
[BE] switch to hermes parser for prettier (#30421)
This will allow us to parse new flow syntax since the `flow` parser is
no longer updated.

I had to exclude some files and have them fall back to `flow` parser
since they contain invalid graphql syntax that makes the plugin crash.
2024-07-22 19:16:13 -04:00

36 lines
669 B
JavaScript

'use strict';
const {esNextPaths} = require('./scripts/shared/pathsByLanguageVersion');
module.exports = {
plugins: ['prettier-plugin-hermes-parser'],
bracketSpacing: false,
singleQuote: true,
bracketSameLine: true,
trailingComma: 'es5',
printWidth: 80,
parser: 'hermes',
arrowParens: 'avoid',
overrides: [
{
files: ['*.code-workspace'],
options: {
parser: 'json-stringify',
},
},
{
files: esNextPaths,
options: {
trailingComma: 'all',
},
},
{
files: ['*.ts', '*.tsx'],
options: {
trailingComma: 'all',
parser: 'typescript',
},
},
],
};