Please disregard if you don’t care about typescript linting or formatting.
I have a proposal for some changes to the tslint
settings(hawkular/console/src/main/scripts/tslint.json). There are lots of little changes
that need to be done to the code because of this tslint policy change. However, these
changes produce more consistent, readable code that is better for long term maintenance.
For further reference on tslint rules see:
http://palantir.github.io/tslint/rules/ <
http://palantir.github.io/tslint/rules/>
The second question I have is if this changes are agreed upon. When should it get put in?
I’m of the mindset that it should be put in now, but happy to hear any other arguments
against it.
HINT: With Webstorm 11, it can read in the tslint file and interactively show all the
tslint hints in the code.
Sorry, I didn’t include the diff file.
hawkular/console/src/main/scripts/tslint.json:
{
"rules": {
"class-name": true,
"curly": true,
"eofline": true,
"forin": true,
"indent": [true, "spaces"],
"label-position": true,
"label-undefined": true,
"max-line-length": [true, 120],
"member-access": true,
"no-arg": true,
"no-bitwise": true,
"no-console": [true,
"trace"
],
"no-construct": true,
"no-debugger": false,
"no-duplicate-key": true,
"no-duplicate-variable": true,
"no-empty": true,
"no-eval": true,
"no-require-imports": true,
"no-string-literal": false,
"no-switch-case-fall-through": true,
"no-shadowed-variable": true,
"no-trailing-comma": true,
"no-trailing-whitespace": false,
"no-unused-expression": true,
"no-unused-variable": true,
"no-unreachable": true,
"no-use-before-declare": true,
"no-var-keyword": true,
"one-line": [true,
"check-open-brace",
"check-whitespace",
"check-catch",
"check-else"
],
"quotemark": [true, "single"],
"radix": false,
"semicolon": true,
"triple-equals": [true, "allow-null-check"],
"typedef-whitespace": [true],
"variable-name": [true, "ban-keywords", "check-format",
"allow-leading-underscore"],
"whitespace": [true,
"check-decl",
"check-operator",
"check-type"
],
"license-header": [ true,
"/// Copyright 2014-2016 Red Hat, Inc. and/or its affiliates\n/// and other
contributors as indicated by the @author tags.\n///\n/// Licensed under the Apache
License, Version 2.0 (the \"License\");\n/// you may not use this file except in
compliance with the License.\n/// You may obtain a copy of the License at\n///\n///
http://www.apache.org/licenses/LICENSE-2.0\n///\n/// Unless required by applicable law or
agreed to in writing, software\n/// distributed under the License is distributed on an
\"AS IS\" BASIS,\n/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
express or implied.\n/// See the License for the specific language governing permissions
and\n/// limitations under the License."
]
}
}