1
1
import { test , SYNTAX_CASES , getTSParsers , testFilePath , testVersion , parsers } from '../utils' ;
2
2
import { RuleTester } from 'eslint' ;
3
+ import path from 'path' ;
3
4
4
5
import { CASE_SENSITIVE_FS } from 'eslint-module-utils/resolve' ;
5
6
@@ -388,7 +389,16 @@ context('TypeScript', function () {
388
389
'import/resolver' : { 'eslint-import-resolver-typescript' : true } ,
389
390
} ;
390
391
391
- let valid = [ ] ;
392
+ let valid = [
393
+ test ( {
394
+ code : `import x from './typescript-export-assign-object'` ,
395
+ parser,
396
+ parserOptions : {
397
+ tsconfigRootDir : path . resolve ( __dirname , '../../files/typescript-export-assign-object/' ) ,
398
+ } ,
399
+ settings,
400
+ } ) ,
401
+ ] ;
392
402
const invalid = [
393
403
// TODO: uncomment this test
394
404
// test({
@@ -400,6 +410,31 @@ context('TypeScript', function () {
400
410
// { message: 'a not found in ./export-star-3/b' },
401
411
// ],
402
412
// }),
413
+ test ( {
414
+ code : `import { NotExported } from './typescript-export-assign-object'` ,
415
+ parser,
416
+ parserOptions : {
417
+ tsconfigRootDir : path . resolve ( __dirname , '../../files/typescript-export-assign-object/' ) ,
418
+ } ,
419
+ settings,
420
+ errors : [ {
421
+ message : `NotExported not found in './typescript-export-assign-object'` ,
422
+ type : 'Identifier' ,
423
+ } ] ,
424
+ } ) ,
425
+ test ( {
426
+ // `export =` syntax creates a default export only
427
+ code : `import { FooBar } from './typescript-export-assign-object'` ,
428
+ parser,
429
+ parserOptions : {
430
+ tsconfigRootDir : path . resolve ( __dirname , '../../files/typescript-export-assign-object/' ) ,
431
+ } ,
432
+ settings,
433
+ errors : [ {
434
+ message : `FooBar not found in './typescript-export-assign-object'` ,
435
+ type : 'Identifier' ,
436
+ } ] ,
437
+ } ) ,
403
438
] ;
404
439
405
440
[
0 commit comments