generated from t3-oss/create-t3-turbo
-
-
Notifications
You must be signed in to change notification settings - Fork 23
/
prettier.config.mjs
57 lines (51 loc) · 1.63 KB
/
prettier.config.mjs
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
49
50
51
52
53
54
55
56
57
/** @typedef {import('@ianvs/prettier-plugin-sort-imports').PluginConfig} SortImportsConfig */
/** @typedef {import('prettier').Config} PrettierConfig */
/** @typedef {{ tailwindConfig: string }} TailwindConfig */
/** @type {PrettierConfig | SortImportsConfig | TailwindConfig} */
const config = {
arrowParens: 'always',
bracketSpacing: true,
endOfLine: 'lf',
jsxSingleQuote: false,
printWidth: 120,
semi: true,
singleQuote: true,
tabWidth: 2,
trailingComma: 'all',
plugins: ['@ianvs/prettier-plugin-sort-imports', 'prettier-plugin-jsdoc', 'prettier-plugin-tailwindcss'],
/** Tailwind Plugin Config. */
tailwindConfig: './tailwind.config',
tailwindFunctions: ['cn', 'clsx', 'cva'],
/** JSdoc Plugin Config. */
jsdocPrintWidth: 80,
tsdoc: true,
jsdocDescriptionWithDot: true,
jsdocCapitalizeDescription: false,
jsdocCommentLineStrategy: 'keep',
jsdocSeparateReturnsFromParam: false,
jsdocSeparateTagGroups: false,
jsdocPreferCodeFences: false,
jsdocLineWrappingStyle: 'greedy',
/** Sort Imports Plugin Config. */
importOrder: [
'',
'^(expo(.*)$)|^(expo$)',
'^(next/(.*)$)|^(next$)',
'^(react/(.*)$)|^(react$)|^(react-native(.*)$)',
'^@acme/(.*)$',
'^~/components/(.*)$',
'^~/styles/(.*)$',
'^~/utils/(.*)$',
'^~/(.*)$',
'^[./]',
'<THIRD_PARTY_MODULES>',
],
importOrderParserPlugins: ['typescript', 'jsx', 'decorators-legacy'],
};
export default config;
/**
* @reference
* https://github.com/tailwindlabs/prettier-plugin-tailwindcss
* https://www.npmjs.com/package/prettier-plugin-jsdoc
* https://www.npmjs.com/package/@ianvs/prettier-plugin-sort-imports
*/