Hey,
We've briefly discussed this but here's the summary of my
preferences/modifications:
"no-trailing-comma": true, => rule name is incorrect, should be
"trailing-comma": [true, {"multiline": "never",
"singleline": "never"}]
"no-trailing-whitespace": false, => should be set to true, line end
whitespace is bad for diffs among other things
"one-line": [true, ... "check-catch", "check-else"], =>
I'm not much of a
one liner person, so if possible not to have else and catch enforced to one
line, I'd appreciate. If not, I hope my brain gets used to it :)
"radix": false, => should be set to true, parseInt without radix might
produce unexpected value
Also, would add
"no-consecutive-blank-lines": true => I don't see the need for more than
a
single blank like, if we want to separate something, we should use a
comment stating what comes below, eg: [blank line] /* From here, only
magic! */ [blank line]. But this is just personal taste :)
Regards,
Alexandre
On Thu, Jan 7, 2016 at 5:26 AM, mike thompson <mithomps(a)redhat.com> wrote:
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/
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."
]
}
}
_______________________________________________
hawkular-dev mailing list
hawkular-dev(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hawkular-dev