diff --git a/.eslintrc.json b/.eslintrc.json index 1db5309..bac9605 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -10,9 +10,6 @@ "ecmaVersion": "latest", "sourceType": "module" }, - "plugins": ["@typescript-eslint", "solid", "prettier"], - "rules": { - "prettier/prettier": "error" - }, + "plugins": ["@typescript-eslint", "solid"], "ignorePatterns": ["node_modules/", "dist/"] } diff --git a/.gitignore b/.gitignore index d20c03d..6f9e690 100644 --- a/.gitignore +++ b/.gitignore @@ -1,30 +1,9 @@ - -dist .solid .output -.vercel -.netlify -netlify - -# Environment -.env -.env*.local - -# dependencies -/node_modules - -# IDEs and editors -/.idea -.project -.classpath -*.launch -.settings/ - -# Temp -gitignore +.vinxi +node_modules +.idea -# System Files .DS_Store Thumbs.db -.vinxi diff --git a/.prettierignore b/.prettierignore deleted file mode 100644 index dee70d2..0000000 --- a/.prettierignore +++ /dev/null @@ -1,2 +0,0 @@ -dist -pnpm-lock.yaml diff --git a/.prettierrc.json b/.prettierrc.json deleted file mode 100644 index 5d7fb7a..0000000 --- a/.prettierrc.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "printWidth": 120, - "tabWidth": 2, - "useTabs": false, - "semi": false, - "singleQuote": true, - "quoteProps": "as-needed", - "jsxSingleQuote": false, - "trailingComma": "es5", - "bracketSpacing": true, - "bracketSameLine": false, - "arrowParens": "always", - "requirePragma": false, - "insertPragma": false, - "proseWrap": "always", - "htmlWhitespaceSensitivity": "strict", - "endOfLine": "lf", - "embeddedLanguageFormatting": "off" -} diff --git a/biome.json b/biome.json new file mode 100644 index 0000000..e4ed59b --- /dev/null +++ b/biome.json @@ -0,0 +1,32 @@ +{ + "vcs": { + "enabled": true, + "clientKind": "git", + "useIgnoreFile": true + }, + "formatter": { + "enabled": true, + "indentStyle": "space", + "indentWidth": 2, + "lineWidth": 120, + "lineEnding": "lf" + }, + "linter": { + "enabled": false + }, + "organizeImports": { + "enabled": true + }, + "javascript": { + "formatter": { + "trailingComma": "es5", + "arrowParentheses": "always", + "quoteStyle": "single", + "jsxQuoteStyle": "double", + "bracketSpacing": true, + "bracketSameLine": false, + "semicolons": "asNeeded", + "quoteProperties": "asNeeded" + } + } +} diff --git a/package.json b/package.json index 3f0702a..465ded2 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "dev": "vinxi dev", "build": "vinxi build", "start": "node ./.output/server/index.mjs", - "format": "prettier . --write", + "format": "pnpm dlx @biomejs/biome format --write .", "lint": "eslint --ext .tsx,.ts,.json,.js,.jsx ." }, "type": "module", @@ -16,10 +16,8 @@ "@typescript-eslint/parser": "^6.15.0", "esbuild": "^0.14.54", "eslint": "^8.56.0", - "eslint-plugin-prettier": "^5.0.1", "eslint-plugin-solid": "^0.13.0", "postcss": "^8.4.32", - "prettier": "3.0.3", "sass": "^1.69.5", "typescript": "^4.9.5", "vite": "^4.5.1" diff --git a/src/app.tsx b/src/app.tsx index 5049098..8988de4 100644 --- a/src/app.tsx +++ b/src/app.tsx @@ -1,17 +1,17 @@ // @refresh reload -import { ErrorBoundary, lazy, Suspense } from 'solid-js' +import { Meta, MetaProvider } from '@solidjs/meta' +import { RouteDefinition, Router } from '@solidjs/router' import 'normalize.css' +import { ErrorBoundary, Suspense, lazy } from 'solid-js' import previewImage from '~/assets/preview_image.png' -import '~/scss/global.scss' import Layout from '~/components/Layout' import Title from '~/components/Title' -import { RouteDefinition, Router } from '@solidjs/router' -import { Meta, MetaProvider } from '@solidjs/meta' +import '~/scss/global.scss' import { loadHomePage } from './data/home.data' +import { loadPagesPage } from './data/pages.data' import { loadPost } from './data/post.data' import { loadSearchPage } from './data/search.data' -import { loadPagesPage } from './data/pages.data' const ROUTES: RouteDefinition[] = [ { @@ -37,7 +37,11 @@ const ROUTES: RouteDefinition[] = [ }, { path: '/:type/:value', - component: lazy(() => import('~/pages/Search').then((c) => ({ default: c.SearchPageRedirect }))), + component: lazy(() => + import('~/pages/Search').then((c) => ({ + default: c.SearchPageRedirect, + })) + ), load: loadSearchPage, }, ], diff --git a/src/components/Banners.tsx b/src/components/Banners.tsx index a46e13f..89ea28c 100644 --- a/src/components/Banners.tsx +++ b/src/components/Banners.tsx @@ -1,9 +1,9 @@ +import { A } from '@solidjs/router' import { VoidComponent } from 'solid-js' +import bazis from '~/assets/banners/bazisintezmeny_logo.png' import hatartalanul from '~/assets/banners/hatartalanul.jpg' import ntp from '~/assets/banners/ntp.png' -import bazis from '~/assets/banners/bazisintezmeny_logo.png' import styles from './Banners.module.scss' -import { A } from '@solidjs/router' const Banners: VoidComponent = () => { return ( diff --git a/src/components/CardGrid.tsx b/src/components/CardGrid.tsx index da48520..9794863 100644 --- a/src/components/CardGrid.tsx +++ b/src/components/CardGrid.tsx @@ -1,7 +1,7 @@ import { For, VoidComponent } from 'solid-js' import { Post } from '~/models/post' -import PostCard from './PostCard' import styles from './CardGrid.module.scss' +import PostCard from './PostCard' export type CardGridProps = { posts: Post[] | undefined diff --git a/src/components/Footer.tsx b/src/components/Footer.tsx index 6598a22..f8a0c77 100644 --- a/src/components/Footer.tsx +++ b/src/components/Footer.tsx @@ -1,12 +1,12 @@ +import { A } from '@solidjs/router' +import { FaBrandsFacebookF, FaBrandsGithub } from 'solid-icons/fa' import { VoidComponent } from 'solid-js' +import eugy from '~/assets/icons/eugy.png' +import kk from '~/assets/icons/kk-logo.webp' +import kreta from '~/assets/icons/kreta.png' import { VERSION } from '~/constants' import styles from './Footer.module.scss' -import { FaBrandsFacebookF, FaBrandsGithub } from 'solid-icons/fa' import Logo from './Logo' -import kk from '~/assets/icons/kk-logo.webp' -import kreta from '~/assets/icons/kreta.png' -import eugy from '~/assets/icons/eugy.png' -import { A } from '@solidjs/router' const Footer: VoidComponent = () => { return ( diff --git a/src/components/Header.tsx b/src/components/Header.tsx index 12d98bf..a7965e9 100644 --- a/src/components/Header.tsx +++ b/src/components/Header.tsx @@ -1,9 +1,9 @@ import { A, useLocation, useNavigate } from '@solidjs/router' import { FaSolidBars, FaSolidChevronDown, FaSolidMagnifyingGlass, FaSolidXmark } from 'solid-icons/fa' -import { createContext, createMemo, createSignal, ParentComponent, Setter, useContext, VoidComponent } from 'solid-js' +import { ParentComponent, Setter, VoidComponent, createContext, createMemo, createSignal, useContext } from 'solid-js' +import kretalogo from '~/assets/icons/kreta.png' import styles from './Header.module.scss' import Logo from './Logo' -import kretalogo from '~/assets/icons/kreta.png' const DropdownContext = createContext>() diff --git a/src/components/ImageViewer.tsx b/src/components/ImageViewer.tsx index bc1c2e9..29ca206 100644 --- a/src/components/ImageViewer.tsx +++ b/src/components/ImageViewer.tsx @@ -1,5 +1,5 @@ import { FaSolidChevronLeft } from 'solid-icons/fa' -import { createEffect, on, createSignal, For, onMount, VoidComponent, untrack } from 'solid-js' +import { For, VoidComponent, createEffect, createSignal, on, onMount, untrack } from 'solid-js' import styles from './ImageViewer.module.scss' export type ImageViewerProps = { diff --git a/src/components/Logo.tsx b/src/components/Logo.tsx index 3ddf10d..8e4d280 100644 --- a/src/components/Logo.tsx +++ b/src/components/Logo.tsx @@ -1,7 +1,7 @@ import { A } from '@solidjs/router' import { VoidComponent } from 'solid-js' -import styles from './Logo.module.scss' import logo from '~/assets/icons/logo.svg' +import styles from './Logo.module.scss' const Logo: VoidComponent = () => { return ( diff --git a/src/components/Title.tsx b/src/components/Title.tsx index c5302ac..e274793 100644 --- a/src/components/Title.tsx +++ b/src/components/Title.tsx @@ -1,5 +1,5 @@ -import { VoidComponent } from 'solid-js' import { Meta, Title as TitleMeta } from '@solidjs/meta' +import { VoidComponent } from 'solid-js' const BASE_TITLE = 'Verseghy Ferenc Gimnázium' diff --git a/src/data/home.data.ts b/src/data/home.data.ts index 3e3aa7d..6546706 100644 --- a/src/data/home.data.ts +++ b/src/data/home.data.ts @@ -1,5 +1,5 @@ import { gql, request } from '@solid-primitives/graphql' -import { cache, RouteLoadFunc } from '@solidjs/router' +import { RouteLoadFunc, cache } from '@solidjs/router' import { GRAPHQL_BACKEND_URL } from '~/constants' import { Connection, PageInfo } from '~/models/connection' import { Post } from '~/models/post' diff --git a/src/data/pages.data.ts b/src/data/pages.data.ts index 5da9fb7..01a100c 100644 --- a/src/data/pages.data.ts +++ b/src/data/pages.data.ts @@ -1,5 +1,5 @@ import { gql, request } from '@solid-primitives/graphql' -import { cache, redirect, RouteLoadFunc } from '@solidjs/router' +import { RouteLoadFunc, cache, redirect } from '@solidjs/router' import { GRAPHQL_BACKEND_URL } from '~/constants' import { Page } from '~/models/page' diff --git a/src/data/post.data.ts b/src/data/post.data.ts index 7ea4fe1..83e49af 100644 --- a/src/data/post.data.ts +++ b/src/data/post.data.ts @@ -1,5 +1,5 @@ import { gql, request } from '@solid-primitives/graphql' -import { cache, redirect, RouteLoadFunc } from '@solidjs/router' +import { RouteLoadFunc, cache, redirect } from '@solidjs/router' import { GRAPHQL_BACKEND_URL } from '~/constants' import { Post } from '~/models/post' diff --git a/src/data/search.data.ts b/src/data/search.data.ts index c3b4d5a..0dc454d 100644 --- a/src/data/search.data.ts +++ b/src/data/search.data.ts @@ -1,5 +1,5 @@ import { gql, request } from '@solid-primitives/graphql' -import { cache, Params, RouteLoadFunc } from '@solidjs/router' +import { Params, RouteLoadFunc, cache } from '@solidjs/router' import { GRAPHQL_BACKEND_URL } from '~/constants' import { Connection, PageInfo } from '~/models/connection' import { Post } from '~/models/post' diff --git a/src/entry-client.tsx b/src/entry-client.tsx index 15a4df4..d347d44 100644 --- a/src/entry-client.tsx +++ b/src/entry-client.tsx @@ -1,3 +1,3 @@ -import { mount, StartClient } from '@solidjs/start/client' +import { StartClient, mount } from '@solidjs/start/client' mount(() => , document.getElementById('app')) diff --git a/src/entry-server.tsx b/src/entry-server.tsx index 9158572..548da44 100644 --- a/src/entry-server.tsx +++ b/src/entry-server.tsx @@ -1,4 +1,4 @@ -import { createHandler, StartServer } from '@solidjs/start/server' +import { StartServer, createHandler } from '@solidjs/start/server' import favicon from '~/assets/favicon.ico' export default createHandler(() => ( diff --git a/src/pages/Home.tsx b/src/pages/Home.tsx index 085626f..f2ac396 100644 --- a/src/pages/Home.tsx +++ b/src/pages/Home.tsx @@ -1,10 +1,10 @@ +import { Meta } from '@solidjs/meta' +import { RouteSectionProps, createAsync } from '@solidjs/router' import { Component } from 'solid-js' import Banners from '~/components/Banners' import CardGrid from '~/components/CardGrid' -import styles from './Home.module.scss' -import { Meta } from '@solidjs/meta' -import { createAsync, RouteSectionProps } from '@solidjs/router' import { queryHomePage } from '~/data/home.data' +import styles from './Home.module.scss' const HomePage: Component = () => { const data = createAsync(() => queryHomePage()) diff --git a/src/pages/Pages.tsx b/src/pages/Pages.tsx index 9416b7d..c96a110 100644 --- a/src/pages/Pages.tsx +++ b/src/pages/Pages.tsx @@ -1,5 +1,5 @@ import { Meta } from '@solidjs/meta' -import { createAsync, RouteSectionProps } from '@solidjs/router' +import { RouteSectionProps, createAsync } from '@solidjs/router' import { Component, Show } from 'solid-js' import PageRenderer from '~/components/PageRenderer' import Title from '~/components/Title' diff --git a/src/pages/Post.tsx b/src/pages/Post.tsx index 30e4121..6244444 100644 --- a/src/pages/Post.tsx +++ b/src/pages/Post.tsx @@ -1,14 +1,14 @@ +import { Meta } from '@solidjs/meta' +import { RouteSectionProps, createAsync } from '@solidjs/router' +import { formatISO } from 'date-fns' import { Component, For, Show } from 'solid-js' -import styles from './Post.module.scss' -import Title from '~/components/Title' -import Label from '~/components/Label' -import PageRenderer from '~/components/PageRenderer' import FormattedDate from '~/components/FormattedDate' import ImageViewer from '~/components/ImageViewer' -import { createAsync, RouteSectionProps } from '@solidjs/router' -import { Meta } from '@solidjs/meta' +import Label from '~/components/Label' +import PageRenderer from '~/components/PageRenderer' +import Title from '~/components/Title' import { queryPostById } from '~/data/post.data' -import { formatISO } from 'date-fns' +import styles from './Post.module.scss' // eslint-disable-next-line solid/no-destructure const PostPage: Component = ({ params }) => { diff --git a/src/pages/Search.tsx b/src/pages/Search.tsx index e7f2409..1a38fda 100644 --- a/src/pages/Search.tsx +++ b/src/pages/Search.tsx @@ -1,4 +1,4 @@ -import { createAsync, Navigate, RouteSectionProps } from '@solidjs/router' +import { Navigate, RouteSectionProps, createAsync } from '@solidjs/router' import { Component, Show } from 'solid-js' import CardGrid from '~/components/CardGrid' import Title from '~/components/Title'