forked from IsaacScript/isaacscript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.prettierrc.cjs
46 lines (41 loc) · 1.66 KB
/
.prettierrc.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
36
37
38
39
40
41
42
43
44
45
46
// This is the configuration file for Prettier, the auto-formatter:
// https://prettier.io/docs/en/configuration.html
/** @type {import("prettier").Config} */
module.exports = {
// https://prettier.io/docs/en/options.html#trailing-commas
// The default is "es5" (only having trailing commas where valid in ES5). However, always having
// trailing commas is objectively better. The Airbnb style guide agrees:
// https://github.com/airbnb/javascript#commas--dangling
// Prettier itself also acknowledges Nik Graf's blog in their official blog:
// https://prettier.io/blog/2020/03/21/2.0.0.html
// https://medium.com/@nikgraf/why-you-should-enforce-dangling-commas-for-multiline-statements-d034c98e36f8
// Prettier will change the default in the future:
// https://github.com/prettier/prettier/issues/9369
trailingComma: "all",
// We want to always use "lf" to be consistent with all platforms.
endOfLine: "lf",
// Allow proper formatting of JSONC files:
// https://github.com/prettier/prettier/issues/5708
overrides: [
{
files: ["**/.vscode/*.json", "**/tsconfig.json", "**/tsconfig.*.json"],
options: {
parser: "json5",
quoteProps: "preserve",
},
},
{
files: ["**/*.xml"],
options: {
printWidth: 1000000,
},
},
],
// Allow proper formatting of XML files:
// https://github.com/prettier/plugin-xml#configuration
// The default is "struct". However, whitespace cannot be reformatted unless this is set to
// "ignore".
xmlWhitespaceSensitivity: "ignore",
// `pnpm` requires that the plugin is explicitly loaded.
plugins: [require.resolve("prettier-plugin-organize-imports")],
};