Skip to content

Instantly share code, notes, and snippets.

@Psvensso
Created August 23, 2018 11:10
Show Gist options
  • Save Psvensso/64e112835911e30eccf3aa02744725b2 to your computer and use it in GitHub Desktop.
Save Psvensso/64e112835911e30eccf3aa02744725b2 to your computer and use it in GitHub Desktop.
Basic ts-lint (ts-lint recommended with small tweaks)
{
"defaultSeverity": "warning",
"extends": [],
"linterOptions": {
"exclude": [
"Scripts/typings/**/*.ts"
]
},
"rules": {
"ban-types": {
"options": [
[ "Boolean", "Avoid using the `Boolean` type. Did you mean `boolean`?" ],
[ "Number", "Avoid using the `Number` type. Did you mean `number`?" ],
[ "String", "Avoid using the `String` type. Did you mean `string`?" ],
[ "Symbol", "Avoid using the `Symbol` type. Did you mean `symbol`?" ]
]
},
"whitespace": {
"options": [
"check-branch",
"check-decl",
"check-operator",
"check-separator",
"check-type",
"check-typecast"
]
},
"prefer-object-spread": true,
"object-literal-sort-keys": false,
"trailing-comma": [ false ],
"member-access": [ false ],
"adjacent-overload-signatures": true,
"align": {
"options": [
"parameters",
"statements"
]
},
"array-type": false,
"arrow-parens": true,
"arrow-return-shorthand": true,
"callable-types": true,
"class-name": true,
"comment-format": {
"options": [ "check-space" ]
},
"curly": true,
"cyclomatic-complexity": false,
"eofline": true,
"forin": true,
"import-spacing": true,
"indent": {
"options": [ "spaces" ]
},
"interface-name": {
"options": [ "always-prefix" ]
},
"interface-over-type-literal": false,
"jsdoc-format": true,
"label-position": true,
// Should be enabled
"max-classes-per-file": false,
// Should be enabled
/*
"max-line-length": {
"options": [ 120 ]
}
*/
"member-ordering": {
"options": {
"order": "statics-first"
}
},
"new-parens": true,
"no-angle-bracket-type-assertion": true,
"no-any": false,
"no-arg": true,
"no-bitwise": true,
"no-conditional-assignment": true,
"no-consecutive-blank-lines": true,
"no-console": [ true, "log" ], //Were allowing warnings to find errors
"no-construct": true,
"no-debugger": true,
"no-duplicate-super": true,
"no-empty": true,
"no-empty-interface": true,
"no-eval": true,
"no-internal-module": true,
"no-invalid-this": false,
"no-misused-new": true,
"no-namespace": true,
"no-parameter-properties": false,
"no-reference": true,
"no-reference-import": true,
"no-shadowed-variable": true,
"no-string-literal": true,
"no-string-throw": true,
"no-switch-case-fall-through": false,
"no-trailing-whitespace": true,
"no-unnecessary-initializer": true,
"no-unsafe-finally": true,
"no-unused-expression": [ true, "allow-fast-null-checks" ],
// disable this rule as it is very heavy performance-wise and not that useful
"no-use-before-declare": false,
"no-var-keyword": true,
"no-var-requires": false,
"object-literal-key-quotes": {
"options": [ "consistent-as-needed" ]
},
"object-literal-shorthand": true,
"one-line": {
"options": [
"check-catch",
"check-else",
"check-finally"
]
},
"one-variable-per-declaration": {
"options": [ "ignore-for-loop" ]
},
"only-arrow-functions": {
"options": [
"allow-declarations",
"allow-named-functions"
]
},
/**
"ordered-imports": {
"options": {
"import-sources-order": "case-insensitive",
"module-source-path": "full",
"named-imports-order": "case-insensitive"
}
}
*/
"prefer-const": true,
"prefer-for-of": true,
"quotemark": {
"options": [
"double",
"avoid-escape"
]
},
"radix": true,
"semicolon": {
"options": [ "always" ]
},
"space-before-function-paren": {
"options": {
"anonymous": "never",
"asyncArrow": "always",
"constructor": "never",
"method": "never",
"named": "never"
}
},
"triple-equals": {
"options": [ "allow-null-check" ]
},
"typedef": false,
"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,
"use-isnan": true,
"variable-name": {
"options": [
"ban-keywords",
"check-format",
"allow-pascal-case"
]
}
},
"rulesDirectory": []
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment