Skip to content

Commit

Permalink
test(eslint-plugin): [ban-types] add test on generics
Browse files Browse the repository at this point in the history
  • Loading branch information
golopot committed Jun 28, 2019
1 parent b8dea97 commit ba67ea1
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions packages/eslint-plugin/tests/rules/ban-types.test.ts
Expand Up @@ -264,5 +264,36 @@ class Foo<F = string> extends Bar<string> implements Baz<Object> {
],
options,
},
{
code: `
let a: NS.Bad<Foo>;
let b: Foo<NS.Bad>;
`,
output: `
let a: NS.Good<Foo>;
let b: Foo<NS.Good>;
`,
errors: [
{
messageId: 'bannedTypeMessage',
data: {
name: 'NS.Bad',
customMessage: ' Use NS.Good instead.',
},
line: 2,
column: 8,
},
{
messageId: 'bannedTypeMessage',
data: {
name: 'NS.Bad',
customMessage: ' Use NS.Good instead.',
},
line: 3,
column: 12,
},
],
options,
},
],
});

0 comments on commit ba67ea1

Please sign in to comment.