Skip to content

Instantly share code, notes, and snippets.

@justerror
Created March 5, 2021 06:40
Show Gist options
  • Save justerror/f0ee3a9866c093f804ca9a813af52a05 to your computer and use it in GitHub Desktop.
Save justerror/f0ee3a9866c093f804ca9a813af52a05 to your computer and use it in GitHub Desktop.
Configuration file for TSLint with Angular
{
"extends": ["tslint-config-prettier"],
"rulesDirectory": ["codelyzer"],
"rules": {
"angular-whitespace": [
true,
"check-interpolation",
"check-pipe",
"check-semicolon"
],
"arrow-return-shorthand": true,
"await-promise": true,
"ban-comma-operator": true,
"ban-ts-ignore": {
"severity": "warning"
},
"callable-types": true,
"class-name": true,
"comment-format": [true, "check-space"],
"component-class-suffix": true,
"component-max-inline-declarations": true,
"component-selector": [true, "element", "page", "app", "kebab-case"],
"contextual-lifecycle": true,
"curly": true,
"deprecation": {
"severity": "warn"
},
"directive-class-suffix": true,
"directive-selector": [true, "attribute", "app", "camelCase"],
"file-name-casing": [true, "kebab-case"],
"forin": true,
"import-blacklist": [true, "rxjs/Rx"],
"interface-name": [true, "never-prefix"],
"interface-over-type-literal": true,
"jsdoc-format": true,
"label-position": true,
"max-classes-per-file": false,
"max-file-line-count": {
"options": [500],
"severity": "warning"
},
"member-access": [true, "no-public"],
"member-ordering": [
true,
{
"order": [
"public-static-field",
"protected-static-field",
"private-static-field",
"public-instance-field",
"protected-instance-field",
"private-instance-field",
"public-static-method",
"protected-static-method",
"private-static-method",
"constructor",
"public-instance-method",
"protected-instance-method",
"private-instance-method"
]
}
],
"no-arg": true,
"no-async-without-await": true,
"no-bitwise": true,
"no-conditional-assignment": true,
"no-conflicting-lifecycle": true,
"no-console": {
"options": ["info", "debug", "time", "timeEnd", "trace"],
"severity": "warning"
},
"no-construct": true,
"no-debugger": true,
"no-duplicate-super": true,
"no-duplicate-switch-case": true,
"no-duplicate-variable": [true, "check-parameters"],
"no-empty": false,
"no-empty-interface": true,
"no-eval": true,
"no-for-in-array": true,
"no-host-metadata-property": false,
"no-inferrable-types": [true, "ignore-params"],
"no-input-prefix": [true, "can", "is", "should"],
"no-input-rename": true,
"no-inputs-metadata-property": true,
"no-invalid-template-strings": true,
"no-misused-new": true,
"no-non-null-assertion": true,
"no-output-native": true,
"no-output-on-prefix": true,
"no-output-rename": true,
"no-outputs-metadata-property": true,
"no-parameter-reassignment": true,
"no-queries-metadata-property": true,
"no-redundant-jsdoc": true,
"no-reference": true,
"no-require-imports": true,
"no-return-await": true,
"no-shadowed-variable": true,
"no-sparse-arrays": true,
"no-string-literal": false,
"no-string-throw": true,
"no-switch-case-fall-through": true,
"no-tautology-expression": true,
"no-this-assignment": true,
"no-unnecessary-class": [
true,
"allow-constructor-only",
"allow-static-only",
"allow-empty-class"
],
"no-unnecessary-initializer": true,
"no-unsafe-finally": true,
"no-unused-expression": true,
"no-var-keyword": true,
"no-var-requires": true,
"object-literal-sort-keys": false,
"one-variable-per-declaration": [true, "ignore-for-loop"],
"only-arrow-functions": [
true,
"allow-declarations",
"allow-named-functions"
],
"prefer-const": true,
"prefer-for-of": true,
"prefer-object-spread": true,
"radix": true,
"relative-url-prefix": true,
"static-this": true,
"template-banana-in-box": true,
"template-conditional-complexity": [true, 4],
"template-no-any": true,
"template-no-autofocus": false,
"template-no-negated-async": true,
"triple-equals": [true, "allow-null-check"],
"typedef": [true, "call-signature"],
"unified-signatures": true,
"unnecessary-bind": true,
"use-component-view-encapsulation": true,
"use-isnan": true,
"use-lifecycle-interface": true,
"use-pipe-decorator": true,
"use-pipe-transform-interface": true,
"variable-name": [
true,
"check-format",
"allow-leading-underscore",
"require-const-for-all-caps",
"ban-keywords",
"allow-snake-case"
]
}
}
@justerror
Copy link
Author

⚠️ tslint has been deprecated in favor of eslint

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment