mirror of
https://github.com/Buriburizaem0n/admin-frontend-domain.git
synced 2026-09-19 09:40:13 +00:00
Merge pull request #180 from nezhahq/fix/typescript-7-lint-tooling
fix: restore CI compatibility with TypeScript 7 Co-authored-by: naiba/CloudCode <hi+cloudcode@nai.ba>
This commit is contained in:
@@ -27,6 +27,9 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Run lint
|
||||||
|
run: npm run lint
|
||||||
|
|
||||||
- name: Build frontend
|
- name: Build frontend
|
||||||
run: npm run build
|
run: npm run build
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,86 @@
|
|||||||
|
{
|
||||||
|
"$schema": "./node_modules/oxlint/configuration_schema.json",
|
||||||
|
"categories": {
|
||||||
|
"correctness": "error"
|
||||||
|
},
|
||||||
|
"env": {
|
||||||
|
"browser": true
|
||||||
|
},
|
||||||
|
"ignorePatterns": ["dist"],
|
||||||
|
"plugins": ["eslint", "typescript", "react"],
|
||||||
|
"rules": {
|
||||||
|
"no-case-declarations": "error",
|
||||||
|
"no-empty": "error",
|
||||||
|
"no-fallthrough": "error",
|
||||||
|
"no-prototype-builtins": "error",
|
||||||
|
"no-regex-spaces": "error",
|
||||||
|
"no-unexpected-multiline": "error",
|
||||||
|
"no-useless-assignment": "error",
|
||||||
|
"preserve-caught-error": "error",
|
||||||
|
"no-array-constructor": "error",
|
||||||
|
"no-var": "error",
|
||||||
|
"prefer-const": "error",
|
||||||
|
"prefer-rest-params": "error",
|
||||||
|
"prefer-spread": "error",
|
||||||
|
"typescript/ban-ts-comment": "error",
|
||||||
|
"typescript/no-empty-object-type": "error",
|
||||||
|
"typescript/no-namespace": "error",
|
||||||
|
"typescript/no-require-imports": "error",
|
||||||
|
"typescript/no-unnecessary-type-constraint": "error",
|
||||||
|
"typescript/no-unsafe-function-type": "error",
|
||||||
|
"react/rules-of-hooks": "error",
|
||||||
|
"react/exhaustive-deps": "warn",
|
||||||
|
"typescript/no-explicit-any": "off",
|
||||||
|
"react/only-export-components": "off",
|
||||||
|
// React Compiler lint stays opt-in until the compiler is adopted.
|
||||||
|
"react/react-compiler": "off"
|
||||||
|
},
|
||||||
|
"overrides": [
|
||||||
|
{
|
||||||
|
"files": [
|
||||||
|
"vite.config.ts",
|
||||||
|
"vitest.config.ts",
|
||||||
|
"playwright.config.ts",
|
||||||
|
"postcss.config.js",
|
||||||
|
"tailwind.config.js"
|
||||||
|
],
|
||||||
|
"env": {
|
||||||
|
"browser": false,
|
||||||
|
"node": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"files": ["src/test/**/*.{ts,tsx}"],
|
||||||
|
"env": {
|
||||||
|
"browser": true,
|
||||||
|
"node": true,
|
||||||
|
"vitest": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"files": ["tests/e2e/**/*.ts"],
|
||||||
|
"env": {
|
||||||
|
"browser": false,
|
||||||
|
"node": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"files": [
|
||||||
|
"src/components/server-config.tsx",
|
||||||
|
"src/components/server-config-batch.tsx",
|
||||||
|
"src/routes/server.tsx"
|
||||||
|
],
|
||||||
|
"rules": {
|
||||||
|
// Existing migration debt remains visible without blocking lint.
|
||||||
|
"no-useless-assignment": "warn"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"files": ["tests/e2e/fixtures.ts"],
|
||||||
|
"rules": {
|
||||||
|
// Playwright fixture callbacks are not React hooks.
|
||||||
|
"react/rules-of-hooks": "off"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
import js from "@eslint/js"
|
|
||||||
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(
|
|
||||||
{ ignores: ["dist"] },
|
|
||||||
{
|
|
||||||
extends: [js.configs.recommended, ...tseslint.configs.recommended],
|
|
||||||
files: ["**/*.{ts,tsx}"],
|
|
||||||
languageOptions: {
|
|
||||||
ecmaVersion: 2020,
|
|
||||||
globals: globals.browser,
|
|
||||||
},
|
|
||||||
plugins: {
|
|
||||||
"react-hooks": reactHooks,
|
|
||||||
"react-refresh": reactRefresh,
|
|
||||||
},
|
|
||||||
rules: {
|
|
||||||
...reactHooks.configs.recommended.rules,
|
|
||||||
"@typescript-eslint/no-explicit-any": "off",
|
|
||||||
"react-refresh/only-export-components": "off",
|
|
||||||
indent: ["error", 4],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
)
|
|
||||||
Generated
+388
-1255
File diff suppressed because it is too large
Load Diff
+3
-8
@@ -7,8 +7,8 @@
|
|||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
"build": "tsc -b && vite build",
|
"build": "tsc -b && vite build",
|
||||||
"build-ignore-error": "vite build",
|
"build-ignore-error": "vite build",
|
||||||
"lint": "eslint .",
|
"lint": "oxlint .",
|
||||||
"lint:fix": "eslint --fix .",
|
"lint:fix": "oxlint --fix .",
|
||||||
"format": "prettier --write .",
|
"format": "prettier --write .",
|
||||||
"test": "vitest run",
|
"test": "vitest run",
|
||||||
"preview": "vite preview",
|
"preview": "vite preview",
|
||||||
@@ -68,7 +68,6 @@
|
|||||||
"zustand": "^5.0.14"
|
"zustand": "^5.0.14"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@eslint/js": "^10.0.1",
|
|
||||||
"@playwright/test": "^1.61.1",
|
"@playwright/test": "^1.61.1",
|
||||||
"@testing-library/dom": "^10.4.1",
|
"@testing-library/dom": "^10.4.1",
|
||||||
"@testing-library/react": "^16.3.2",
|
"@testing-library/react": "^16.3.2",
|
||||||
@@ -77,16 +76,12 @@
|
|||||||
"@types/react-dom": "^19.2.1",
|
"@types/react-dom": "^19.2.1",
|
||||||
"@vitejs/plugin-react": "^6.0.3",
|
"@vitejs/plugin-react": "^6.0.3",
|
||||||
"autoprefixer": "^10.5.4",
|
"autoprefixer": "^10.5.4",
|
||||||
"eslint": "^10.7.0",
|
|
||||||
"eslint-plugin-react-hooks": "^7.1.1",
|
|
||||||
"eslint-plugin-react-refresh": "^0.5.3",
|
|
||||||
"globals": "^17.7.0",
|
|
||||||
"jsdom": "^29.1.1",
|
"jsdom": "^29.1.1",
|
||||||
|
"oxlint": "1.74.0",
|
||||||
"postcss": "8.5.19",
|
"postcss": "8.5.19",
|
||||||
"swagger-typescript-api": "^13.12.6",
|
"swagger-typescript-api": "^13.12.6",
|
||||||
"tailwindcss": "4.3.3",
|
"tailwindcss": "4.3.3",
|
||||||
"typescript": "~7.0.2",
|
"typescript": "~7.0.2",
|
||||||
"typescript-eslint": "^8.64.0",
|
|
||||||
"vite": "^8.1.5",
|
"vite": "^8.1.5",
|
||||||
"vitest": "^4.1.10"
|
"vitest": "^4.1.10"
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"ignoreDeprecations": "6.0",
|
"ignoreDeprecations": "6.0",
|
||||||
"baseUrl": ".",
|
// TypeScript 7 resolves paths relative to this config; baseUrl was removed.
|
||||||
"paths": {
|
"paths": {
|
||||||
"@/*": ["./src/*"]
|
"@/*": ["./src/*"]
|
||||||
},
|
},
|
||||||
|
|||||||
+1
-1
@@ -10,7 +10,7 @@
|
|||||||
],
|
],
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"ignoreDeprecations": "6.0",
|
"ignoreDeprecations": "6.0",
|
||||||
"baseUrl": ".",
|
// TypeScript 7 resolves paths relative to this config; baseUrl was removed.
|
||||||
"paths": {
|
"paths": {
|
||||||
"@/*": ["./src/*"]
|
"@/*": ["./src/*"]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user