vehicle-monitor/.prettierrc.js

47 lines
1.9 KiB
JavaScript
Raw Permalink Normal View History

2025-02-25 23:14:50 +08:00
export default {
// (x)=>{},单个参数箭头函数是否显示小括号。(always:始终显示;avoid:省略括号。默认:always)
2025-02-28 20:14:37 +08:00
arrowParens: "always",
2025-02-25 23:14:50 +08:00
// 开始标签的右尖括号是否跟随在最后一行属性末尾默认false
bracketSameLine: false,
// 对象字面量的括号之间打印空格 (true - Example: { foo: bar } ; false - Example: {foo:bar})
bracketSpacing: true,
// 是否格式化一些文件中被嵌入的代码片段的风格(auto|off;默认auto)
2025-02-28 20:14:37 +08:00
embeddedLanguageFormatting: "auto",
2025-02-25 23:14:50 +08:00
// 指定 HTML 文件的空格敏感度 (css|strict|ignore;默认css)
2025-02-28 20:14:37 +08:00
htmlWhitespaceSensitivity: "ignore",
2025-02-25 23:14:50 +08:00
// 当文件已经被 Prettier 格式化之后,是否会在文件顶部插入一个特殊的 @format 标记默认false
insertPragma: false,
// 在 JSX 中使用单引号替代双引号默认false
jsxSingleQuote: false,
// 每行最多字符数量,超出换行(默认100)
printWidth: 100,
// 超出打印宽度 (always | never | preserve )
2025-02-28 20:14:37 +08:00
proseWrap: "preserve",
2025-02-25 23:14:50 +08:00
// 对象属性是否使用引号(as-needed | consistent | preserve;默认as-needed:对象的属性需要加引号才添加;)
2025-02-28 20:14:37 +08:00
quoteProps: "as-needed",
2025-02-25 23:14:50 +08:00
// 是否只格式化在文件顶部包含特定注释(@prettier| @format)的文件默认false
requirePragma: false,
// 结尾添加分号
semi: true,
// 使用单引号 (true:单引号;false:双引号)
2025-02-26 16:31:59 +08:00
singleQuote: true,
2025-02-25 23:14:50 +08:00
// 缩进空格数默认2个空格
tabWidth: 2,
// 元素末尾是否加逗号默认es5: ES5中的 objects, arrays 等会添加逗号TypeScript 中的 type 后不加逗号
2025-02-28 20:14:37 +08:00
trailingComma: "es5",
2025-02-25 23:14:50 +08:00
// 指定缩进方式空格或tab默认false即使用空格
useTabs: false,
2025-02-28 20:14:37 +08:00
// vue 文件中是否缩进 <style> 和 <script> 标签,默认 false
2025-02-25 23:14:50 +08:00
vueIndentScriptAndStyle: false,
2025-02-24 18:23:33 +08:00
2025-02-28 20:14:37 +08:00
endOfLine: "auto",
2025-02-25 23:14:50 +08:00
overrides: [
{
2025-02-28 20:14:37 +08:00
files: "*.html",
2025-02-25 23:14:50 +08:00
options: {
2025-02-28 20:14:37 +08:00
parser: "html",
2025-02-25 23:14:50 +08:00
},
},
],
2025-02-24 18:23:33 +08:00
};