Skip to content

Commit

Permalink
fix(cmd): configure ESLint to work in IDE & CLI
Browse files Browse the repository at this point in the history
Closes #7
  • Loading branch information
susickypavel committed Oct 5, 2024
1 parent 785f1f1 commit 3878919
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion apps/cloudflare
6 changes: 3 additions & 3 deletions apps/web/src/components/common/icon-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(({ chil
return (
<button ref={ref} type="button" className={clsx("p-[0.75rem]", className)} {...attrs}>
<span className="sr-only">{children}</span>
<Icon className="h-text w-text" icon={icon} />
<Icon className="size-text" icon={icon} />
</button>
)
})
);
});
2 changes: 1 addition & 1 deletion apps/web/src/components/form/contact-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ export const ContactForm: FunctionComponent = () => {
<Dialog.Root open={!!image} onOpenChange={onDialogClose}>
<Dialog.Portal>
<Dialog.Overlay className="animate-fade-in">
<Dialog.Content className="bg-primary lg:h-fit lg:bg-secondary animate-fade-in">
<Dialog.Content className="animate-fade-in bg-primary lg:h-fit lg:bg-secondary">
<div className="flex flex-col justify-center gap-lg">
<Dialog.Close asChild>
<button type="button" className="ml-auto block p-md">
Expand Down
6 changes: 3 additions & 3 deletions apps/web/src/layouts/common/navigation-mobile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ export const NavigationMobile: FunctionComponent = () => {
return (
<Dialog.Root>
<Dialog.Trigger asChild>
<IconButton className="self-center justify-self-end lg:hidden text-icon" icon="menu">Open navigation</IconButton>
<IconButton className="self-center justify-self-end text-icon lg:hidden" icon="menu">Open navigation</IconButton>
</Dialog.Trigger>

<Dialog.Portal>
<Dialog.Overlay />
<Dialog.Content className="bg-primary flex items-center justify-end">
<Dialog.Content className="flex items-center justify-end bg-primary">
<Dialog.Title className="sr-only">
Navigation
</Dialog.Title>
Expand All @@ -24,7 +24,7 @@ export const NavigationMobile: FunctionComponent = () => {
</Dialog.Close>

<Dialog.Close asChild>
<IconButton className="absolute right-lg bottom-lg text-icon" icon="octagon-x">Close navigation</IconButton>
<IconButton className="absolute bottom-lg right-lg text-icon" icon="octagon-x">Close navigation</IconButton>
</Dialog.Close>

<ul className="flex flex-col gap-lg text-right">
Expand Down
8 changes: 6 additions & 2 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { resolve } from "node:path";
import { resolve, dirname } from "node:path";
import { fileURLToPath } from 'node:url';

import js from "@eslint/js";
import ts from "typescript-eslint";
Expand All @@ -7,6 +8,9 @@ import tailwind from "eslint-plugin-tailwindcss";
import astro from "eslint-plugin-astro";
import playwright from "eslint-plugin-playwright";

const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);

/**
* @type {import("eslint").ESLint.ConfigData}
*/
Expand Down Expand Up @@ -44,7 +48,7 @@ export default [
{
settings: {
tailwindcss: {
config: resolve(import.meta.url, "./apps/web/tailwind.config.ts"),
config: resolve(__dirname, "./apps/web/tailwind.config.ts"),
},
},
},
Expand Down

0 comments on commit 3878919

Please sign in to comment.