[ci] yarn format

This commit is contained in:
matthewp 2021-08-16 20:44:46 +00:00 committed by GitHub Actions
parent 78b5bde14c
commit 24a40bee63
6 changed files with 10 additions and 18 deletions

View file

@ -76,13 +76,13 @@ const path = Astro.site.pathname;
`Astro.resolve()` helps with creating URLs relative to the current Astro file, allowing you to reference files within your `src/` folder.
Astro *does not* resolve relative links within HTML, such as images:
Astro _does not_ resolve relative links within HTML, such as images:
```html
<img src="../images/penguin.png" />
```
The above will be sent to the browser as-is and the browser will resolve it relative to the current __page__. If you want it to be resolved relative to the .astro file you are working in, use `Astro.resolve`:
The above will be sent to the browser as-is and the browser will resolve it relative to the current **page**. If you want it to be resolved relative to the .astro file you are working in, use `Astro.resolve`:
```astro
<img src={Astro.resolve('../images/penguin.png')} />

View file

@ -59,8 +59,6 @@ function findHydrationAttributes(attrs: Record<string, string>): HydrationAttrib
return { method, value };
}
/** Retrieve attributes from TemplateNode */
async function getAttributes(nodeName: string, attrs: Attribute[], state: CodegenState, compileOptions: CompileOptions): Promise<Record<string, string>> {
let result: Record<string, string> = {};

View file

@ -22,13 +22,7 @@ export function isImportMetaDeclaration(declaration: VariableDeclarator, metaNam
return true;
}
const warnableRelativeValues = new Set([
'img+src',
'a+href',
'script+src',
'link+href',
'source+srcset'
]);
const warnableRelativeValues = new Set(['img+src', 'a+href', 'script+src', 'link+href', 'source+srcset']);
const matchesRelative = /^(?![A-Za-z][+-.0-9A-Za-z]*:|\/)/;

View file

@ -7,8 +7,8 @@ const GlobalBuild = suite('Astro.* built');
setup(GlobalBuild, './fixtures/astro-global', {
runtimeOptions: {
mode: 'production'
}
mode: 'production',
},
});
GlobalBuild('Astro.resolve in the build', async (context) => {