-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathprettier.config.mjs
56 lines (53 loc) · 1.49 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
/** @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',
semi: true,
tabWidth: 2,
printWidth: 140,
singleQuote: true,
trailingComma: 'all',
bracketSpacing: true,
plugins: ['prettier-plugin-astro', '@ianvs/prettier-plugin-sort-imports', 'prettier-plugin-tailwindcss'],
importOrder: [
'<THIRD_PARTY_MODULES>',
'^@components/(.*)$',
'^@content/(.*)$',
'^@layouts/(.*)$',
'^@pages/(.*)$',
'^@data/(.*)$',
'^@styles/(.*)$',
'^@/(.*)$',
'^.[./].*',
'',
],
importOrderParserPlugins: ['typescript', 'astro', 'jsx', 'decorators', 'svelte', 'vue', 'html'],
importOrderSeparation: false,
importOrderSortSpecifiers: true,
importOrderBuiltinModulesToTop: true,
importOrderMergeDuplicateImports: true,
importOrderCombineTypeAndValueImports: true,
tailwindConfig: './tailwind.config.mjs',
tailwindFunctions: ['cn', 'clsx', 'cva'],
overrides: [
{
files: ['*.json', '*.md', '*.toml', '*.yml'],
options: {
useTabs: false,
},
},
{
files: ['*.astro'],
options: {
parser: 'astro',
},
},
],
};
export default config;
/**
* @reference
* https://github.com/Zyruks/astro-starter/blob/main/docs/code-quality-tools/prettier.md
*/