-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.mjs
67 lines (60 loc) · 1.42 KB
/
index.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
58
59
60
61
62
63
64
65
66
67
import fs from "node:fs";
// https://prettier.io/docs/en/options.html
// https://json.schemastore.org/prettierrc
const config = {
editorconfig: true,
printWidth: 120,
tabWidth: 2,
useTabs: false,
semi: true,
singleQuote: false,
quoteProps: "as-needed",
trailingComma: "all",
bracketSpacing: true,
bracketSameLine: true,
arrowParens: "always",
proseWrap: "preserve", // for markdown wrapping
htmlWhitespaceSensitivity: "css", // <css|strict|ignore>
endOfLine: "lf",
embeddedLanguageFormatting: "off", // <auto|off>
singleAttributePerLine: false, // for html attributes
overrides: [
{
files: ["*.html"],
options: {
parser: "go-template", // see https://prettier.io/docs/en/options#parser
goTemplateBracketSpacing: true,
bracketSameLine: true, // for go-template plugin
}
},
{
files: ["*.js", "*.ts"],
options: {
singleQuote: true
}
},
{
files: "*.properties",
options: {
printWidth: 0
}
}
],
plugins: [
"prettier-plugin-go-template",
"prettier-plugin-sh",
"prettier-plugin-toml",
"prettier-plugin-properties",
"@prettier/plugin-php",
"@prettier/plugin-xml"
],
};
const tailwindPath = "./tailwind.config.js";
try {
if (fs.existsSync(tailwindPath)) {
config.tailwindConfig = tailwindPath;
}
} catch (error) {
console.log(error);
}
export default config;