diff --git a/.commitlintrc.yaml b/.commitlintrc.yaml new file mode 100644 index 0000000..522602e --- /dev/null +++ b/.commitlintrc.yaml @@ -0,0 +1,28 @@ +--- +# The rules below have been manually copied from @commitlint/config-conventional +# and match the v1.0.0 specification: +# https://www.conventionalcommits.org/en/v1.0.0/#specification +# +# You can remove them and uncomment the config below when the following issue is +# fixed: https://github.com/conventional-changelog/commitlint/issues/613 +# +# extends: +# - '@commitlint/config-conventional' +rules: + body-leading-blank: [1, always] + body-max-line-length: [2, always, 100] + footer-leading-blank: [1, always] + footer-max-line-length: [2, always, 100] + header-max-length: [2, always, 100] + subject-case: + - 2 + - never + - [sentence-case, start-case, pascal-case, upper-case] + subject-empty: [2, never] + subject-full-stop: [2, never, "."] + type-case: [2, always, lower-case] + type-empty: [2, never] + type-enum: + - 2 + - always + - [build, chore, ci, docs, feat, fix, perf, refactor, revert, style, test] diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs new file mode 100644 index 0000000..c6f6b3a --- /dev/null +++ b/.git-blame-ignore-revs @@ -0,0 +1,2 @@ +# refactor: sort imports +ecca1e269af9ac715324a2bb5e5b8f2661a7642e diff --git a/.github/workflows/lint-pr.yaml b/.github/workflows/lint-pr.yaml new file mode 100644 index 0000000..17db916 --- /dev/null +++ b/.github/workflows/lint-pr.yaml @@ -0,0 +1,20 @@ +name: Lint PR + +on: + pull_request: + branches: ["main"] + +jobs: + commitlint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - run: >- + npx + commitlint + --from ${{ gitea.event.pull_request.base.sha }} + --to ${{ gitea.event.pull_request.head.sha }} + --verbose diff --git a/eslint.config.js b/eslint.config.js index 092408a..146b314 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -1,7 +1,7 @@ import js from '@eslint/js' -import globals from 'globals' import reactHooks from 'eslint-plugin-react-hooks' import reactRefresh from 'eslint-plugin-react-refresh' +import globals from 'globals' import tseslint from 'typescript-eslint' export default tseslint.config( diff --git a/src/main.tsx b/src/main.tsx index fbe5e92..a5a082b 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -1,9 +1,9 @@ +import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; import { StrictMode } from "react"; import { createRoot } from "react-dom/client"; import { RouterProvider } from "react-router"; import "./index.css"; import { router } from "./routes.ts"; -import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; const queryClient = new QueryClient(); diff --git a/src/root.tsx b/src/root.tsx index dc29bda..32c6aaa 100644 --- a/src/root.tsx +++ b/src/root.tsx @@ -1,5 +1,5 @@ -import "./root.css"; import { NavLink, Outlet } from "react-router"; +import "./root.css"; export default function App() { return ( diff --git a/src/routes/transactions.tsx b/src/routes/transactions.tsx index df35da7..3738668 100644 --- a/src/routes/transactions.tsx +++ b/src/routes/transactions.tsx @@ -1,10 +1,10 @@ import { keepPreviousData, useQuery } from "@tanstack/react-query"; import { - PaginationState, ColumnFiltersState, createColumnHelper, flexRender, getCoreRowModel, + PaginationState, useReactTable, } from "@tanstack/react-table"; import { useState } from "react"; diff --git a/vite.config.ts b/vite.config.ts index 8b0f57b..9982072 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,5 +1,5 @@ -import { defineConfig } from 'vite' import react from '@vitejs/plugin-react' +import { defineConfig } from 'vite' // https://vite.dev/config/ export default defineConfig({