Skip to content

Commit 71b5dd2

Browse files
committed
Add direct test for export = assignment in TS
1 parent d160285 commit 71b5dd2

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const someObj = {
2+
FooBar: 12,
3+
};
4+
5+
export = someObj;

tests/src/rules/named.js

+17-2
Original file line numberDiff line numberDiff line change
@@ -388,16 +388,31 @@ context('TypeScript', function () {
388388
'import/resolver': { 'eslint-import-resolver-typescript': true },
389389
};
390390

391-
const valid = [];
391+
const valid = [
392+
test({
393+
code: `import { FooBar } from './typescript-export-assign-object'`,
394+
parser,
395+
settings,
396+
}),
397+
];
392398
const invalid = [
393399
test({
394400
code: `import {a} from './export-star-3/b';`,
395401
filename: testFilePath('./export-star-3/a.js'),
396402
parser,
397403
settings,
398404
}),
405+
test({
406+
code: `import { NotExported } from './typescript-export-assign-object'`,
407+
parser,
408+
settings,
409+
errors: [{
410+
message: `NotExported not found in './typescript-export-assign-object'`,
411+
type: 'Identifier',
412+
}],
413+
}),
399414
];
400-
415+
401416
[
402417
'typescript',
403418
'typescript-declare',

0 commit comments

Comments
 (0)