@equisoft/tslint-config
Version:
Equisoft's TSLint configuration.
309 lines (304 loc) • 7.44 kB
JSON
{
"defaultSeverity": "error",
"rulesDirectory": "./dist/rules",
"rules": {
// TypeScript
"adjacent-overload-signatures": true,
"invalid-void": [
true,
{
"allow-generics": ["Promise", "PromiseLike"]
}
],
"member-ordering": {
"options": {
"order": [
"public-static-field",
"protected-static-field",
"private-static-field",
"public-instance-field",
"protected-instance-field",
"private-instance-field",
"public-constructor",
"protected-constructor",
"private-constructor",
"static-method",
"instance-method"
]
}
},
"no-import-side-effect": true,
"no-inferrable-types": {
"options": "ignore-params"
},
"no-internal-module": true,
"no-namespace": true,
"no-non-null-assertion": true,
"no-parameter-reassignment": true,
"no-reference": true,
"no-unnecessary-type-assertion": true,
"prefer-for-of": true,
"promise-function-async": true,
"typedef": [
true,
"arrow-call-signature",
"arrow-parameter",
"call-signature",
"member-variable-declaration",
"object-destructuring",
"parameter",
"property-declaration",
"variable-declaration"
],
"typedef-whitespace": {
"options": [
{
"call-signature": "nospace",
"index-signature": "nospace",
"parameter": "nospace",
"property-declaration": "nospace",
"variable-declaration": "nospace"
},
{
"call-signature": "onespace",
"index-signature": "onespace",
"parameter": "onespace",
"property-declaration": "onespace",
"variable-declaration": "onespace"
}
]
},
"unified-signatures": true,
"unnecessary-constructor": [
true,
{
"check-super-calls": true
}
],
// Functionality
// These rules catch common errors in JS programming or otherwise confusing constructs that are prone to producing bugs
"await-promise": {
"options": ["Bluebird"]
},
"ban-comma-operator": true,
"curly": {
"options": "ignore-same-line"
},
"function-constructor": true,
"label-position": true,
"no-arg": true,
"no-async-without-await": true,
"no-bitwise": true,
"no-conditional-assignment": true,
"no-console": {
"options": ["log", "trace", "time", "timeEnd"]
},
"no-construct": true,
"no-debugger": true,
"no-duplicate-super": true,
"no-duplicate-switch-case": true,
"no-dynamic-delete": true,
"no-empty": {
"options": "allow-empty-functions"
},
"no-eval": true,
"no-floating-promises": true,
"no-for-in": true,
"no-for-in-array": true,
"no-implicit-dependencies": {
"options": ["dev"]
},
"no-inferred-empty-object-type": true,
"no-invalid-template-strings": true,
"no-null-undefined-union": true,
"no-object-literal-type-assertion": [
true,
{
"allow-arguments": true
}
],
"no-promise-as-boolean": true,
"no-return-await": true,
"no-shadowed-variable": true,
"no-string-literal": true,
"no-string-throw": true,
"no-switch-case-fall-through": true,
"no-tautology-expression": true,
"no-this-assignment": true,
"no-unsafe-finally": true,
"no-unused-expression": {
"options": "allow-fast-null-checks"
},
"no-var-keyword": true,
"no-void-expression": {
"options": "ignore-arrow-function-shorthand"
},
"prefer-object-spread": true,
"radix": true,
"static-this": true,
"strict-comparisons": [
true,
{
"allow-object-equal-comparison": true,
"allow-string-order-comparison": true
}
],
"triple-equals": {
"options": "allow-null-check"
},
"unnecessary-bind": true,
"use-isnan": true,
// Maintainability
// These rules make code maintenance easier
"deprecation": {
"severity": "warning"
},
"eofline": true,
"linebreak-style": {
"options": "LF"
},
"max-line-length": {
"options": {
"limit": 120,
"ignore-pattern": "^import |^export {(.*?)}"
}
},
"no-default-export": true,
"no-duplicate-imports": true,
"no-require-imports": true,
"prefer-const": true,
"prefer-readonly": true,
"trailing-comma": {
"options": {
"multiline": "always",
"singleline": "never",
"esSpecCompliant": true
}
},
// Style
// These rules enforce consistent style across your codebase
"array-type": {
"options": "array"
},
"arrow-return-shorthand": true,
"callable-types": true,
"class-name": true,
"comment-format": {
"options": "check-space"
},
"encoding": true,
"file-name-casing": [
true,
"kebab-case"
],
"import-spacing": true,
"interface-name": {
"options": "never-prefix"
},
"interface-over-type-literal": true,
"new-parens": true,
"no-boolean-literal-compare": true,
"no-consecutive-blank-lines": true,
"no-trailing-whitespace": true,
"no-unnecessary-callback-wrapper": true,
"no-unnecessary-initializer": true,
"no-unnecessary-qualifier": true,
"object-literal-key-quotes": {
"options": "as-needed"
},
"one-line": {
"options": [
"check-catch",
"check-else",
"check-finally",
"check-open-brace",
"check-whitespace"
]
},
"one-variable-per-declaration": {
"options": "ignore-for-loop"
},
"ordered-imports": true,
"prefer-method-signature": true,
"prefer-while": true,
"quotemark": {
"options": [
"single",
"jsx-single",
"avoid-template",
"avoid-escape"
]
},
"semicolon": {
"options": ["always", "ignore-bound-class-methods"]
},
"space-before-function-paren": {
"options": {
"anonymous": "always",
"asyncArrow": "always",
"constructor": "never",
"method": "never",
"named": "never"
}
},
"space-within-parens": {
"options": 0
},
"type-literal-delimiter": [
true,
{
"singleLine": "always"
}
],
"unnecessary-else": [
true,
{
"allow-else-if": true
}
],
"variable-name": {
"options": [
"ban-keywords",
"check-format",
"require-const-for-all-caps"
]
},
"whitespace": {
"options": [
"check-branch",
"check-decl",
"check-operator",
"check-postbrace",
"check-preblock",
"check-rest-spread",
"check-separator",
"check-type",
"check-type-operator"
]
},
// Custom rules
"object-curly-spacing": {
"options": "always"
},
"ter-indent": {
"options": [
4,
{
"SwitchCase": 1,
"MemberExpression": 1,
"FunctionDeclaration": {
"parameters": 1,
"body": 1
},
"FunctionExpression": {
"parameters": 1,
"body": 1
},
"CallExpression": {
"arguments": 1
}
}
]
}
}
}