新的介绍内容:
简介
EJS Beautify 是为VS Code设计的EJS文件格式化扩展,旨在帮助开发者提升代码的可读性和维护性。它采用'js-beautify'作为格式引擎,确保您的EJS代码得到最佳的格式化处理。
最新版本:1.0.6
当前版本已发布,带来更稳定的性能和更多功能。
设置指南
要开始使用EJS Beautify,请在VS Code的settings.json
文件中添加以下配置:
"emmet.includeLanguages": {
"ejs": "html",
},
"[html]": {
"editor.defaultFormatter": "j69.ejs-beautify"
},
外部文件设置
为了满足团队特定需求,您可以在工作区中放置一个.ejsbrc.json
文件来定义格式化规则。如果没有.ejsbrc.json
文件,将使用settings.json
中的设置。以下是可配置设置的示例及其默认值:
.ejsbrc.json
{
"formatting": true,
"indent_size": 2,
"indent_char": " ",
"indent_with_tabs": false,
"editorconfig": false,
"eol": "\n",
"end_with_newline": false,
"indent_level": 0,
"preserve_newlines": true,
"max_preserve_newlines": 5,
"space_in_paren": false,
"space_in_empty_paren": false,
"jslint_happy": false,
"space_after_anon_function": false,
"space_after_named_function": false,
"space_before_conditional": true,
"brace_style": "collapse",
"unindent_chained_methods": false,
"break_chained_methods": false,
"keep_array_indentation": false,
"unescape_strings": false,
"wrap_line_length": 0,
"e4x": false,
"comma_first": false,
"operator_position": "before-newline",
"indent_empty_lines": false,
"templating": ["erb", "django", "handlebars", "php"],
"indent_inner_html": false,
"indent_body_inner_html": true,
"indent_head_inner_html": true,
"indent_handlebars ": true,
"wrap_attributes": "auto",
"wrap_attributes_indent_size": 4,
"extra_liners": "['head', 'body', '/html']",
"inline": [
"a",
"abbr",
"area",
"audio",
"b",
"bdi",
"bdo",
"br",
"button",
"canvas",
"cite",
"code",
"data",
"datalist",
"del",
"dfn",
"em",
"embed",
"i",
"iframe",
"img",
"input",
"ins",
"kbd",
"keygen",
"label",
"map",
"mark",
"math",
"meter",
"noscript",
"object",
"output",
"progress",
"q",
"ruby",
"s",
"samp",
"select",
"small",
"span",
"strong",
"sub",
"sup",
"svg",
"template",
"textarea",
"time",
"u",
"var",
"video",
"wbr",
"text",
"acronym",
"big",
"strike",
"tt"
],
"void_elements": [
"area",
"base",
"br",
"col",
"embed",
"hr",
"img",
"input",
"keygen",
"link",
"menuitem",
"meta",
"param",
"source",
"track",
"wbr",
"!doctype",
"?xml",
"basefont",
"isindex"
],
"unformatted": [],
"content_unformatted": ["pre", "textarea"],
"unformatted_content_delimiter": "",
"indent_scripts": "normal"
}
通过EJS Beautify,您可以轻松管理和优化EJS文件的格式化,提升开发效率和代码质量。
本站所有资源都是由网友投稿发布,或转载各大下载站, 请自行检测软件的完整性!
本站所有资源仅供学习与参考,请勿用于商业用途,否则 产生的一切后果将由您自己承担!
如有侵权请联系我们删除下架,联系方式:study_golang@163.com