Skip to content

Commit 142fa53

Browse files
committed
ts-lint and clang-foramt config update
1 parent 8e206b2 commit 142fa53

File tree

2 files changed

+98
-17
lines changed

2 files changed

+98
-17
lines changed

.clang-format

Lines changed: 47 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,51 @@
11
Language: JavaScript
22
BasedOnStyle: Google
33
IndentWidth: 4
4-
JavaScriptQuotes: Double
5-
ColumnLimit: 120
6-
AlignAfterOpenBracket: Align
7-
AllowAllParametersOfDeclarationOnNextLine: false
8-
BinPackParameters: false
4+
TabWidth: 4
5+
UseTab: Never
6+
7+
AlignAfterOpenBracket: AlwaysBreak
8+
AlignOperands: true
9+
AllowAllParametersOfDeclarationOnNextLine: true
10+
AllowShortBlocksOnASingleLine: false
11+
AllowShortFunctionsOnASingleLine: false
12+
AllowShortIfStatementsOnASingleLine: false
13+
AllowShortLoopsOnASingleLine: false
14+
AlwaysBreakTemplateDeclarations: true
915
BinPackArguments: false
10-
ExperimentalAutoDetectBinPacking: false
16+
BinPackParameters: false
17+
BreakBeforeBraces: Allman
18+
BreakBeforeInheritanceComma: false
19+
BreakConstructorInitializersBeforeComma: true
20+
ColumnLimit: 140
21+
ConstructorInitializerAllOnOneLineOrOnePerLine: false
22+
ConstructorInitializerIndentWidth: 4
23+
ContinuationIndentWidth: 4
24+
Cpp11BracedListStyle: true
25+
DerivePointerAlignment: false
26+
ExperimentalAutoDetectBinPacking: false
27+
IndentCaseLabels: true
28+
IndentWidth: 4
29+
IndentWrappedFunctionNames: false
30+
KeepEmptyLinesAtTheStartOfBlocks: false
31+
MacroBlockBegin: ''
32+
MacroBlockEnd: ''
33+
MaxEmptyLinesToKeep: 1
34+
NamespaceIndentation: All
35+
PenaltyBreakBeforeFirstCallParameter: 10
36+
PenaltyBreakComment: 400
37+
PenaltyBreakFirstLessLess: 200
38+
PenaltyBreakString: 1000
39+
PenaltyExcessCharacter: 1000000
40+
PenaltyReturnTypeOnItsOwnLine: 50
41+
PointerAlignment: Left
42+
SortIncludes: true
43+
SpaceAfterCStyleCast: false
44+
SpaceBeforeAssignmentOperators: true
45+
SpaceBeforeParens: ControlStatements
46+
SpaceInEmptyParentheses: false
47+
SpacesBeforeTrailingComments: 2
48+
SpacesInAngles: false
49+
SpacesInCStyleCastParentheses: false
50+
SpacesInParentheses: false
51+
SpacesInSquareBrackets: false

tslint.json

Lines changed: 51 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,55 @@
11
{
22
"defaultSeverity": "error",
33
"extends": [
4-
"tslint:recommended",
54
"tslint-override"
65
],
76
"jsRules": {},
87
"rules": {
9-
"align": [true, "parameters", "statements", "arguments", "members", "elements"],
8+
"array-type": [true, "array-simple"],
109
"arrow-parens": [true, "ban-single-arg-parens"],
10+
"arrow-return-shorthand": true,
11+
"ban": [true,
12+
{"name": "parseInt", "message": "tsstyle#type-coercion"},
13+
{"name": "parseFloat", "message": "tsstyle#type-coercion"},
14+
{"name": "Array", "message": "tsstyle#array-constructor"}
15+
],
16+
"ban-types": [true,
17+
["Object", "Use {} instead."],
18+
["String", "Use 'string' instead."],
19+
["Number", "Use 'number' instead."],
20+
["Boolean", "Use 'boolean' instead."]
21+
],
1122
"class-name": true,
12-
"forin": false,
13-
"no-bitwise": false,
14-
"indent": [true, "spaces", 4],
23+
"curly": [true, "ignore-same-line"],
24+
"deprecation": true,
25+
"forin": true,
26+
"interface-name": [true, "never-prefix"],
27+
"jsdoc-format": true,
28+
"label-position": true,
1529
"max-classes-per-file": 1,
16-
"max-line-length": [true, 120],
17-
"no-console": [false],
18-
"no-namespace": false,
30+
"member-access": [true, "no-public"],
31+
"new-parens": true,
32+
"no-angle-bracket-type-assertion": true,
33+
"no-any": true,
34+
"no-arg": true,
35+
"no-conditional-assignment": true,
36+
"no-construct": true,
37+
"no-debugger": true,
38+
"no-default-export": true,
39+
"no-duplicate-variable": true,
40+
"no-inferrable-types": true,
41+
"no-namespace": [true, "allow-declarations"],
1942
"no-null-keyword": true,
43+
"no-reference": true,
44+
"no-string-throw": true,
45+
"no-unused-expression": true,
46+
"no-var-keyword": true,
47+
"object-literal-shorthand": true,
48+
"only-arrow-functions": [true, "allow-declarations", "allow-named-functions"],
49+
"prefer-const": true,
50+
"radix": true,
51+
"semicolon": [true, "always", "ignore-bound-class-methods"],
52+
"switch-default": true,
2053
"trailing-comma": [
2154
true,
2255
{
@@ -29,13 +62,20 @@
2962
"esSpecCompliant": true
3063
}
3164
],
32-
"interface-name": false,
33-
"radix": false,
65+
"triple-equals": [true, "allow-null-check"],
3466
"typedef": [
3567
true,
3668
"call-signature",
3769
"property-declaration"
38-
]
70+
],
71+
"use-isnan": true,
72+
"variable-name": [
73+
true,
74+
"check-format",
75+
"ban-keywords",
76+
"allow-leading-underscore",
77+
"allow-trailing-underscore"
78+
],
3979
},
4080
"rulesDirectory": []
4181
}

0 commit comments

Comments
 (0)