Skip to content

Commit

Permalink
fix(un-ts#123): update export map building
Browse files Browse the repository at this point in the history
  • Loading branch information
SukkaW committed Aug 29, 2024
1 parent 452cb13 commit deeee78
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/rules/no-named-as-default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ export = createRule<[], MessageId>({
}

if (exportMapOfImported.exports.has('default') && exportMapOfImported.exports.has(nameValue)) {

Check failure on line 51 in src/rules/no-named-as-default.ts

View workflow job for this annotation

GitHub Actions / Lint and Test with Node.js 20 and ESLint 8 on macos-latest

Replace `exportMapOfImported.exports.has('default')·&&·exportMapOfImported.exports.has(nameValue)` with `⏎··········exportMapOfImported.exports.has('default')·&&⏎··········exportMapOfImported.exports.has(nameValue)⏎········`

Check failure on line 51 in src/rules/no-named-as-default.ts

View workflow job for this annotation

GitHub Actions / Lint and Test with Node.js 20 and ESLint 9 on macos-latest

Replace `exportMapOfImported.exports.has('default')·&&·exportMapOfImported.exports.has(nameValue)` with `⏎··········exportMapOfImported.exports.has('default')·&&⏎··········exportMapOfImported.exports.has(nameValue)⏎········`

Check failure on line 51 in src/rules/no-named-as-default.ts

View workflow job for this annotation

GitHub Actions / Lint and Test with Node.js 20 and ESLint 8 on ubuntu-latest

Replace `exportMapOfImported.exports.has('default')·&&·exportMapOfImported.exports.has(nameValue)` with `⏎··········exportMapOfImported.exports.has('default')·&&⏎··········exportMapOfImported.exports.has(nameValue)⏎········`
console.log(nameValue, exportMapOfImported)
context.report({
node: defaultSpecifier,
messageId: 'default',
Expand Down
4 changes: 2 additions & 2 deletions src/utils/export-map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ export class ExportMap {
return
}
case 'ExportAllDeclaration': {
m.exports.set(s.exported!.name, n)
m.exports.set(getValue(s.exported!), n)
m.namespace.set(
getValue(s.exported!),
addNamespace(exportMeta, s.exported!),
Expand All @@ -293,7 +293,7 @@ export class ExportMap {
}
case 'ExportSpecifier': {
if (!('source' in n && n.source)) {
m.exports.set(s.exported!.name, n)
m.exports.set(getValue(s.exported!), n)
m.namespace.set(
getValue(s.exported),
addNamespace(exportMeta, s.local),
Expand Down

0 comments on commit deeee78

Please sign in to comment.