diff --git a/tests/files/typescript-export-assign-object.ts b/tests/files/typescript-export-assign-object.ts new file mode 100644 index 0000000000..8899e3fbad --- /dev/null +++ b/tests/files/typescript-export-assign-object.ts @@ -0,0 +1,5 @@ +const someObj = { + FooBar: 12, +}; + +export = someObj; diff --git a/tests/src/rules/named.js b/tests/src/rules/named.js index 0361983979..4194ce266c 100644 --- a/tests/src/rules/named.js +++ b/tests/src/rules/named.js @@ -388,7 +388,13 @@ context('TypeScript', function () { 'import/resolver': { 'eslint-import-resolver-typescript': true }, }; - let valid = []; + let valid = [ + test({ + code: `import { FooBar } from './typescript-export-assign-object'`, + parser, + settings, + }), + ]; const invalid = [ // TODO: uncomment this test // test({ @@ -400,8 +406,17 @@ context('TypeScript', function () { // { message: 'a not found in ./export-star-3/b' }, // ], // }), + test({ + code: `import { NotExported } from './typescript-export-assign-object'`, + parser, + settings, + errors: [{ + message: `NotExported not found in './typescript-export-assign-object'`, + type: 'Identifier', + }], + }), ]; - + [ 'typescript', 'typescript-declare',