diff --git a/tests/src/rules/consistent-type-specifier-style.js b/tests/src/rules/consistent-type-specifier-style.js index dc3d656332..e924e6669c 100644 --- a/tests/src/rules/consistent-type-specifier-style.js +++ b/tests/src/rules/consistent-type-specifier-style.js @@ -82,6 +82,24 @@ const COMMON_TESTS = { type: 'ImportSpecifier', }], }, + { + code: "import Foo, { type Bar } from 'Foo';", + output: "import Foo, { } from 'Foo';\nimport type {Bar} from 'Foo';", + options: ['prefer-top-level'], + errors: [{ + message: 'Prefer using a top-level type-only import instead of inline type specifiers.', + type: 'ImportSpecifier', + }], + }, + { + code: "import Foo, { type Bar, Baz } from 'Foo';", + output: "import Foo, { Baz } from 'Foo';\nimport type {Bar} from 'Foo';", + options: ['prefer-top-level'], + errors: [{ + message: 'Prefer using a top-level type-only import instead of inline type specifiers.', + type: 'ImportSpecifier', + }], + }, // // prefer-inline @@ -216,6 +234,24 @@ const FLOW_ONLY = { }, ], }, + { + code: "import Foo, { typeof Bar } from 'Foo';", + output: "import Foo, { } from 'Foo';\nimport typeof {Bar} from 'Foo';", + options: ['prefer-top-level'], + errors: [{ + message: 'Prefer using a top-level typeof-only import instead of inline typeof specifiers.', + type: 'ImportSpecifier', + }], + }, + { + code: "import Foo, { typeof Bar, Baz } from 'Foo';", + output: "import Foo, { Baz } from 'Foo';\nimport typeof {Bar} from 'Foo';", + options: ['prefer-top-level'], + errors: [{ + message: 'Prefer using a top-level typeof-only import instead of inline typeof specifiers.', + type: 'ImportSpecifier', + }], + }, // // prefer-inline