Skip to content

Commit

Permalink
Use biome as the formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
smrtrfszm committed Jan 6, 2024
1 parent 768bf44 commit 8d47690
Show file tree
Hide file tree
Showing 24 changed files with 78 additions and 89 deletions.
5 changes: 1 addition & 4 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -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/"]
}
27 changes: 3 additions & 24 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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
2 changes: 0 additions & 2 deletions .prettierignore

This file was deleted.

19 changes: 0 additions & 19 deletions .prettierrc.json

This file was deleted.

32 changes: 32 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"
Expand Down
16 changes: 10 additions & 6 deletions src/app.tsx
Original file line number Diff line number Diff line change
@@ -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[] = [
{
Expand All @@ -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,
},
],
Expand Down
4 changes: 2 additions & 2 deletions src/components/Banners.tsx
Original file line number Diff line number Diff line change
@@ -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 (
Expand Down
2 changes: 1 addition & 1 deletion src/components/CardGrid.tsx
Original file line number Diff line number Diff line change
@@ -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
Expand Down
10 changes: 5 additions & 5 deletions src/components/Footer.tsx
Original file line number Diff line number Diff line change
@@ -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 (
Expand Down
4 changes: 2 additions & 2 deletions src/components/Header.tsx
Original file line number Diff line number Diff line change
@@ -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<Setter<string[]>>()

Expand Down
2 changes: 1 addition & 1 deletion src/components/ImageViewer.tsx
Original file line number Diff line number Diff line change
@@ -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 = {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Logo.tsx
Original file line number Diff line number Diff line change
@@ -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 (
Expand Down
2 changes: 1 addition & 1 deletion src/components/Title.tsx
Original file line number Diff line number Diff line change
@@ -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'

Expand Down
2 changes: 1 addition & 1 deletion src/data/home.data.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
2 changes: 1 addition & 1 deletion src/data/pages.data.ts
Original file line number Diff line number Diff line change
@@ -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'

Expand Down
2 changes: 1 addition & 1 deletion src/data/post.data.ts
Original file line number Diff line number Diff line change
@@ -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'

Expand Down
2 changes: 1 addition & 1 deletion src/data/search.data.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
2 changes: 1 addition & 1 deletion src/entry-client.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { mount, StartClient } from '@solidjs/start/client'
import { StartClient, mount } from '@solidjs/start/client'

mount(() => <StartClient />, document.getElementById('app'))
2 changes: 1 addition & 1 deletion src/entry-server.tsx
Original file line number Diff line number Diff line change
@@ -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(() => (
Expand Down
6 changes: 3 additions & 3 deletions src/pages/Home.tsx
Original file line number Diff line number Diff line change
@@ -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<RouteSectionProps> = () => {
const data = createAsync(() => queryHomePage())
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Pages.tsx
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
14 changes: 7 additions & 7 deletions src/pages/Post.tsx
Original file line number Diff line number Diff line change
@@ -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<RouteSectionProps> = ({ params }) => {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Search.tsx
Original file line number Diff line number Diff line change
@@ -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'
Expand Down

0 comments on commit 8d47690

Please sign in to comment.