TingYu Tools

代码格式化

Prettier 多语言

codeFormatter.inputTitle

codeFormatter.inputHint

codeFormatter.basicOptions

⚙️ codeFormatter.advancedOptions
💡 codeFormatter.usageGuide

codeFormatter.whatIsPrettier

codeFormatter.prettierDesc

codeFormatter.features

  • 支持 JavaScript、TypeScript、HTML、CSS 等多种语言
  • 自动调整缩进、换行、空格
  • 统一引号、分号、逗号风格
  • 实时预览格式化结果

codeFormatter.useCases

  • codeFormatter.useCase1
  • codeFormatter.useCase2
  • codeFormatter.useCase3
  • codeFormatter.useCase4

codeFormatter.bestPractices

  • 使用 2 空格缩进(更紧凑)
  • JavaScript/TypeScript 建议使用单引号
  • 保持每行 80-120 字符以内
  • 使用 ES5 尾随逗号(兼容性好)
  • 启用自动格式化提高效率

codeFormatter.result

function hello(name) {
  console.log('hi', name)
}
codeFormatter.totalLines4
codeFormatter.codeLines3
codeFormatter.totalChars51
codeFormatter.words6
codeFormatter.formatConfig
codeFormatter.languagebabel
codeFormatter.indent2 空格
codeFormatter.quotes单引号
codeFormatter.semicolons不使用