|
1 | 1 | module.exports = { |
2 | | - printWidth: 100, |
3 | | - trailingComma: "none", |
4 | | - arrowParens: "avoid", |
5 | | - tabWidth: 4 |
| 2 | + printWidth: 100, // default: 80 |
| 3 | + trailingComma: "none", // "none" | "all" | "es5" |
| 4 | + tabWidth: 2, // default: 2 |
| 5 | + arrowParens: "avoid", // "always" | "avoid" |
| 6 | + endOfLine: "lf", // "lf" | "crlf" | "cr" | "auto" |
| 7 | + useTabs: false, // use tabs instead of spaces |
| 8 | + semi: true, // print semicolons; false to omit |
| 9 | + singleQuote: false, // use single quotes instead of double |
| 10 | + jsxSingleQuote: false, // use single quotes in JSX |
| 11 | + bracketSpacing: true, // spaces in object literals: { foo: bar } |
| 12 | + bracketSameLine: false, // put > of multiline JSX on last line (was jsxBracketSameLine) |
| 13 | + proseWrap: "preserve", // "always" | "never" | "preserve" — wrap markdown prose |
| 14 | + htmlWhitespaceSensitivity: "css", // "css" | "strict" | "ignore" |
| 15 | + vueIndentScriptAndStyle: false, // indent <script> and <style> in Vue files |
| 16 | + singleAttributePerLine: false, // enforce one JSX/HTML attribute per line |
| 17 | + embeddedLanguageFormatting: "auto", // "auto" | "off" — format embedded code (e.g. CSS-in-JS) |
| 18 | + quoteProps: "as-needed", // "as-needed" | "consistent" | "preserve" — object key quoting |
| 19 | + experimentalTernaries: false, // use "curious ternary" style (Prettier 3+) |
| 20 | + requirePragma: false, // only format files with @format pragma |
| 21 | + insertPragma: false, // insert @format pragma at top of formatted files |
| 22 | + rangeStart: 0, // format only a segment of the file (start offset) |
| 23 | + rangeEnd: Infinity, // format only a segment of the file (end offset) |
| 24 | + plugins: [], // list of plugin paths/modules |
| 25 | + overrides: [ |
| 26 | + { |
| 27 | + files: ["*.js", "*.ts", "*.tsx"], |
| 28 | + options: { |
| 29 | + tabWidth: 4 |
| 30 | + } |
| 31 | + } |
| 32 | + ] |
6 | 33 | }; |
0 commit comments