diff --git a/src/rules/noInferredEmptyObjectTypeRule.ts b/src/rules/noInferredEmptyObjectTypeRule.ts index d0b21dc98ce..3c6dbb4166d 100644 --- a/src/rules/noInferredEmptyObjectTypeRule.ts +++ b/src/rules/noInferredEmptyObjectTypeRule.ts @@ -30,8 +30,9 @@ export class Rule extends Lint.Rules.TypedRule { options: null, optionExamples: [true], rationale: Lint.Utils.dedent` - When function or constructor may be called with a type parameter but one isn't supplied or inferrable, - TypeScript defaults to \`{}\`. + Prior to TypeScript 3.4, generic type parameters for functions and constructors are inferred as + \`{}\` (the empty object type) by default when no type parameter is explicitly supplied or when + the compiler cannot infer a more specific type. This is often undesirable as the call is meant to be of a more specific type. `, type: "functionality", diff --git a/test/rules/no-inferred-empty-object-type/test.ts.lint b/test/rules/no-inferred-empty-object-type/test.ts.lint index 120b965fbda..7da81a88a97 100644 --- a/test/rules/no-inferred-empty-object-type/test.ts.lint +++ b/test/rules/no-inferred-empty-object-type/test.ts.lint @@ -1,3 +1,4 @@ +[typescript]: <=3.4.x let s: string; let n: number; let o: Object;