-
Notifications
You must be signed in to change notification settings - Fork 0
/
prettier.config.mjs
37 lines (36 loc) · 985 Bytes
/
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
import { getSupportInfo } from 'prettier';
export default getSupportInfo()
.then(({ languages }) => {
return languages
.map(({ extensions }) => extensions)
.reduce((acc, arr) => [...acc, ...arr], [])
.filter((ext, i, exts) => exts.indexOf(ext) === i)
.map((ext) => ext.substring(1));
})
.then((arr) => `(${arr.join('|')})`)
.then((ext) => ({
tabWidth: 2,
useTabs: false,
endOfLine: 'lf',
printWidth: 80,
semi: true,
singleQuote: true,
trailingComma: 'none',
bracketSpacing: true,
arrowParens: 'always',
proseWrap: 'never',
overrides: [
{
files: [
'**/*.md',
`**/docs/**/*.${ext}`,
`**/{lib,pkg,out,dist,build,vendor,deploy,coverage}/**/*.${ext}`,
`**/{.cache,.vscode,.vercel,.tsup,node_modules}/**/*.${ext}`
],
options: {
parser: 'ignores',
plugins: ['./config/prettier.plugin.mjs']
}
}
]
}));