-
Notifications
You must be signed in to change notification settings - Fork 0
/
prettier.config.cjs
48 lines (42 loc) · 1016 Bytes
/
prettier.config.cjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/* eslint-disable no-undef */
const generateImportOrder = groups => {
const result = [];
const groupBreak = '';
for (const group of groups) {
result.push(...group, groupBreak);
}
return result;
};
module.exports = {
singleQuote: true,
jsxSingleQuote: true,
semi: true,
arrowParens: 'avoid',
printWidth: 120,
tabWidth: 4,
trailingComma: 'all',
plugins: ['@ianvs/prettier-plugin-sort-imports'],
importOrder: generateImportOrder([
[
'^(react/(.*)$)|^(react$)|^(react-native(.*)$)',
'^(next/(.*)$)|^(next$)',
'<BUILTIN_MODULES>',
'<THIRD_PARTY_MODULES>',
],
['^@workspace/(.*)$'],
['^~(.*)$'],
['^[../]', '^[./]'],
]),
/**
* >=5.x
*/
importOrderTypeScriptVersion: '5.0.0',
overrides: [
{
files: ['*.json', '*.jsonc'],
options: {
trailingComma: 'none',
},
},
],
};