Skip to content

Commit 0da158f

Browse files
committed
Setup clang-format, tslint and editorconfig
1 parent 907f609 commit 0da158f

File tree

3 files changed

+84
-1
lines changed

3 files changed

+84
-1
lines changed

.editorconfig

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
2+
# This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
3+
# The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
4+
# The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
5+
# Code distributed by Google as part of the polymer project is also
6+
# subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
7+
8+
# Polymer EditorConfig
9+
10+
root = true
11+
12+
[*]
13+
charset = utf-8
14+
indent_size = 2
15+
indent_style = space
16+
trim_trailing_whitespace = true
17+
18+
[*.md]
19+
trim_trailing_whitespace = false

package.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,17 @@
1515
"pretest": "npm run posttest; ln -s node_modules bower_components",
1616
"test": "wct -l chrome",
1717
"posttest": "rm -f bower_components",
18-
"checksize": "uglifyjs lit-html.js -mc --toplevel | gzip -9 | wc -c"
18+
"checksize": "uglifyjs lit-html.js -mc --toplevel | gzip -9 | wc -c",
19+
"format": "find src test | grep '\\.js$\\|\\.ts$' | xargs clang-format --style=file -i",
20+
"lint": "tslint --project ./"
1921
},
2022
"author": "The Polymer Authors",
2123
"devDependencies": {
2224
"@types/chai": "^4.0.1",
2325
"@types/mocha": "^2.2.41",
2426
"chai": "^4.0.2",
2527
"mocha": "^3.4.2",
28+
"tslint": "^5.7.0",
2629
"typedoc": "^0.8.0",
2730
"typescript": "^2.4.1",
2831
"uglify-es": "^3.0.27",

tslint.json

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
{
2+
"rules": {
3+
"arrow-parens": true,
4+
"class-name": true,
5+
"indent": [
6+
true,
7+
"spaces",
8+
2
9+
],
10+
"prefer-const": true,
11+
"no-duplicate-variable": true,
12+
"no-eval": true,
13+
"no-internal-module": true,
14+
"no-trailing-whitespace": true,
15+
"no-var-keyword": true,
16+
"one-line": [
17+
true,
18+
"check-open-brace",
19+
"check-whitespace"
20+
],
21+
"quotemark": [
22+
true,
23+
"single",
24+
"avoid-escape"
25+
],
26+
"semicolon": [
27+
true,
28+
"always"
29+
],
30+
"trailing-comma": [
31+
true,
32+
"multiline"
33+
],
34+
"triple-equals": [
35+
true,
36+
"allow-null-check"
37+
],
38+
"typedef-whitespace": [
39+
true,
40+
{
41+
"call-signature": "nospace",
42+
"index-signature": "nospace",
43+
"parameter": "nospace",
44+
"property-declaration": "nospace",
45+
"variable-declaration": "nospace"
46+
}
47+
],
48+
"variable-name": [
49+
true,
50+
"ban-keywords"
51+
],
52+
"whitespace": [
53+
true,
54+
"check-branch",
55+
"check-decl",
56+
"check-operator",
57+
"check-separator",
58+
"check-type"
59+
]
60+
}
61+
}

0 commit comments

Comments
 (0)