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.startsWith("Error: ")
? children.slice("Error: ".length) ? children.slice("Error: ".length)
: children, : children,
120 120,
)} )}
</p> </p>
</div> </div>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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