-
Notifications
You must be signed in to change notification settings - Fork 0
/
prettier.config.js
48 lines (41 loc) · 975 Bytes
/
prettier.config.js
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
// @ts-check
/**
* @param {string[][]} groups
*/
const generateImportOrder = groups => {
const result = [];
const groupBreak = '';
for (const group of groups) {
result.push(...group, groupBreak);
}
return result;
};
/**
* @type {import('@ianvs/prettier-plugin-sort-imports').PrettierConfig}
*/
const config = {
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',
};
export default config;