Skip to content

Commit dfed25a

Browse files
committed
introduce clang-format
1 parent 79c7fd3 commit dfed25a

File tree

4 files changed

+34
-1
lines changed

4 files changed

+34
-1
lines changed

.clang-format

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
BasedOnStyle: Google
2+
AlignAfterOpenBracket: AlwaysBreak
3+
AllowAllParametersOfDeclarationOnNextLine: false
4+
AllowShortBlocksOnASingleLine: false
5+
AllowShortCaseLabelsOnASingleLine: false
6+
AllowShortFunctionsOnASingleLine: None
7+
AllowShortIfStatementsOnASingleLine: false
8+
AllowShortLoopsOnASingleLine: false
9+
BinPackArguments: false
10+
# This breaks async functions sometimes, see
11+
# https://github.com/Polymer/polymer-analyzer/pull/393
12+
# BinPackParameters: false

.eslintrc.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ parserOptions:
1414
ecmaVersion: 2017
1515
sourceType: module
1616
rules:
17-
indent: [warn, 2]
17+
indent: off
1818
max-len: [warn, 120]
1919
no-new: warn
2020
quotes: [error, single, {"avoidEscape": true}]

package-lock.json

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"clean:typescript": "npm run build:typescript -- --clean",
99
"clean:styles": "del-cli packages/*/src/*-css.ts",
1010
"dev": "polyserve --npm --module-resolution=node",
11+
"format": "clang-format --version; find packages | grep '\\.js$\\|\\.ts$' | xargs clang-format --style=file -i",
1112
"lint:imports": "node scripts/check-imports.js",
1213
"lint": "npm run lint:typescript",
1314
"lint:typescript": "eslint \"packages/**/*.ts\"",
@@ -35,6 +36,7 @@
3536
"babel-traverse": "^6.24.1",
3637
"babylon": "^6.16.1",
3738
"chai": "^4.2.0",
39+
"clang-format": "^1.2.4",
3840
"command-line-args": "^5.1.1",
3941
"command-line-usage": "^5.0.5",
4042
"del-cli": "^1.1.0",

0 commit comments

Comments
 (0)