@@ -151,6 +151,17 @@ ruleTester.run("no-unpublished-import", rule, {
151
151
filename : fixture ( "private-package/index.js" ) ,
152
152
code : "import bbb from 'bbb';" ,
153
153
} ,
154
+
155
+ // https://github.com/eslint-community/eslint-plugin-n/issues/78
156
+ {
157
+ filename : fixture ( "1/test.ts" ) ,
158
+ parser : path . join (
159
+ __dirname ,
160
+ "../../../node_modules/@typescript-eslint/parser"
161
+ ) ,
162
+ code : "import type foo from 'foo';" ,
163
+ options : [ { ignoreTypeImport : true } ] ,
164
+ } ,
154
165
] ,
155
166
invalid : [
156
167
{
@@ -272,5 +283,27 @@ ruleTester.run("no-unpublished-import", rule, {
272
283
} ,
273
284
]
274
285
: [ ] ) ,
286
+
287
+ // https://github.com/eslint-community/eslint-plugin-n/issues/78
288
+ {
289
+ filename : fixture ( "1/test.ts" ) ,
290
+ parser : path . join (
291
+ __dirname ,
292
+ "../../../node_modules/@typescript-eslint/parser"
293
+ ) ,
294
+ code : "import type foo from 'foo';" ,
295
+ options : [ { ignoreTypeImport : false } ] ,
296
+ errors : [ { messageId : "notPublished" } ] ,
297
+ } ,
298
+
299
+ {
300
+ filename : fixture ( "1/test.ts" ) ,
301
+ parser : path . join (
302
+ __dirname ,
303
+ "../../../node_modules/@typescript-eslint/parser"
304
+ ) ,
305
+ code : "import type foo from 'foo';" ,
306
+ errors : [ { messageId : "notPublished" } ] ,
307
+ } ,
275
308
] ,
276
309
} )
0 commit comments