-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathprettier.config.cjs
50 lines (45 loc) · 1.48 KB
/
prettier.config.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
47
48
49
50
const prettierPluginSvelte = require("prettier-plugin-svelte");
const prettierPluginPug = require("@prettier/plugin-pug");
// const prettierPluginOrganizeImports = require('prettier-plugin-organize-imports');
// @ts-check
/// <reference types="./src/prettier" />
/// <reference types="@prettier/plugin-pug/src/prettier" />
/**
* @type {import('prettier').Options}
*/
module.exports = {
plugins: [prettierPluginPug, prettierPluginSvelte],
overrides: [{ files: "*.svelte", options: { parser: "svelte" } }],
arrowParens: "always",
bracketSpacing: true,
htmlWhitespaceSensitivity: "strict",
pluginSearchDirs: false,
printWidth: 80,
quoteProps: "consistent",
semi: true,
singleQuote: false,
singleAttributePerLine: true,
tabWidth: 2,
trailingComma: "all",
useTabs: true,
// prettier pug plugin options
// https://prettier.github.io/plugin-pug/guide/pug-specific-options.html
// https://prettier.github.io/plugin-pug/guide/standard-prettier-overrides.html
pugArrowParens: "always",
pugClassLocation: "before-attributes",
pugClassNotation: "as-is",
pugEmptyAttributes: "as-is",
pugExplicitDiv: false,
pugFramework: "svelte",
pugIdNotation: "as-is",
pugSingleFileComponentIndentation: false,
pugSortAttributes: "asc",
pugSortAttributesBeginning: ["(class)"],
pugTabWidth: 2,
pugWrapAttributesPattern: "(style)",
pugWrapAttributesThreshold: 1,
// prettier svelte plugin options
// https://github.com/sveltejs/prettier-plugin-svelte
svelteAllowShorthand: true,
svelteStrictMode: true,
};