-
Notifications
You must be signed in to change notification settings - Fork 1
/
prettier.config.cjs
35 lines (35 loc) · 1.45 KB
/
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
/** @type {import('prettier').Config} */
module.exports = {
endOfLine: 'lf', // end of line sequence, 'lf' - for linux, 'crlf' - for windows
printWidth: 240, // max 240 chars in line, code is easy to read
semi: true, // enforce semi-colons at the end of statements
useTabs: false, // use spaces instead of tabs
singleQuote: true, // use single quotes instead of double quotes
arrowParens: 'always', // avoid parentheses when single argument
tabWidth: 2, // 2 spaces for indentation
trailingComma: 'all', // avoid trailing commas
bracketSameLine: false, // put brackets on a new line
bracketSpacing: true, // put spaces between brackets
importOrder: [ // import order
'^react(.*)$',
'^(next/(.*)$)|^(next$)',
'<THIRD_PARTY_MODULES>',
'^types$',
'^@([^/]+)$',
'^@/(.*)$',
'^(?!.*[.]css$)[./].*$',
'.css$',
"^[./]",
],
importOrderSeparation: false, // separate groups with blank lines
importOrderSortSpecifiers: true, // sort specifiers
importOrderBuiltinModulesToTop: true, // move built-in modules to the top of the import list
importOrderParserPlugins: [ // parser plugins for import order
'typescript',
'jsx',
'decorators-legacy',
],
importOrderMergeDuplicateImports: true, // merge duplicate imports
importOrderCombineTypeAndValueImports: true, // combine type and value imports
plugins: ['prettier-plugin-tailwindcss', 'prettier-plugin-organize-imports', '@ianvs/prettier-plugin-sort-imports'],
};