feat(task3): migrate toolchain to oxfmt + oxlint

- Install oxfmt with .oxfmtrc.json (maps Prettier config)
- Install oxlint with oxlint.config.ts (TypeScript + React rules)
- Replace admin ESLint with oxlint
- Remove Prettier integration from server ESLint (keep ESLint for type checking)
- Delete server .prettierrc and admin eslint.config.js
This commit is contained in:
2026-07-02 15:24:29 +08:00
parent b88a3d8580
commit 73dd92e615
10 changed files with 838 additions and 16572 deletions

View File

@@ -1,23 +0,0 @@
import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import tseslint from 'typescript-eslint'
import { defineConfig, globalIgnores } from 'eslint/config'
export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
js.configs.recommended,
tseslint.configs.recommended,
reactHooks.configs.flat.recommended,
reactRefresh.configs.vite,
],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
},
},
])

File diff suppressed because it is too large Load Diff

View File

@@ -6,7 +6,8 @@
"scripts": {
"dev": "vite",
"build": "tsc -b && vite build",
"lint": "eslint .",
"lint": "oxlint --config ../../oxlint.config.ts",
"format": "oxfmt",
"preview": "vite preview"
},
"dependencies": {
@@ -22,17 +23,11 @@
"tslib": "^2.8.1"
},
"devDependencies": {
"@eslint/js": "^9.39.4",
"@types/node": "^24.12.2",
"@types/react": "^19.2.14",
"@types/react-dom": "^19.2.3",
"@vitejs/plugin-react": "^6.0.1",
"eslint": "^9.39.4",
"eslint-plugin-react-hooks": "^7.1.1",
"eslint-plugin-react-refresh": "^0.5.2",
"globals": "^17.5.0",
"typescript": "~6.0.2",
"typescript-eslint": "^8.58.2",
"vite": "^8.0.9"
}
}

View File

@@ -1,6 +1,5 @@
// @ts-check
import eslint from '@eslint/js';
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
import globals from 'globals';
import tseslint from 'typescript-eslint';
@@ -10,7 +9,6 @@ export default tseslint.config(
},
eslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
eslintPluginPrettierRecommended,
{
languageOptions: {
globals: {
@@ -29,7 +27,6 @@ export default tseslint.config(
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-floating-promises': 'warn',
'@typescript-eslint/no-unsafe-argument': 'warn',
"prettier/prettier": ["error", { endOfLine: "auto" }],
},
},
);

File diff suppressed because it is too large Load Diff

View File

@@ -7,7 +7,7 @@
"license": "UNLICENSED",
"scripts": {
"build": "nest build",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"format": "oxfmt",
"start": "nest start",
"start:dev": "nest start --watch",
"start:debug": "nest start --debug --watch",
@@ -59,11 +59,8 @@
"@types/passport-local": "^1.0.38",
"@types/supertest": "^7.0.0",
"eslint": "^9.18.0",
"eslint-config-prettier": "^10.0.1",
"eslint-plugin-prettier": "^5.2.2",
"globals": "^17.0.0",
"jest": "^30.0.0",
"prettier": "^3.4.2",
"source-map-support": "^0.5.21",
"supertest": "^7.0.0",
"ts-jest": "^29.2.5",

16
oxlint.config.ts Normal file
View File

@@ -0,0 +1,16 @@
import type { OxlintConfig } from 'oxlint';
const config: OxlintConfig = {
plugins: ['typescript', 'react', 'import'],
rules: {
'typescript/no-explicit-any': 'off',
'typescript/no-non-null-assertion': 'warn',
},
settings: {
react: {
version: '19.0.0',
},
},
};
export default config;

959
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,10 @@
{
"name": "gongxue-base",
"private": true,
"workspaces": ["apps/*", "packages/*"],
"workspaces": [
"apps/*",
"packages/*"
],
"scripts": {
"dev": "turbo run dev",
"build": "turbo run build",
@@ -10,6 +13,12 @@
"format": "turbo run format",
"typecheck": "turbo run typecheck"
},
"devDependencies": { "turbo": "^2.0.0" },
"dependencies": { "@fission-ai/openspec": "^1.5.0" }
"devDependencies": {
"oxfmt": "^0.57.0",
"oxlint": "^1.72.0",
"turbo": "^2.0.0"
},
"dependencies": {
"@fission-ai/openspec": "^1.5.0"
}
}