From 3b03df3ff5a22507977da6f2522982fe4e3cafe8 Mon Sep 17 00:00:00 2001 From: ner Date: Sat, 5 Oct 2024 17:23:37 +0300 Subject: [PATCH] fix: order of tailwind classes --- .eslintrc.json | 54 +- app/(site)/container.tsx | 8 +- app/(site)/favorites/container.tsx | 2 +- app/(site)/loading.tsx | 2 +- app/(site)/similar/container.tsx | 2 +- app/(site)/starring/container.tsx | 2 +- .../Header/components/Navigation/index.tsx | 4 +- components/Header/components/Search/index.tsx | 2 +- components/Header/index.tsx | 4 +- components/NoResults/index.tsx | 2 +- components/Preview/components/Actions.tsx | 8 +- components/Preview/index.tsx | 6 +- .../Random/components/Carousel/index.tsx | 2 +- components/Random/index.tsx | 2 +- components/Show/components/Credits/index.tsx | 14 +- components/Show/components/Handlers/index.tsx | 2 +- components/Show/components/Poster/index.tsx | 4 +- .../Show/components/Torrents/HostManager.tsx | 2 +- .../Torrents/components/Player/index.tsx | 4 +- .../components/TableHeadSortable/index.tsx | 4 +- components/Show/components/Torrents/index.tsx | 24 +- components/Show/components/Trailer/index.tsx | 4 +- components/Show/index.tsx | 12 +- .../Trending/components/Marquee/index.tsx | 2 +- components/ui/button.tsx | 4 +- components/ui/dialog.tsx | 4 +- components/ui/dropdown-menu.tsx | 10 +- components/ui/nav.tsx | 2 +- components/ui/toast.tsx | 2 +- lib/utils.ts | 5 +- package-lock.json | 1179 +---------------- package.json | 6 +- public/next.svg | 1 - 33 files changed, 135 insertions(+), 1250 deletions(-) delete mode 100644 public/next.svg diff --git a/.eslintrc.json b/.eslintrc.json index dffa4b3..d1f5743 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,54 +1,32 @@ { - "extends": "next/core-web-vitals", - "plugins": [ - "simple-import-sort" - ], + "extends": ["next/core-web-vitals", "plugin:tailwindcss/recommended"], + "plugins": ["simple-import-sort", "tailwindcss"], "rules": { + "tailwindcss/classnames-order": "error", "simple-import-sort/imports": "error", "simple-import-sort/exports": "error", "quotes": ["error", "single"] }, + "settings": { + "tailwindcss": { + // Tailwind config path, relative to the project root + "config": "./tailwind.config.js" + } + }, "overrides": [ { - "files": [ - "*.js", - "*.jsx", - "*.ts", - "*.tsx" - ], + "files": ["*.js", "*.jsx", "*.ts", "*.tsx"], "rules": { "simple-import-sort/imports": [ "error", { "groups": [ - // Packages `react` related packages come first. - [ - "^react", - "^@?\\w" - ], - // Internal packages. - [ - "^(@|components)(/.*|$)" - ], - // Side effect imports. - [ - "^\\u0000" - ], - // Parent imports. Put `..` last. - [ - "^\\.\\.(?!/?$)", - "^\\.\\./?$" - ], - // Other relative imports. Put same-folder imports and `.` last. - [ - "^\\./(?=.*/)(?!/?$)", - "^\\.(?!/?$)", - "^\\./?$" - ], - // Style imports. - [ - "^.+\\.?(css)$" - ] + ["^react", "^@?\\w"], + ["^(@|components)(/.*|$)"], + ["^\\u0000"], + ["^\\.\\.(?!/?$)", "^\\.\\./?$"], + ["^\\./(?=.*/)(?!/?$)", "^\\.(?!/?$)", "^\\./?$"], + ["^.+\\.?(css)$"] ] } ] diff --git a/app/(site)/container.tsx b/app/(site)/container.tsx index 558d5a7..cc8eb54 100644 --- a/app/(site)/container.tsx +++ b/app/(site)/container.tsx @@ -2,14 +2,14 @@ import Random from '@/components/Random'; import Trending from '@/components/Trending'; const Container = () => ( -
+
-
+
-
+
-
+
); diff --git a/app/(site)/favorites/container.tsx b/app/(site)/favorites/container.tsx index f932719..02f562b 100644 --- a/app/(site)/favorites/container.tsx +++ b/app/(site)/favorites/container.tsx @@ -13,7 +13,7 @@ export default function Container() { if (!shows.length) return ( -
+
There are no items in your favorites list
); diff --git a/app/(site)/loading.tsx b/app/(site)/loading.tsx index 1f8313f..5ff72dd 100644 --- a/app/(site)/loading.tsx +++ b/app/(site)/loading.tsx @@ -1,7 +1,7 @@ import { Loader } from 'lucide-react'; const Loading = () => ( -
+
diff --git a/app/(site)/similar/container.tsx b/app/(site)/similar/container.tsx index eaa17a4..e49740f 100644 --- a/app/(site)/similar/container.tsx +++ b/app/(site)/similar/container.tsx @@ -19,7 +19,7 @@ const Container = () => { return ( <> {Boolean(title) && ( - + Similar: {decodeURIComponent(title)} )} diff --git a/app/(site)/starring/container.tsx b/app/(site)/starring/container.tsx index 3293895..758f95f 100644 --- a/app/(site)/starring/container.tsx +++ b/app/(site)/starring/container.tsx @@ -18,7 +18,7 @@ const Container = () => { return ( <> {Boolean(title) && ( - + Starring: {decodeURIComponent(title || '')} )} diff --git a/components/Header/components/Navigation/index.tsx b/components/Header/components/Navigation/index.tsx index 0b02f5e..e1ea7a0 100644 --- a/components/Header/components/Navigation/index.tsx +++ b/components/Header/components/Navigation/index.tsx @@ -22,12 +22,12 @@ export const MobileNavigation = () => { - + {paths.map(({ path, title }) => (
-
diff --git a/components/Header/components/Search/index.tsx b/components/Header/components/Search/index.tsx index 4255718..7803955 100644 --- a/components/Header/components/Search/index.tsx +++ b/components/Header/components/Search/index.tsx @@ -38,7 +38,7 @@ export const showSearchModal = create(({ onResolve }) => { const isFetched = movies.isFetched && series.isFetched; return ( - +
( -
+
- Movie advisor + Movie advisor
diff --git a/components/NoResults/index.tsx b/components/NoResults/index.tsx index c529660..11d516d 100644 --- a/components/NoResults/index.tsx +++ b/components/NoResults/index.tsx @@ -1,5 +1,5 @@ const NoResults = () => ( -
Nothing was found
+
Nothing was found
); export default NoResults; diff --git a/components/Preview/components/Actions.tsx b/components/Preview/components/Actions.tsx index 4a26b00..d76b553 100644 --- a/components/Preview/components/Actions.tsx +++ b/components/Preview/components/Actions.tsx @@ -15,13 +15,13 @@ const Actions = ({ onClose, show }: Props) => ( <> {({ onPlay, disabled }) => ( - )} - + ); diff --git a/components/Preview/index.tsx b/components/Preview/index.tsx index fa8dcbd..5b7a4fc 100644 --- a/components/Preview/index.tsx +++ b/components/Preview/index.tsx @@ -25,13 +25,13 @@ const Preview: FC = ({ show, className, onClose, children, card }) => { return (
{card || } -
- {children &&
{children}
} +
+ {children &&
{children}
}
-

+

{show.overview}

diff --git a/components/Random/components/Carousel/index.tsx b/components/Random/components/Carousel/index.tsx index 8ccf20d..d456738 100644 --- a/components/Random/components/Carousel/index.tsx +++ b/components/Random/components/Carousel/index.tsx @@ -43,7 +43,7 @@ const components: VirtuosoProps void>['components'] = { }), Scroller: forwardRef(function Scroller({ context, ...props }, ref) { return ( -
+
); }) }; diff --git a/components/Random/index.tsx b/components/Random/index.tsx index a4458b5..8841887 100644 --- a/components/Random/index.tsx +++ b/components/Random/index.tsx @@ -11,7 +11,7 @@ const Random = () => { return ( } /> ); diff --git a/components/Show/components/Credits/index.tsx b/components/Show/components/Credits/index.tsx index 58dc654..ae5f1e7 100644 --- a/components/Show/components/Credits/index.tsx +++ b/components/Show/components/Credits/index.tsx @@ -18,18 +18,18 @@ const Credits: FC = ({ showId, showType = 'movie', onPersonClick }) => { return ( Boolean(credits?.length) && ( -
    +
      {credits?.map((actor) => (
    • onPersonClick?.(actor.id.toString())} > -
      +
      {actor.profile_path ? ( = ({ showId, showType = 'movie', onPersonClick }) => { alt={actor.name} /> ) : ( -
      +
      )}
      -
      -

      {actor.name}

      +
      +

      {actor.name}

      {Boolean(actor.character) && ( -

      {actor.character}

      +

      {actor.character}

      )}
      diff --git a/components/Show/components/Handlers/index.tsx b/components/Show/components/Handlers/index.tsx index 3aa7ab8..6e9a451 100644 --- a/components/Show/components/Handlers/index.tsx +++ b/components/Show/components/Handlers/index.tsx @@ -12,7 +12,7 @@ interface Props { const Handlers: FC = ({ onClick, show }) => { const { toggle } = useFavoriteToggle(show); - return
      ; + return
      ; }; export default Handlers; diff --git a/components/Show/components/Poster/index.tsx b/components/Show/components/Poster/index.tsx index 83321d4..72f5651 100644 --- a/components/Show/components/Poster/index.tsx +++ b/components/Show/components/Poster/index.tsx @@ -8,9 +8,9 @@ interface Props { const Poster: FC = ({ title, poster }) => { return poster ? ( - {title} + {title} ) : ( -
      +
      ); diff --git a/components/Show/components/Torrents/HostManager.tsx b/components/Show/components/Torrents/HostManager.tsx index 1eeafc4..bc5b739 100644 --- a/components/Show/components/Torrents/HostManager.tsx +++ b/components/Show/components/Torrents/HostManager.tsx @@ -9,7 +9,7 @@ const showHostManagerModal = create>(({ onResolve, onRejec const setPrefix = useSetPrefix(); return ( - + { return ( @@ -62,7 +62,7 @@ const showPlayer = create(({ onResolve, magnet, backdrop }: Props) => { {isLoading && ( <> -
      +
      diff --git a/components/Show/components/Torrents/components/TableHeadSortable/index.tsx b/components/Show/components/Torrents/components/TableHeadSortable/index.tsx index c8fd064..daa45f8 100644 --- a/components/Show/components/Torrents/components/TableHeadSortable/index.tsx +++ b/components/Show/components/Torrents/components/TableHeadSortable/index.tsx @@ -19,10 +19,10 @@ const TableHeadSortable: FC = ({ title, sort, value, sortable, onChange } return ( -
      +
      {title} {sortable && - (sort === value ? : )} + (sort === value ? : )}
      ); diff --git a/components/Show/components/Torrents/index.tsx b/components/Show/components/Torrents/index.tsx index 4db8153..cb8d7ed 100644 --- a/components/Show/components/Torrents/index.tsx +++ b/components/Show/components/Torrents/index.tsx @@ -49,12 +49,12 @@ const showTorrentsModal = create(({ title, year, showType, showId, backdrop, onR return ( - +
      - {title} + {title}