Last active
April 20, 2019 01:18
-
-
Save piotrwitek/b2030dd9b2cbc6a9396c6e508a3ee67b to your computer and use it in GitHub Desktop.
TSLint rules with ESLint/React extension based on airbnb style guide
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"rules": { | |
"align": [ | |
true, | |
"parameters", | |
"arguments", | |
"statements" | |
], | |
"ban": false, | |
"class-name": true, | |
"comment-format": [ | |
true, | |
"check-space" | |
], | |
"curly": false, | |
"eofline": true, | |
"forin": true, | |
"indent": [ | |
true, | |
"spaces" | |
], | |
"linebreak-style": [true, "LF"], | |
"interface-name": false, | |
"jsdoc-format": true, | |
"label-position": true, | |
"label-undefined": true, | |
"max-line-length": [ | |
true, | |
140 | |
], | |
"member-ordering": [ | |
true, | |
"public-before-private", | |
"static-before-instance", | |
"variables-before-functions" | |
], | |
"no-any": false, | |
"no-arg": true, | |
"no-bitwise": true, | |
"no-console": [ | |
true, | |
"debug", | |
"info", | |
"time", | |
"timeEnd", | |
"trace" | |
], | |
"no-construct": true, | |
"no-constructor-vars": false, | |
"no-debugger": true, | |
"no-duplicate-key": true, | |
"no-shadowed-variable": true, | |
"no-duplicate-variable": true, | |
"no-empty": true, | |
"no-eval": true, | |
"no-internal-module": true, | |
"no-require-imports": true, | |
"no-string-literal": true, | |
"no-switch-case-fall-through": true, | |
"trailing-comma": { | |
"singleline": "never", | |
"multiline": "always" | |
}, | |
"no-trailing-whitespace": true, | |
"no-unreachable": true, | |
"no-unused-expression": true, | |
"no-unused-variable": [true, "react"], | |
"no-use-before-declare": true, | |
"no-var-keyword": true, | |
"no-var-requires": false, | |
"one-line": [ | |
true, | |
"check-open-brace", | |
"check-catch", | |
"check-else", | |
"check-whitespace" | |
], | |
"quotemark": [ | |
true, | |
"single", | |
"jsx-double" | |
], | |
"radix": true, | |
"semicolon": [ | |
true, | |
"always" | |
], | |
"switch-default": true, | |
"triple-equals": [ | |
true, | |
"allow-null-check" | |
], | |
"typedef": [ | |
false, | |
"call-signature", | |
"parameter", | |
"property-declaration", | |
"member-variable-declaration" | |
], | |
"typedef-whitespace": [ | |
true, { | |
"call-signature": "nospace", | |
"index-signature": "nospace", | |
"parameter": "nospace", | |
"property-declaration": "nospace", | |
"variable-declaration": "nospace" | |
} | |
], | |
"use-strict": [ | |
false, | |
"check-module", | |
"check-function" | |
], | |
"variable-name": [ | |
true, | |
"ban-keywords" | |
], | |
"whitespace": [ | |
true, | |
"check-branch", | |
"check-decl", | |
"check-operator", | |
"check-separator", | |
"check-type" | |
] | |
} | |
} |
updated config for TSLint v5.0: https://github.com/piotrwitek/react-redux-typescript-guide#tslintjson
Nice! Thank you @piotrwitek ๐ ๐
Update:
"member-ordering": [
true,
{
"order": [
"public-before-private",
"static-before-instance",
"variables-before-functions"
]
}
]
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Great job! That's exactly what I was looking for.
I think a couple of rules must be updated:
"interface-name": [false]
"trailing-comma": [true, {"multiline": "always", "singleline": "never"}]
Both rules now require arrays.
These rules were deprecated:
label-undefined
no-duplicate-key
no-unreachable
use-strict
These rules were renamed:
no-constructor-vars
tono-parameter-properties
Good job!