diff options
Diffstat (limited to 'packages')
| -rw-r--r-- | packages/astro/src/compiler/codegen/index.ts | 2 | ||||
| -rw-r--r-- | packages/astro/src/compiler/codegen/interfaces.ts | 2 | ||||
| -rw-r--r-- | packages/astro/src/compiler/codegen/utils.ts | 12 | ||||
| -rw-r--r-- | packages/astro/test/astro-global-build.test.js | 6 | ||||
| -rw-r--r-- | packages/astro/test/astro-global.test.js | 2 |
5 files changed, 8 insertions, 16 deletions
diff --git a/packages/astro/src/compiler/codegen/index.ts b/packages/astro/src/compiler/codegen/index.ts index 2557f8b54..bcdd4ef9d 100644 --- a/packages/astro/src/compiler/codegen/index.ts +++ b/packages/astro/src/compiler/codegen/index.ts @@ -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> = {}; diff --git a/packages/astro/src/compiler/codegen/interfaces.ts b/packages/astro/src/compiler/codegen/interfaces.ts index a487b85e9..04667557d 100644 --- a/packages/astro/src/compiler/codegen/interfaces.ts +++ b/packages/astro/src/compiler/codegen/interfaces.ts @@ -7,4 +7,4 @@ export interface Attribute { name: string; value: TemplateNode[] | boolean; expression?: Expression; -}
\ No newline at end of file +} diff --git a/packages/astro/src/compiler/codegen/utils.ts b/packages/astro/src/compiler/codegen/utils.ts index a4e66fbe8..9f7c8672e 100644 --- a/packages/astro/src/compiler/codegen/utils.ts +++ b/packages/astro/src/compiler/codegen/utils.ts @@ -22,20 +22,14 @@ 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]*:|\/)/; export function warnIfRelativeStringLiteral(logging: LogOptions, nodeName: string, attr: Attribute, value: string) { let key = nodeName + '+' + attr.name; - if(warnableRelativeValues.has(key) && matchesRelative.test(value)) { + if (warnableRelativeValues.has(key) && matchesRelative.test(value)) { let message = `This value will be resolved relative to the page: <${nodeName} ${attr.name}="${value}">`; warn(logging, 'relative-link', message); } -}
\ No newline at end of file +} diff --git a/packages/astro/test/astro-global-build.test.js b/packages/astro/test/astro-global-build.test.js index 6acdfd428..88b59dbaf 100644 --- a/packages/astro/test/astro-global-build.test.js +++ b/packages/astro/test/astro-global-build.test.js @@ -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) => { @@ -20,4 +20,4 @@ GlobalBuild('Astro.resolve in the build', async (context) => { assert.equal($('img').attr('src'), '/blog/_astro/src/images/penguin.png'); }); -GlobalBuild.run();
\ No newline at end of file +GlobalBuild.run(); diff --git a/packages/astro/test/astro-global.test.js b/packages/astro/test/astro-global.test.js index 9a80973ae..5dbac151b 100644 --- a/packages/astro/test/astro-global.test.js +++ b/packages/astro/test/astro-global.test.js @@ -50,4 +50,4 @@ Global('Astro.resolve in development', async (context) => { assert.equal($('img').attr('src'), '/_astro/src/images/penguin.png'); }); -Global.run();
\ No newline at end of file +Global.run(); |
