[ci] format

This commit is contained in:
natemoo-re 2022-08-12 22:03:24 +00:00 committed by fredkbot
parent 24d2f7a6e6
commit 437bf73f26
3 changed files with 11 additions and 7 deletions

View file

@ -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) {

View file

@ -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;

View file

@ -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');
});
});
});