diff options
author | 2022-08-12 22:03:24 +0000 | |
---|---|---|
committer | 2022-08-12 22:03:24 +0000 | |
commit | 437bf73f264b2811b7ee8f11c2b54d3414144a0f (patch) | |
tree | d59a875fdeab2cd5583b9c451bfa80bf4c06f87d | |
parent | 24d2f7a6e6700c10c863f826f37bb653d70e3a83 (diff) | |
download | astro-437bf73f264b2811b7ee8f11c2b54d3414144a0f.tar.gz astro-437bf73f264b2811b7ee8f11c2b54d3414144a0f.tar.zst astro-437bf73f264b2811b7ee8f11c2b54d3414144a0f.zip |
[ci] format
-rw-r--r-- | packages/astro/src/jsx/babel.ts | 8 | ||||
-rw-r--r-- | packages/astro/src/runtime/server/astro-island.ts | 2 | ||||
-rw-r--r-- | packages/integrations/mdx/test/mdx-namespace.test.js | 8 |
3 files changed, 11 insertions, 7 deletions
diff --git a/packages/astro/src/jsx/babel.ts b/packages/astro/src/jsx/babel.ts index a9f91f973..925e26380 100644 --- a/packages/astro/src/jsx/babel.ts +++ b/packages/astro/src/jsx/babel.ts @@ -180,7 +180,11 @@ export default function astroJSX(): PluginObj { JSXMemberExpression(path, state) { const node = path.node; // Skip automatic `_components` in MDX files - if (state.filename?.endsWith('.mdx') && t.isJSXIdentifier(node.object) && node.object.name === '_components') { + if ( + state.filename?.endsWith('.mdx') && + t.isJSXIdentifier(node.object) && + node.object.name === '_components' + ) { return; } const parent = path.findParent((n) => t.isJSXElement(n))!; @@ -190,7 +194,7 @@ export default function astroJSX(): PluginObj { if (!hasClientDirective(parentNode)) return; const isClientOnly = isClientOnlyComponent(parentNode); if (tagName === ClientOnlyPlaceholder) return; - + const imports = state.get('imports') ?? new Map(); const namespace = tagName.split('.'); for (const [source, specs] of imports) { diff --git a/packages/astro/src/runtime/server/astro-island.ts b/packages/astro/src/runtime/server/astro-island.ts index dd25c0593..96b1b8b6e 100644 --- a/packages/astro/src/runtime/server/astro-island.ts +++ b/packages/astro/src/runtime/server/astro-island.ts @@ -71,7 +71,7 @@ declare const Astro: { } else { this.Component = componentModule; for (const part of componentExport.split('.')) { - this.Component = this.Component[part] + this.Component = this.Component[part]; } } this.hydrator = hydrator; diff --git a/packages/integrations/mdx/test/mdx-namespace.test.js b/packages/integrations/mdx/test/mdx-namespace.test.js index ad9587640..486910ca2 100644 --- a/packages/integrations/mdx/test/mdx-namespace.test.js +++ b/packages/integrations/mdx/test/mdx-namespace.test.js @@ -24,7 +24,7 @@ describe('MDX Namespace', () => { const component = document.querySelector('#component'); expect(island).not.undefined; - expect(component.textContent).equal('Hello world') + expect(component.textContent).equal('Hello world'); }); it('works for star', async () => { @@ -35,7 +35,7 @@ describe('MDX Namespace', () => { const component = document.querySelector('#component'); expect(island).not.undefined; - expect(component.textContent).equal('Hello world') + expect(component.textContent).equal('Hello world'); }); }); @@ -62,7 +62,7 @@ describe('MDX Namespace', () => { const component = document.querySelector('#component'); expect(island).not.undefined; - expect(component.textContent).equal('Hello world') + expect(component.textContent).equal('Hello world'); }); it('works for star', async () => { @@ -77,7 +77,7 @@ describe('MDX Namespace', () => { const component = document.querySelector('#component'); expect(island).not.undefined; - expect(component.textContent).equal('Hello world') + expect(component.textContent).equal('Hello world'); }); }); }); |