Skip to content

Instantly share code, notes, and snippets.

@isaaclyman
Last active August 31, 2017 18:36
Show Gist options
  • Save isaaclyman/43dfca81a2251333a1a49d31490e0071 to your computer and use it in GitHub Desktop.
Save isaaclyman/43dfca81a2251333a1a49d31490e0071 to your computer and use it in GitHub Desktop.
My preferred TypeScript/TSLint settings
{
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"alwaysStrict": true,
"lib": ["es6", "dom"],
"module": "es2015",
"moduleResolution": "node",
"noImplicitAny": true,
"noImplicitReturns": true,
"sourceMap": true,
"strict": true,
"target": "es5",
"baseUrl": "./src",
"paths": {
"@/*": ["src/*"]
}
},
"include": [
"./src/**/*"
]
}
{
"rules": {
"arrow-parens": true,
"ban": [true,
{
"name": "parseInt",
"message": "Use the \"Number()\" constructor instead. If a Number type is not necessary, use \"*.toString()\"."
},
{
"name": [
"*",
"success"
],
"message": "The \"Promise.success()\" method is dead. Use \"Promise.then()\"."
},
{
"name": [
"*",
"error"
],
"message": "The \"Promise.error()\" method is dead. Use \"Promise.catch()\"."
}
],
"curly": true,
"cyclomatic-complexity": [
true,
25
],
"indent": [
true,
"spaces",
2
],
"member-access": [
true,
"check-accessor",
"check-constructor"
],
"no-conditional-assignment": true,
"no-empty": true,
"no-invalid-template-strings": true,
"no-irregular-whitespace": true,
"no-magic-numbers": true,
"no-misused-new": true,
"no-reference": true,
"no-string-literal": true,
"no-trailing-whitespace": true,
"no-unused-expression": [
true,
"allow-new"
],
"no-unused-variable": [
true,
{
"ignore-pattern": "^_"
}
],
"no-var-keyword": true,
"number-literal-format": true,
"object-literal-sort-keys": true,
"prefer-const": true,
"prefer-for-of": true,
"quotemark": [
true,
"single"
],
"semicolon": [
true,
"never"
],
"strict-type-predicates": true,
"triple-equals": true,
"typeof-compare": true,
"use-isnan": true
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment