Use trailingComma: 'all' (#1457)

This commit is contained in:
Charlie Marsh 2022-12-29 19:36:51 -05:00 committed by GitHub
parent 2c7464604a
commit 9db825c731
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 19 additions and 16 deletions

View File

@ -0,0 +1,3 @@
{
"trailingComma": "all"
}

View File

@ -18,7 +18,7 @@ export function ErrorMessage({ children }: { children: string }) {
children.startsWith("Error: ")
? children.slice("Error: ".length)
: children,
120
120,
)}
</p>
</div>

View File

@ -45,7 +45,7 @@ export default function Header({
"border-gray-200",
"dark:border-gray-800",
"bg-ayu-background",
"dark:bg-ayu-background-dark"
"dark:bg-ayu-background-dark",
)}
>
<div className="flex space-x-5">
@ -55,14 +55,14 @@ export default function Header({
"relative flex py-3 text-sm leading-6 font-semibold focus:outline-none",
tab === "Source"
? "text-ayu-accent"
: "text-gray-700 hover:text-gray-900 focus:text-gray-900 dark:text-gray-300 dark:hover:text-white"
: "text-gray-700 hover:text-gray-900 focus:text-gray-900 dark:text-gray-300 dark:hover:text-white",
)}
onClick={() => onChangeTab("Source")}
>
<span
className={classNames(
"absolute bottom-0 inset-x-0 bg-ayu-accent h-0.5 rounded-full transition-opacity duration-150",
tab === "Source" ? "opacity-100" : "opacity-0"
tab === "Source" ? "opacity-100" : "opacity-0",
)}
/>
Source
@ -73,14 +73,14 @@ export default function Header({
"relative flex py-3 text-sm leading-6 font-semibold focus:outline-none",
tab === "Settings"
? "text-ayu-accent"
: "text-gray-700 hover:text-gray-900 focus:text-gray-900 dark:text-gray-300 dark:hover:text-white"
: "text-gray-700 hover:text-gray-900 focus:text-gray-900 dark:text-gray-300 dark:hover:text-white",
)}
onClick={() => onChangeTab("Settings")}
>
<span
className={classNames(
"absolute bottom-0 inset-x-0 bg-ayu-accent h-0.5 rounded-full transition-opacity duration-150",
tab === "Settings" ? "opacity-100" : "opacity-0"
tab === "Settings" ? "opacity-100" : "opacity-0",
)}
/>
Settings

View File

@ -36,7 +36,7 @@ export default function SettingsEditor({
(value: string | undefined) => {
onChange(value ?? "");
},
[onChange]
[onChange],
);
return (
<Editor

View File

@ -44,7 +44,7 @@ export default function SourceEditor({
check.code === "F401" || check.code === "F841"
? [MarkerTag.Unnecessary]
: [],
}))
})),
);
const codeActionProvider = monaco?.languages.registerCodeActionProvider(
@ -81,7 +81,7 @@ export default function SourceEditor({
}));
return { actions, dispose: () => {} };
},
}
},
);
return () => {
@ -93,7 +93,7 @@ export default function SourceEditor({
(value: string | undefined) => {
onChange(value ?? "");
},
[onChange]
[onChange],
);
return (

View File

@ -17,7 +17,7 @@ export default function VersionTag({ children }: { children: ReactNode }) {
"items-center",
"dark:bg-gray-800",
"dark:text-gray-400",
"dark:shadow-highlight/4"
"dark:shadow-highlight/4",
)}
>
{children}

View File

@ -15,7 +15,7 @@ export function stringify(settings: Settings): string {
return v;
}
},
2
2,
);
}
@ -24,7 +24,7 @@ export function stringify(settings: Settings): string {
*/
export function persist(settingsSource: string, pythonSource: string) {
window.location.hash = lzstring.compressToEncodedURIComponent(
settingsSource + "$$$" + pythonSource
settingsSource + "$$$" + pythonSource,
);
}
@ -33,7 +33,7 @@ export function persist(settingsSource: string, pythonSource: string) {
*/
export function restore(): [string, string] | null {
const value = lzstring.decompressFromEncodedURIComponent(
window.location.hash.slice(1)
window.location.hash.slice(1),
);
if (value) {

View File

@ -6,5 +6,5 @@ import "./index.css";
ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
<React.StrictMode>
<Editor />
</React.StrictMode>
</React.StrictMode>,
);

View File

@ -1,6 +1,6 @@
declare module "lz-string" {
function decompressFromEncodedURIComponent(
input: string | null
input: string | null,
): string | null;
function compressToEncodedURIComponent(input: string | null): string;
}