[ci] format
This commit is contained in:
parent
24d2f7a6e6
commit
437bf73f26
3 changed files with 11 additions and 7 deletions
|
@ -180,7 +180,11 @@ export default function astroJSX(): PluginObj {
|
||||||
JSXMemberExpression(path, state) {
|
JSXMemberExpression(path, state) {
|
||||||
const node = path.node;
|
const node = path.node;
|
||||||
// Skip automatic `_components` in MDX files
|
// 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;
|
return;
|
||||||
}
|
}
|
||||||
const parent = path.findParent((n) => t.isJSXElement(n))!;
|
const parent = path.findParent((n) => t.isJSXElement(n))!;
|
||||||
|
|
|
@ -71,7 +71,7 @@ declare const Astro: {
|
||||||
} else {
|
} else {
|
||||||
this.Component = componentModule;
|
this.Component = componentModule;
|
||||||
for (const part of componentExport.split('.')) {
|
for (const part of componentExport.split('.')) {
|
||||||
this.Component = this.Component[part]
|
this.Component = this.Component[part];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.hydrator = hydrator;
|
this.hydrator = hydrator;
|
||||||
|
|
|
@ -24,7 +24,7 @@ describe('MDX Namespace', () => {
|
||||||
const component = document.querySelector('#component');
|
const component = document.querySelector('#component');
|
||||||
|
|
||||||
expect(island).not.undefined;
|
expect(island).not.undefined;
|
||||||
expect(component.textContent).equal('Hello world')
|
expect(component.textContent).equal('Hello world');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('works for star', async () => {
|
it('works for star', async () => {
|
||||||
|
@ -35,7 +35,7 @@ describe('MDX Namespace', () => {
|
||||||
const component = document.querySelector('#component');
|
const component = document.querySelector('#component');
|
||||||
|
|
||||||
expect(island).not.undefined;
|
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');
|
const component = document.querySelector('#component');
|
||||||
|
|
||||||
expect(island).not.undefined;
|
expect(island).not.undefined;
|
||||||
expect(component.textContent).equal('Hello world')
|
expect(component.textContent).equal('Hello world');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('works for star', async () => {
|
it('works for star', async () => {
|
||||||
|
@ -77,7 +77,7 @@ describe('MDX Namespace', () => {
|
||||||
const component = document.querySelector('#component');
|
const component = document.querySelector('#component');
|
||||||
|
|
||||||
expect(island).not.undefined;
|
expect(island).not.undefined;
|
||||||
expect(component.textContent).equal('Hello world')
|
expect(component.textContent).equal('Hello world');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue