Skip to content

Commit 854b25e

Browse files
ematipicoastrobot-houston
authored andcommitted
[ci] format
1 parent bb55874 commit 854b25e

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed

packages/astro/src/core/config/schema.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export const ASTRO_CONFIG_DEFAULTS = {
102102
serializeConfig: false,
103103
session: false,
104104
headingIdCompat: false,
105-
preserveScriptOrder: false
105+
preserveScriptOrder: false,
106106
},
107107
} satisfies AstroUserConfig & { server: { open: boolean } };
108108

@@ -622,7 +622,10 @@ export const AstroConfigSchema = z.object({
622622
.boolean()
623623
.optional()
624624
.default(ASTRO_CONFIG_DEFAULTS.experimental.headingIdCompat),
625-
preserveScriptOrder: z.boolean().optional().default(ASTRO_CONFIG_DEFAULTS.experimental.preserveScriptOrder),
625+
preserveScriptOrder: z
626+
.boolean()
627+
.optional()
628+
.default(ASTRO_CONFIG_DEFAULTS.experimental.preserveScriptOrder),
626629
})
627630
.strict(
628631
`Invalid or outdated experimental feature.\nCheck for incorrect spelling or outdated Astro version.\nSee https://docs.astro.build/en/reference/experimental-flags/ for a list of all current experiments.`,

packages/astro/src/types/public/config.ts

+9-9
Original file line numberDiff line numberDiff line change
@@ -2176,13 +2176,13 @@ export interface ViteUserConfig extends OriginalViteUserConfig {
21762176
* @default `false`
21772177
* @version 5.5
21782178
* @description
2179-
*
2179+
*
21802180
* When enabled, `<script>` and `<style>` tags are rendered in the same order as they are defined.
2181-
*
2181+
*
21822182
* ## Example
2183-
*
2183+
*
21842184
* Consider the following component:
2185-
*
2185+
*
21862186
* ```html
21872187
* <p>I am a component</p>
21882188
* <style>
@@ -2196,19 +2196,19 @@ export interface ViteUserConfig extends OriginalViteUserConfig {
21962196
* }
21972197
* </style>
21982198
* ```
2199-
*
2199+
*
22002200
* By default, it will generate a CSS style where `red` will be applied:
2201-
*
2201+
*
22022202
* ```css
22032203
* body {background:#ff0} body {background:red}
22042204
* ```
2205-
*
2205+
*
22062206
* When this new option is set to `true`, the generated CSS style will apply `yellow`:
2207-
*
2207+
*
22082208
* ```css
22092209
* body {background:red} body {background:#ff0}
22102210
* ```
2211-
*
2211+
*
22122212
*/
22132213
preserveScriptOrder: boolean;
22142214
};

packages/astro/test/css-order.test.js

+4-7
Original file line numberDiff line numberDiff line change
@@ -111,26 +111,23 @@ describe('CSS production ordering', () => {
111111
}
112112
});
113113
});
114-
115-
116-
describe("Changes order when transparentScriptOrder is enabled", () => {
114+
115+
describe('Changes order when transparentScriptOrder is enabled', () => {
117116
/** @type {import('./test-utils').Fixture} */
118117
let fixture;
119-
118+
120119
before(async () => {
121120
fixture = await loadFixture({
122121
root: './fixtures/css-order-transparent/',
123122
});
124123
await fixture.build();
125124
});
126125

127-
128126
it('should compile styles in the same order as they are found', async () => {
129127
const html = await fixture.readFile('/index.html');
130128

131129
// The component declares red background first, then yellow
132130
assert.match(html, /body\{background:red\}body\{background:#ff0/);
133131
});
134-
135-
})
132+
});
136133
});

0 commit comments

Comments
 (0)