설정
스타일 설정은 kscript.json의 "format" 아래에 넣으세요. 모든 설정은 선택 사항이에요:
{
"format": {
"indent": 2, // spaces per level, or "tab"
"tab_width": 2, // with "indent": "tab", the columns a tab counts as
"print_width": 80, // the longest a line should be; longer lines are wrapped
"max_blank_lines": 1, // blank lines kept in a row
"end_of_line": "auto", // auto (keep each file's), lf or crlf
"preserve": ["pre-like"], // elements whose content is kept exactly
"rules": {}, // turn rules off, e.g. { "statement_per_line": false }; see below
"enabled": true, // false: no formatting anywhere in this project
"include": ["**/*.kscript", "**/*.ks.xml", "**/*.html"],
"exclude": ["_templates", "node_modules", ".git"]
}
}이 설정은 표준에서 가져올 수도 있어서, 여러 프로젝트가 하나의 스타일을 공유할 수 있어요. 표준 파일의 "format" 아래에 설정을 넣고 kscript.json에서 "standard"로 이름을 지정하세요. 기본 표준인 kscript:recommended는 위의 값을 그대로 적어 둬요. kscript.json가 직접 설정한 값은 표준보다 우선해요.
편집기에서는 kscript.json와 표준 모두 들여쓰기를 설정하지 않을 때 편집기 자체의 탭 설정(editor.tabSize, editor.insertSpaces)이 들여쓰기에 사용돼요. 프로젝트나 표준이 format.indent를 설정하면 그 값이 우선하므로, 프로젝트의 모든 구성원이 같은 결과를 얻어요.