Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use clang-format in lieu of Prettier #107

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
Language: JavaScript

ColumnLimit: 0
ContinuationIndentWidth: 8
IndentWidth: 4
UseTab: ForContinuationAndIndentation
TabWidth: 4
SpacesInContainerLiterals: false

AlignAfterOpenBracket: DontAlign
AlignOperands: false
AllowAllArgumentsOnNextLine: true
AllowShortBlocksOnASingleLine: Empty
AllowShortCaseLabelsOnASingleLine : false
AllowShortFunctionsOnASingleLine: None
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeTernaryOperators: false
# InsertTrailingCommas: Wrapped
JavaScriptQuotes: Double
JavaScriptWrapImports: true

BinPackArguments: true
BinPackParameters: true

BreakBeforeBraces: Custom
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterEnum: false
AfterFunction: false
AfterControlStatement: Never
BeforeCatch : false
BeforeElse : false

IndentCaseLabels: true
17 changes: 17 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,21 @@
},
"typescript.tsdk": "node_modules/typescript/lib",
"typescript.preferences.importModuleSpecifierEnding": "js",
"clang-format.executable": "${workspaceRoot}/node_modules/.bin/clang-format",
"[javascript]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "xaver.clang-format"
},
"[typescript]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "xaver.clang-format"
},
"[json]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "xaver.clang-format"
},
"[html]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "xaver.clang-format"
},
}
Loading