mirror of
https://github.com/zulip/zulip.git
synced 2026-07-21 21:05:48 +08:00
editorconfig: Widen *.astro files to 100 characters.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
parent
c302872bd5
commit
873c8b3e86
@ -12,7 +12,7 @@ trim_trailing_whitespace = true
|
||||
binary_next_line = true
|
||||
switch_case_indent = true
|
||||
|
||||
[*.{cjs,cts,js,json,mjs,mts,ts}]
|
||||
[*.{astro,cjs,cts,js,json,mjs,mts,ts}]
|
||||
max_line_length = 100
|
||||
|
||||
[*.{py,pyi}]
|
||||
|
||||
@ -16,10 +16,7 @@ const tree_with_removed_newlines = {
|
||||
}),
|
||||
};
|
||||
const first_element = tree_with_removed_newlines.children[0];
|
||||
assert.ok(
|
||||
first_element?.type === "element" &&
|
||||
["ol", "ul"].includes(first_element.tagName),
|
||||
);
|
||||
assert.ok(first_element?.type === "element" && ["ol", "ul"].includes(first_element.tagName));
|
||||
const flattened = {
|
||||
...first_element,
|
||||
children: tree_with_removed_newlines.children.flatMap((other) => {
|
||||
|
||||
@ -10,8 +10,7 @@ import keyboard_svg from "../../../web/icons/keyboard.svg?raw";
|
||||
const keyboard_icon_fragment = fromHtml(keyboard_svg, {fragment: true});
|
||||
const keyboard_icon_first_child = keyboard_icon_fragment.children[0]!;
|
||||
assert.ok(
|
||||
keyboard_icon_first_child.type === "element" &&
|
||||
keyboard_icon_first_child.tagName === "svg",
|
||||
keyboard_icon_first_child.type === "element" && keyboard_icon_first_child.tagName === "svg",
|
||||
);
|
||||
keyboard_icon_first_child.properties.class = "zulip-unplugin-icon";
|
||||
|
||||
@ -37,10 +36,7 @@ first_element.children = [...prefix_element_list, ...first_element.children];
|
||||
tree.children[0] = first_element;
|
||||
---
|
||||
|
||||
<aside
|
||||
aria-label="Keyboard tip"
|
||||
class=`starlight-aside starlight-aside--tip keyboard-tip`
|
||||
>
|
||||
<aside aria-label="Keyboard tip" class=`starlight-aside starlight-aside--tip keyboard-tip`>
|
||||
<div class="starlight-aside__content">
|
||||
<Fragment set:html={toHtml(tree)} />
|
||||
</div>
|
||||
|
||||
@ -341,19 +341,14 @@ const getSettingsMarkdown = (
|
||||
`;
|
||||
|
||||
const getSettingsHTML = (setting_key: string): string => {
|
||||
const {setting_type, setting_name, setting_link} =
|
||||
setting_link_mapping[setting_key]!;
|
||||
const {setting_type, setting_name, setting_link} = setting_link_mapping[setting_key]!;
|
||||
|
||||
if (!SHOW_RELATIVE_LINKS) {
|
||||
const setting_type_icon =
|
||||
setting_type === ORGANIZATION_SETTINGS_TYPE
|
||||
? `${RawBuildingIcon}`.trim()
|
||||
: `${RawToolIcon}`.trim();
|
||||
return getSettingsMarkdown(
|
||||
setting_type,
|
||||
setting_type_icon,
|
||||
setting_name,
|
||||
);
|
||||
return getSettingsMarkdown(setting_type, setting_type_icon, setting_name);
|
||||
}
|
||||
|
||||
const relativeLink = `<a href="${setting_link}">${setting_name}</a>`;
|
||||
@ -374,10 +369,7 @@ const getSettingsHTML = (setting_key: string): string => {
|
||||
</ol>`;
|
||||
};
|
||||
|
||||
const RELATIVE_NAVIGATION_HANDLERS_BY_TYPE: Record<
|
||||
string,
|
||||
(key: string) => string
|
||||
> = {};
|
||||
const RELATIVE_NAVIGATION_HANDLERS_BY_TYPE: Record<string, (key: string) => string> = {};
|
||||
|
||||
for (const type of Object.keys(relative_link_mapping)) {
|
||||
const {data, template, is_link_relative} = relative_link_mapping[type]!;
|
||||
@ -399,13 +391,8 @@ for (const type of Object.keys(relative_link_mapping)) {
|
||||
const {target} = Astro.props;
|
||||
const navigation_link_type = target.split("/")[0];
|
||||
|
||||
if (
|
||||
navigation_link_type !== "settings" &&
|
||||
navigation_link_type !== "relative"
|
||||
) {
|
||||
throw new Error(
|
||||
"Invalid navigation link type. Only `settings` or `relative` is allowed.",
|
||||
);
|
||||
if (navigation_link_type !== "settings" && navigation_link_type !== "relative") {
|
||||
throw new Error("Invalid navigation link type. Only `settings` or `relative` is allowed.");
|
||||
}
|
||||
|
||||
let resultHTML: string | undefined;
|
||||
|
||||
@ -10,11 +10,9 @@ import lightbulb_svg from "../../../web/icons/lightbulb.svg?raw";
|
||||
const lightbulb_icon_fragment = fromHtml(lightbulb_svg, {fragment: true});
|
||||
const lightbulb_icon_first_child = lightbulb_icon_fragment.children[0]!;
|
||||
assert.ok(
|
||||
lightbulb_icon_first_child.type === "element" &&
|
||||
lightbulb_icon_first_child.tagName === "svg",
|
||||
lightbulb_icon_first_child.type === "element" && lightbulb_icon_first_child.tagName === "svg",
|
||||
);
|
||||
lightbulb_icon_first_child.properties.class =
|
||||
"zulip-unplugin-icon aside-icon-lightbulb";
|
||||
lightbulb_icon_first_child.properties.class = "zulip-unplugin-icon aside-icon-lightbulb";
|
||||
|
||||
// We want to add the `Tip: ` prefix without a line break or wrapping
|
||||
// it in a paragraph. If we write `Tip: <slot />`, slot will be wrapped
|
||||
|
||||
Loading…
Reference in New Issue
Block a user