Skip to content

Commit

Permalink
[ci] format
Browse files Browse the repository at this point in the history
  • Loading branch information
natemoo-re authored and astrobot-houston committed Aug 12, 2022
1 parent 24d2f7a commit 437bf73
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
8 changes: 6 additions & 2 deletions packages/astro/src/jsx/babel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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))!;
Expand All @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/src/runtime/server/astro-island.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions packages/integrations/mdx/test/mdx-namespace.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand All @@ -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');
});
});

Expand All @@ -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 () => {
Expand All @@ -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');
});
});
});

0 comments on commit 437bf73

Please sign in to comment.