Merge pull request #1 from onixbyte-opensource/chore/switch-to-oxlint

chore: switch from eslint to oxlint
This commit is contained in:
siujamo authored and GitHub committed 2026-09-14 11:12:43 +08:00
commit dd4b3189f4
8 files changed
+725 -2733

No files matched your search

-79
View File
@@ -1,79 +0,0 @@
name: Deploy to GitHub Pages
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '20'
- name: Setup pnpm
uses: pnpm/action-setup@v5
with:
version: latest
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: Setup pnpm cache
uses: actions/cache@v5
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build
run: pnpm build
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v4
with:
path: './dist'
# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
+7
View File
@@ -0,0 +1,7 @@
{
"plugins": ["react", "react-hooks", "typescript"],
"rules": {
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn"
}
}
+22 -26
View File
@@ -6,38 +6,34 @@
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
"build": "tsc -b && vite build", "build": "tsc -b && vite build",
"lint": "eslint .", "lint": "oxlint",
"preview": "vite preview", "type-check": "tsc --noEmit",
"deploy": "pnpm build && gh-pages -d dist", "check": "oxlint && tsc --noEmit",
"predeploy": "pnpm build" "preview": "vite preview"
}, },
"dependencies": { "dependencies": {
"@reduxjs/toolkit": "^2.11.2", "@reduxjs/toolkit": "^2.12.0",
"@tailwindcss/vite": "^4.2.2", "@tailwindcss/vite": "^4.3.3",
"axios": "^1.16.1", "axios": "^1.20.0",
"dayjs": "^1.11.20", "dayjs": "^1.11.23",
"react": "^19.2.6", "react": "^19.3.0",
"react-dom": "^19.2.6", "react-dom": "^19.3.0",
"react-redux": "^9.3.0", "react-redux": "^9.3.0",
"react-router": "^7.16.0", "react-router": "^7.18.3",
"react-router-dom": "^7.16.0", "react-router-dom": "^7.18.3",
"redux-persist": "^6.0.0", "redux-persist": "^6.0.0",
"tailwindcss": "^4.3.0" "tailwindcss": "^4.3.3"
}, },
"devDependencies": { "devDependencies": {
"@eslint/js": "^9.39.4", "@eslint/js": "^9.39.5",
"@types/node": "^25.9.1", "@types/node": "^25.9.6",
"@types/react": "^19.2.15", "@types/react": "^19.3.0",
"@types/react-dom": "^19.2.3", "@types/react-dom": "^19.3.0",
"@vitejs/plugin-react": "^6.0.2", "@vitejs/plugin-react": "^6.1.1",
"eslint": "^9.39.4", "globals": "^17.12.0",
"eslint-plugin-react": "^7.37.5", "oxlint": "^1.82.0",
"eslint-plugin-react-hooks": "^7.1.1", "prettier": "^3.9.6",
"eslint-plugin-react-refresh": "^0.5.2",
"globals": "^17.6.0",
"prettier": "^3.8.3",
"typescript": "~6.0.3", "typescript": "~6.0.3",
"typescript-eslint": "^8.60.0", "vite": "^8.3.0"
"vite": "^8.0.15"
} }
} }
+634 -2593
View File
File diff suppressed because it is too large. Load diff
-1
View File
@@ -1 +0,0 @@
import "./dayjs"
@@ -3,4 +3,4 @@ import duration from "dayjs/plugin/duration"
dayjs.extend(duration) dayjs.extend(duration)
console.log("Global Dayjs plugins initialised.") export default dayjs
-1
View File
@@ -3,7 +3,6 @@ import { createRoot } from "react-dom/client"
import { Provider as ReduxProvider } from "react-redux" import { Provider as ReduxProvider } from "react-redux"
import { PersistGate } from "redux-persist/integration/react" import { PersistGate } from "redux-persist/integration/react"
import { RouterProvider } from "react-router-dom" import { RouterProvider } from "react-router-dom"
import "@/init"
import store, { persistor } from "@/store" import store, { persistor } from "@/store"
import router from "@/router" import router from "@/router"
import "./index.css" import "./index.css"
+61 -32
View File
@@ -1,10 +1,10 @@
import React from "react" import type { SubmitEvent } from "react"
/** /**
* Contact page component that displays contact information and a contact form. * Contact page component that displays contact information and a contact form.
*/ */
export default function Contact() { export default function Contact() {
const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => { const handleSubmit = (e: SubmitEvent) => {
e.preventDefault() e.preventDefault()
// Handle form submission logic here // Handle form submission logic here
alert("Thank you for your message! This is a demo form.") alert("Thank you for your message! This is a demo form.")
@@ -14,9 +14,7 @@ export default function Contact() {
<div className="space-y-8"> <div className="space-y-8">
{/* Page Header */} {/* Page Header */}
<div className="text-center"> <div className="text-center">
<h1 className="text-3xl font-bold text-gray-900 sm:text-4xl"> <h1 className="text-3xl font-bold text-gray-900 sm:text-4xl">Get in Touch</h1>
Get in Touch
</h1>
<p className="mt-4 text-lg text-gray-600"> <p className="mt-4 text-lg text-gray-600">
Have questions about this template? We&apos;d love to hear from you. Have questions about this template? We&apos;d love to hear from you.
</p> </p>
@@ -25,16 +23,23 @@ export default function Contact() {
<div className="grid grid-cols-1 lg:grid-cols-2 gap-8"> <div className="grid grid-cols-1 lg:grid-cols-2 gap-8">
{/* Contact Information */} {/* Contact Information */}
<div className="bg-white shadow rounded-lg p-6"> <div className="bg-white shadow rounded-lg p-6">
<h2 className="text-xl font-semibold text-gray-900 mb-6"> <h2 className="text-xl font-semibold text-gray-900 mb-6">Contact Information</h2>
Contact Information
</h2>
<div className="space-y-4"> <div className="space-y-4">
{/* Email */} {/* Email */}
<div className="flex items-center"> <div className="flex items-center">
<div className="flex-shrink-0"> <div className="shrink-0">
<svg className="h-6 w-6 text-gray-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> <svg
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M3 8l7.89 4.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" /> className="h-6 w-6 text-gray-400"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor">
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={2}
d="M3 8l7.89 4.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"
/>
</svg> </svg>
</div> </div>
<div className="ml-3"> <div className="ml-3">
@@ -45,22 +50,37 @@ export default function Contact() {
{/* GitHub */} {/* GitHub */}
<div className="flex items-center"> <div className="flex items-center">
<div className="flex-shrink-0"> <div className="shrink-0">
<svg className="h-6 w-6 text-gray-400" fill="currentColor" viewBox="0 0 24 24"> <svg className="h-6 w-6 text-gray-400" fill="currentColor" viewBox="0 0 24 24">
<path fillRule="evenodd" d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" clipRule="evenodd" /> <path
fillRule="evenodd"
d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z"
clipRule="evenodd"
/>
</svg> </svg>
</div> </div>
<div className="ml-3"> <div className="ml-3">
<p className="text-sm font-medium text-gray-900"><a href="https://github.com/onixbyte/react-template">GitHub</a></p> <p className="text-sm font-medium text-gray-900">
<a href="https://github.com/onixbyte/react-template">GitHub</a>
</p>
<p className="text-sm text-gray-600">github.com/onixbyte/react-template</p> <p className="text-sm text-gray-600">github.com/onixbyte/react-template</p>
</div> </div>
</div> </div>
{/* Documentation */} {/* Documentation */}
<div className="flex items-center"> <div className="flex items-center">
<div className="flex-shrink-0"> <div className="shrink-0">
<svg className="h-6 w-6 text-gray-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> <svg
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" /> className="h-6 w-6 text-gray-400"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor">
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={2}
d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"
/>
</svg> </svg>
</div> </div>
<div className="ml-3"> <div className="ml-3">
@@ -74,13 +94,25 @@ export default function Contact() {
<div className="mt-8"> <div className="mt-8">
<h3 className="text-lg font-medium text-gray-900 mb-4">Quick Links</h3> <h3 className="text-lg font-medium text-gray-900 mb-4">Quick Links</h3>
<div className="space-y-2"> <div className="space-y-2">
<a href="https://reactrouter.com" target="_blank" rel="noopener noreferrer" className="block text-blue-600 hover:text-blue-800 text-sm"> <a
href="https://reactrouter.com"
target="_blank"
rel="noopener noreferrer"
className="block text-blue-600 hover:text-blue-800 text-sm">
React Router Documentation → React Router Documentation →
</a> </a>
<a href="https://tailwindcss.com" target="_blank" rel="noopener noreferrer" className="block text-blue-600 hover:text-blue-800 text-sm"> <a
href="https://tailwindcss.com"
target="_blank"
rel="noopener noreferrer"
className="block text-blue-600 hover:text-blue-800 text-sm">
Tailwind CSS Documentation → Tailwind CSS Documentation →
</a> </a>
<a href="https://vitejs.dev" target="_blank" rel="noopener noreferrer" className="block text-blue-600 hover:text-blue-800 text-sm"> <a
href="https://vitejs.dev"
target="_blank"
rel="noopener noreferrer"
className="block text-blue-600 hover:text-blue-800 text-sm">
Vite Documentation → Vite Documentation →
</a> </a>
</div> </div>
@@ -89,10 +121,8 @@ export default function Contact() {
{/* Contact Form */} {/* Contact Form */}
<div className="bg-white shadow rounded-lg p-6"> <div className="bg-white shadow rounded-lg p-6">
<h2 className="text-xl font-semibold text-gray-900 mb-6"> <h2 className="text-xl font-semibold text-gray-900 mb-6">Send us a Message</h2>
Send us a Message
</h2>
<form onSubmit={handleSubmit} className="space-y-4"> <form onSubmit={handleSubmit} className="space-y-4">
{/* Name */} {/* Name */}
<div> <div>
@@ -104,7 +134,7 @@ export default function Contact() {
id="name" id="name"
name="name" name="name"
required required
className="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500" className="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500"
placeholder="Your full name" placeholder="Your full name"
/> />
</div> </div>
@@ -119,7 +149,7 @@ export default function Contact() {
id="email" id="email"
name="email" name="email"
required required
className="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500" className="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500"
placeholder="your.email@example.com" placeholder="your.email@example.com"
/> />
</div> </div>
@@ -134,7 +164,7 @@ export default function Contact() {
id="subject" id="subject"
name="subject" name="subject"
required required
className="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500" className="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500"
placeholder="What is this about?" placeholder="What is this about?"
/> />
</div> </div>
@@ -149,7 +179,7 @@ export default function Contact() {
name="message" name="message"
rows={4} rows={4}
required required
className="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500" className="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500"
placeholder="Tell us more about your question or feedback..." placeholder="Tell us more about your question or feedback..."
/> />
</div> </div>
@@ -158,8 +188,7 @@ export default function Contact() {
<div> <div>
<button <button
type="submit" type="submit"
className="w-full flex justify-center py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500" className="w-full flex justify-center py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500">
>
Send Message Send Message
</button> </button>
</div> </div>
@@ -168,4 +197,4 @@ export default function Contact() {
</div> </div>
</div> </div>
) )
} }