## Triaged rules ### Bad rules - no-inferrable-types (who cares what tests do? and doesn't apply to .d.ts) - no-var-requires (only in tests, and approx 0% of people would do this anyway) - prefer-readonly (private variables not modified outside constructor must be marked `readonly`) - function-constructor (no `new Function`, only in tests, who cares) - label-position (labels only on `do/for/while/switch`, only in tests, who cares, TS will catch syntax errors) - no-arg (no `arguments.callee`, only in tests, who cares) - no-construct (no `new String` `new Number` `new Boolean`, only in tests, who cares) - no-debugger (I like `debugger`!) - no-duplicate-super (only in tests, sure it'll fail at runtime but it's useful for testing) - no-duplicate-var (only in tests, **only** needed if `var` is allowed in the first place, but even then, unlikely to catch an error and the construct might be intentional for testing) - no-dynamic-delete (no `delete x[expr]` , who cares) - no-eval (who cares) - no-misused-new (forbid construct sigs in interfaces, this seems actively wrong) - no-object-literal-type-assertion (forbid casting object literals, this makes it HARDER to test) - no-return-await (who cares) - no-string-throw (who cares) - no-sparse-arrays (who cares) - no-unbound-method (tests only, not tracked in type system, so doesn't matter) - no-unsafe-finally (no control flow in `finally`, who cares) - prefer-conditional-expression (tests only, makes some tests HARDER to write) - radix (must specify radix parmeter to parseInt -- who cares) - static-this (no `this` in `static`, only in tests, miiiight catch an extraneous `static` but probably not) - use-isnan (no `=== NaN`, who cares) - completed-docs (requires jsdoc for classes, functions, methods and properties). This is a terrible idea. - interface-over-type-literal (is this a good idea? I don't think so) - no-boolean-literal-compare (forbid `===true`/`===false`, who cares) - no-unnecessary-type-assertion (forbid `e as T` where `e: T`, this might be a useful test though) - object-literal-shorthand (forbid `{ x: x }`, require `{ x }`, but who cares) - prefer-object-spread (forbid `Object.assign`, require `{ ...x }`, but who cares) - prefer-switch (forbid `if (x === 1)`, require `switch (x) { case 1:`, but who cares) - prefer-while (forbid `for (; test ;)`, require `while (test)`, but who cares) - no-unnecessary-callback-wrapper (forbid `x => f(x)`, require `f`, but who cares) - prefer-template: (allow only a single string+, who cares) - arrow-return-shorthand: (forbid `() => { return x }`, require `() => x`, but who cares) - triple-equals (forbid `==` except for `!=null`, but who cares) ### Redundant rules - eofline - no-irregular-whitespace - comment-types (default config allows all comment types??!) - encoding (enforces utf-8 encoding) - import-spacing - jsdoc-format - new-parens - no-redundant-jsdoc (already ported to jsdoc/check-tag-names) ### Useful rules - adjacent-overload-signatures - ban-types: Object, Function, Boolean, Number, String, Symbol - no-internal-module (disallows `module` keyword) - no-for-in-array (no for-in of an array-typed expression, could be a mistaken test) - no-reference-import (forbid triple-slash reference && import in the same file) - one-variable-per-declaration - no-void-expression (requires expressions with type void only to appear in ExpressionStatements) #### meh - no-empty-interface (only useful for preventing nominal mistakes from newbies) - awaited-promise (forbid `await` of non-Promise, only in tests, probably doesn't catch THAT many mistakes) - ban-comma-operator (only in tests) - no-conditional-assignment (no `=` in `if`, only in tests, but might mean a test doesn't test the right thing (assignability vs comparability)) - no-duplicate-switch-case (only in tests, unlikely to catch a mistake) - no-invalid-template-string (no `${` in normal strings, might catch a mistake MAYBE) - no-unnecessary-class (no static-only or constructor-only classes, I guess this is OK) - no-var-keyword (this is a good default, I guess) - no-default-type-parameter (forbid passing exactly the default type for a defaulted type parameter, I guess this is good for consistency) - no-duplicate-imports (I guess this is good for consistency) - no-mergeable-namespace (good for consistency?) - prefer-const (I *guess*, this doesn't matter for tests, and can't be checked for .d.ts) - array-simple (require X\[\] exactly where X is simple, unsure about the benefit of this) - no-unnecessary-qualifier (forbid redundant namespace qualifiers, not sure this matters much) - interface-name: (forbid I- prefix for interfaces, this *really* is unimportant) - member-access: (forbid redundant `public`, this helps readability a *tiny* bit) ### Rules in tslint:all "adjacent-overload-signatures": true, "ban-types": { options: [ ["Object", "Avoid using the `Object` type. Did you mean `object`?"], [ "Function", "Avoid using the `Function` type. Prefer a specific function type, like `() => void`.", ], ["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`?"], ], }, "no-empty-interface": true, // Technically this is not the strictest setting, but don't want to conflict with "typedef" "no-inferrable-types": { options: ["ignore-params"] }, "no-internal-module": true, "no-var-requires": true, "prefer-readonly": true, // Functionality "await-promise": true, "ban-comma-operator": true, "function-constructor": true, "label-position": true, "no-arg": true, "no-conditional-assignment": true, "no-construct": true, "no-debugger": true, "no-duplicate-super": true, "no-duplicate-switch-case": true, "no-duplicate-variable": { options: ["check-parameters"] }, "no-dynamic-delete": true, "no-eval": true, "no-for-in-array": true, "no-invalid-template-strings": true, "no-misused-new": true, "no-object-literal-type-assertion": true, "no-return-await": true, "no-string-throw": true, "no-sparse-arrays": true, "no-unbound-method": true, "no-unnecessary-class": { options: ["allow-empty-class"] }, "no-unsafe-finally": true, "no-var-keyword": true, "prefer-conditional-expression": true, radix: true, "static-this": true, "use-default-type-parameter": true, "use-isnan": true, // Maintainability eofline: true, "no-duplicate-imports": true, "no-irregular-whitespace": true, "no-mergeable-namespace": true, "prefer-const": true, "array-type": { options: "array-simple" }, "comment-type": { options: ["singleline", "multiline", "doc", "directive"] }, "completed-docs": true, encoding: true, "import-spacing": true, "interface-over-type-literal": true, "jsdoc-format": { options: "check-multiline-start" }, "new-parens": true, "no-boolean-literal-compare": true, "no-redundant-jsdoc": true, "no-reference-import": true, "no-unnecessary-qualifier": true, "no-unnecessary-type-assertion": true, "object-literal-shorthand": true, "prefer-object-spread": true, "prefer-switch": true, "prefer-while": true, ### Rules in dtslint.json // Custom rules "expect": true, "unified-signatures": true, // TODO: This is NOT a custom rule (but is explicitly turned on) "void-return": true, "npm-naming": true, "interface-name": [true, "never-prefix"], "member-access": [true, "no-public"], "no-unnecessary-callback-wrapper": true, "no-namespace": [true, "allow-declarations"], "one-variable-per-declaration": [true, "ignore-for-loop"], "prefer-template": [true, "allow-single-concat"], "arrow-return-shorthand": true, // TODO: "multiline" "no-void-expression": [true, "ignore-arrow-function-shorthand"], "triple-equals": [true, "allow-null-check"], ### Rules in dt.json npm-naming: [true, { "mode": "code" }] ### Exemptions [ [ 'no-var-keyword: false', 918 ], [ 'prefer-const: false', 773 ], [ 'ban-types: false', 641 ], [ 'unified-signatures: false', 610 ], [ 'only-arrow-functions: false', 579 ], [ 'array-type: false', 357 ], [ 'interface-name: false', 306 ], [ 'jsdoc-format: false', 296 ], [ 'no-redundant-jsdoc-2: false', 251 ], [ 'object-literal-shorthand: false', 249 ], [ 'no-empty-interface: false', 249 ], [ 'no-unnecessary-qualifier: false', 178 ], [ 'prefer-template: false', 163 ], [ 'no-unnecessary-class: false', 128 ], [ 'no-duplicate-variable: false', 121 ], [ 'triple-equals: false', 104 ], [ 'one-variable-per-declaration: false', 91 ], [ 'interface-over-type-literal: false', 86 ], [ 'no-internal-module: false', 82 ], [ 'no-reference-import: false', 82 ], [ 'member-access: false', 79 ], [ 'no-void-expression: false', 68 ], [ 'adjacent-overload-signatures: false', 68 ], [ 'no-misused-new: false', 59 ], [ 'no-object-literal-type-assertion: false', 59 ], [ 'no-mergeable-namespace: false', 55 ], [ 'no-duplicate-imports: false', 46 ], [ 'no-inferrable-types: false', 46 ], [ 'void-return: false', 45 ], [ 'no-namespace: false', 44 ], [ 'no-const-enum: false', 43 ], [ 'prefer-for-of: false', 41 ], [ 'no-unnecessary-type-assertion: false', 35 ], [ 'arrow-return-shorthand: false', 31 ], [ 'no-boolean-literal-compare: false', 28 ], [ 'no-var-requires: false', 26 ], [ 'new-parens: false', 25 ], [ 'no-irregular-whitespace: false', 18 ], [ 'no-outside-dependencies: false', 16 ], [ 'use-default-type-parameter: false', 16 ], [ 'no-redundant-undefined: false', 14 ], [ 'no-string-throw: false', 12 ], [ 'no-conditional-assignment: false', 12 ], [ 'file-name-casing: [true,"kebab-case"]', 9 ], [ 'radix: false', 9 ], [ 'no-unnecessary-callback-wrapper: false', 9 ], [ 'prefer-conditional-expression: false', 9 ], [ 'no-any: true', 8 ], [ 'await-promise: false', 8 ], [ 'prefer-object-spread: false', 5 ], [ 'no-for-in-array: false', 5 ], [ 'no-construct: false', 5 ], [ 'import-spacing: false', 4 ], [ 'no-redundant-jsdoc: false', 4 ], [ 'prefer-switch: false', 4 ], [ 'class-name: true', 3 ], [ 'eofline: false', 3 ], [ 'no-return-await: false', 3 ], [ 'no-invalid-template-strings: false', 2 ], [ 'callable-types: true', 2 ], [ 'no-unnecessary-initializer: false', 2 ], [ 'strict-type-predicates: true', 2 ], [ 'no-eval: false', 2 ], [ 'await-promise: [true,"PromiseLike"]', 1 ], [ 'prefer-method-signature: true', 1 ], [ 'no-redundant-jsdoc: true', 1 ], [ 'ban-types: true', 1 ], [ 'prefer-method-signature: false', 1 ], [ 'callable-types: false', 1 ], [ 'invalid-void: false', 1 ], [ 'await-promise: [true,"CancellablePromise"]', 1 ], [ 'array-type: [true,"array"]', 1 ], [ 'typedef: [true,"call-signature","arrow-call-signature","parameter","arrow-parameter","property-declaration","member-variable-declaration","object-destructuring","array-destructuring"]', 1 ], [ 'no-duplicate-imports: [true,{"allow-namespace-imports":true}]', 1 ], [ 'variable-name: [true,"check-format"]', 1 ], [ 'max-line-length: [false]', 1 ], [ 'array-type: [false]', 1 ], [ 'export-just-namespace: false', 1 ], [ 'prefer-declare-function: false', 1 ], [ 'no-unnecessary-generics: false', 1 ], [ 'file-name-casing: false', 1 ], [ 'no-unbound-method: true', 1 ], [ 'restrict-plus-operands: true', 1 ], [ 'no-inferred-empty-object-type: true', 1 ], [ 'no-floating-promises: true', 1 ], [ 'prefer-function-over-method: true', 1 ], [ 'no-angle-bracket-type-assertion: true', 1 ], [ 'deprecation: true', 1 ] ]