Explorar o código

feat: add tsgolint

xingyu4j hai 3 meses
pai
achega
68cde54bad

+ 0 - 1
apps/web-antd/tsconfig.json

@@ -2,7 +2,6 @@
   "$schema": "https://json.schemastore.org/tsconfig",
   "extends": "@vben/tsconfig/web-app.json",
   "compilerOptions": {
-    "baseUrl": ".",
     "paths": {
       "#/*": ["./src/*"]
     }

+ 0 - 1
apps/web-antdv-next/tsconfig.json

@@ -2,7 +2,6 @@
   "$schema": "https://json.schemastore.org/tsconfig",
   "extends": "@vben/tsconfig/web-app.json",
   "compilerOptions": {
-    "baseUrl": ".",
     "paths": {
       "#/*": ["./src/*"]
     }

+ 0 - 1
apps/web-ele/tsconfig.json

@@ -2,7 +2,6 @@
   "$schema": "https://json.schemastore.org/tsconfig",
   "extends": "@vben/tsconfig/web-app.json",
   "compilerOptions": {
-    "baseUrl": ".",
     "paths": {
       "#/*": ["./src/*"]
     }

+ 0 - 1
apps/web-naive/tsconfig.json

@@ -2,7 +2,6 @@
   "$schema": "https://json.schemastore.org/tsconfig",
   "extends": "@vben/tsconfig/web-app.json",
   "compilerOptions": {
-    "baseUrl": ".",
     "paths": {
       "#/*": ["./src/*"]
     }

+ 0 - 1
apps/web-tdesign/tsconfig.json

@@ -2,7 +2,6 @@
   "$schema": "https://json.schemastore.org/tsconfig",
   "extends": "@vben/tsconfig/web-app.json",
   "compilerOptions": {
-    "baseUrl": ".",
     "paths": {
       "#/*": ["./src/*"]
     }

+ 2 - 1
cspell.json

@@ -4,7 +4,6 @@
   "language": "en,en-US",
   "allowCompoundWords": true,
   "words": [
-    "Turborepo",
     "acmr",
     "antd",
     "antdv",
@@ -59,6 +58,8 @@
     "tabler",
     "taze",
     "tdesign",
+    "tsgolint",
+    "Turborepo",
     "ui-kit",
     "uicons",
     "unplugin",

+ 0 - 1
docs/tsconfig.json

@@ -2,7 +2,6 @@
   "$schema": "https://json.schemastore.org/tsconfig",
   "extends": "@vben/tsconfig/web.json",
   "compilerOptions": {
-    "baseUrl": ".",
     "paths": {
       "#/*": ["./src/_env/*"]
     }

+ 16 - 0
internal/lint-configs/oxlint-config/src/configs/typescript.ts

@@ -3,9 +3,25 @@ import type { OxlintConfig } from 'oxlint';
 const typescript: OxlintConfig = {
   rules: {
     'typescript/ban-ts-comment': 'error',
+    // Keep the first type-aware rollout conservative. These rules currently
+    // produce high-volume diagnostics and need file-by-file cleanup later.
+    'typescript/await-thenable': 'off',
+    'typescript/no-base-to-string': 'off',
+    'typescript/no-duplicate-type-constituents': 'off',
+    'typescript/no-floating-promises': 'off',
+    'typescript/no-misused-spread': 'off',
     'typescript/no-non-null-assertion': 'error',
+    'typescript/no-redundant-type-constituents': 'off',
+    'typescript/no-unnecessary-boolean-literal-compare': 'off',
+    'typescript/no-unnecessary-type-assertion': 'off',
+    'typescript/no-unnecessary-type-arguments': 'off',
+    'typescript/no-unnecessary-template-expression': 'off',
+    'typescript/no-unsafe-enum-comparison': 'off',
+    'typescript/no-unsafe-type-assertion': 'off',
     'typescript/no-var-requires': 'error',
+    'typescript/restrict-template-expressions': 'off',
     'typescript/triple-slash-reference': 'error',
+    'typescript/unbound-method': 'off',
   },
 };
 

+ 0 - 1
internal/tsconfig/base.json

@@ -8,7 +8,6 @@
     "moduleDetection": "force",
     "experimentalDecorators": true,
 
-    "baseUrl": ".",
     "module": "ESNext",
 
     "moduleResolution": "node",

+ 0 - 1
internal/tsconfig/node.json

@@ -5,7 +5,6 @@
   "compilerOptions": {
     "composite": false,
     "lib": ["ESNext"],
-    "baseUrl": "./",
     "moduleResolution": "bundler",
     "types": ["node"],
     "noImplicitAny": true

+ 5 - 0
package.json

@@ -52,6 +52,10 @@
     "dev:play": "pnpm -F @vben/playground run dev",
     "format": "vsh lint --format",
     "lint": "vsh lint",
+    "lint:eslint": "eslint . --cache",
+    "lint:oxc": "oxlint .",
+    "lint:oxc:type-aware": "oxlint . --type-aware",
+    "lint:style": "stylelint \"**/*.{vue,css,less,scss}\" --cache",
     "postinstall": "pnpm -r run stub --if-present",
     "preinstall": "npx only-allow pnpm",
     "preview": "turbo-run preview",
@@ -87,6 +91,7 @@
     "lefthook": "catalog:",
     "oxfmt": "catalog:",
     "oxlint": "catalog:",
+    "oxlint-tsgolint": "^0.16.0",
     "playwright": "catalog:",
     "rimraf": "catalog:",
     "tailwindcss": "catalog:",

+ 0 - 1
packages/@core/ui-kit/shadcn-ui/tsconfig.json

@@ -2,7 +2,6 @@
   "$schema": "https://json.schemastore.org/tsconfig",
   "extends": "@vben/tsconfig/web.json",
   "compilerOptions": {
-    "baseUrl": ".",
     "paths": {
       "@vben-core/shadcn-ui/*": ["./src/*"]
     }

+ 0 - 1
playground/tsconfig.json

@@ -2,7 +2,6 @@
   "$schema": "https://json.schemastore.org/tsconfig",
   "extends": "@vben/tsconfig/web-app.json",
   "compilerOptions": {
-    "baseUrl": ".",
     "paths": {
       "#/*": ["./src/*"]
     }

+ 78 - 10
pnpm-lock.yaml

@@ -567,7 +567,10 @@ importers:
         version: 0.40.0
       oxlint:
         specifier: 'catalog:'
-        version: 1.55.0
+        version: 1.55.0(oxlint-tsgolint@0.16.0)
+      oxlint-tsgolint:
+        specifier: ^0.16.0
+        version: 0.16.0
       playwright:
         specifier: 'catalog:'
         version: 1.58.2
@@ -1084,10 +1087,10 @@ importers:
     dependencies:
       eslint-plugin-better-tailwindcss:
         specifier: 'catalog:'
-        version: 4.3.2(eslint@10.0.3(jiti@2.6.1))(oxlint@1.55.0)(tailwindcss@4.2.1)(typescript@5.9.3)
+        version: 4.3.2(eslint@10.0.3(jiti@2.6.1))(oxlint@1.55.0(oxlint-tsgolint@0.16.0))(tailwindcss@4.2.1)(typescript@5.9.3)
       oxlint:
         specifier: 'catalog:'
-        version: 1.55.0
+        version: 1.55.0(oxlint-tsgolint@0.16.0)
 
   internal/lint-configs/stylelint-config:
     dependencies:
@@ -1633,6 +1636,9 @@ importers:
         specifier: 'catalog:'
         version: 6.7.1(vue@3.5.30(typescript@5.9.3))
     devDependencies:
+      '@types/json-bigint':
+        specifier: 'catalog:'
+        version: 1.0.4
       '@types/qrcode':
         specifier: 'catalog:'
         version: 1.5.6
@@ -3833,6 +3839,36 @@ packages:
     cpu: [x64]
     os: [win32]
 
+  '@oxlint-tsgolint/darwin-arm64@0.16.0':
+    resolution: {integrity: sha512-WQt5lGwRPJBw7q2KNR0mSPDAaMmZmVvDlEEti96xLO7ONhyomQc6fBZxxwZ4qTFedjJnrHX94sFelZ4OKzS7UQ==}
+    cpu: [arm64]
+    os: [darwin]
+
+  '@oxlint-tsgolint/darwin-x64@0.16.0':
+    resolution: {integrity: sha512-VJo29XOzdkalvCTiE2v6FU3qZlgHaM8x8hUEVJGPU2i5W+FlocPpmn00+Ld2n7Q0pqIjyD5EyvZ5UmoIEJMfqg==}
+    cpu: [x64]
+    os: [darwin]
+
+  '@oxlint-tsgolint/linux-arm64@0.16.0':
+    resolution: {integrity: sha512-MPfqRt1+XRHv9oHomcBMQ3KpTE+CSkZz14wUxDQoqTNdUlV0HWdzwIE9q65I3D9YyxEnqpM7j4qtDQ3apqVvbQ==}
+    cpu: [arm64]
+    os: [linux]
+
+  '@oxlint-tsgolint/linux-x64@0.16.0':
+    resolution: {integrity: sha512-XQSwVUsnwLokMhe1TD6IjgvW5WMTPzOGGkdFDtXWQmlN2YeTw94s/NN0KgDrn2agM1WIgAenEkvnm0u7NgwEyw==}
+    cpu: [x64]
+    os: [linux]
+
+  '@oxlint-tsgolint/win32-arm64@0.16.0':
+    resolution: {integrity: sha512-EWdlspQiiFGsP2AiCYdhg5dTYyAlj6y1nRyNI2dQWq4Q/LITFHiSRVPe+7m7K7lcsZCEz2icN/bCeSkZaORqIg==}
+    cpu: [arm64]
+    os: [win32]
+
+  '@oxlint-tsgolint/win32-x64@0.16.0':
+    resolution: {integrity: sha512-1ufk8cgktXJuJZHKF63zCHAkaLMwZrEXnZ89H2y6NO85PtOXqu4zbdNl0VBpPP3fCUuUBu9RvNqMFiv0VsbXWA==}
+    cpu: [x64]
+    os: [win32]
+
   '@oxlint/binding-android-arm-eabi@1.55.0':
     resolution: {integrity: sha512-NhvgAhncTSOhRahQSCnkK/4YIGPjTmhPurQQ2dwt2IvwCMTvZRW5vF2K10UBOxFve4GZDMw6LtXZdC2qeuYIVQ==}
     engines: {node: ^20.19.0 || >=22.12.0}
@@ -8638,6 +8674,10 @@ packages:
     engines: {node: ^20.19.0 || >=22.12.0}
     hasBin: true
 
+  oxlint-tsgolint@0.16.0:
+    resolution: {integrity: sha512-4RuJK2jP08XwqtUu+5yhCbxEauCm6tv2MFHKEMsjbosK2+vy5us82oI3VLuHwbNyZG7ekZA26U2LLHnGR4frIA==}
+    hasBin: true
+
   oxlint@1.55.0:
     resolution: {integrity: sha512-T+FjepiyWpaZMhekqRpH8Z3I4vNM610p6w+Vjfqgj5TZUxHXl7N8N5IPvmOU8U4XdTRxqtNNTh9Y4hLtr7yvFg==}
     engines: {node: ^20.19.0 || >=22.12.0}
@@ -10266,8 +10306,8 @@ packages:
   undici-types@7.18.2:
     resolution: {integrity: sha512-AsuCzffGHJybSaRrmr5eHr81mwJU3kjw6M+uprWvCXiNeN9SOGwQ3Jn8jb8m3Z6izVgknn1R0FTCEAP2QrLY/w==}
 
-  undici@7.24.0:
-    resolution: {integrity: sha512-jxytwMHhsbdpBXxLAcuu0fzlQeXCNnWdDyRHpvWsUl8vd98UwYdl9YTyn8/HcpcJPC3pwUveefsa3zTxyD/ERg==}
+  undici@7.24.1:
+    resolution: {integrity: sha512-5xoBibbmnjlcR3jdqtY2Lnx7WbrD/tHlT01TmvqZUFVc9Q1w4+j5hbnapTqbcXITMH1ovjq/W7BkqBilHiVAaA==}
     engines: {node: '>=20.18.1'}
 
   unenv@2.0.0-rc.24:
@@ -13196,6 +13236,24 @@ snapshots:
   '@oxfmt/binding-win32-x64-msvc@0.40.0':
     optional: true
 
+  '@oxlint-tsgolint/darwin-arm64@0.16.0':
+    optional: true
+
+  '@oxlint-tsgolint/darwin-x64@0.16.0':
+    optional: true
+
+  '@oxlint-tsgolint/linux-arm64@0.16.0':
+    optional: true
+
+  '@oxlint-tsgolint/linux-x64@0.16.0':
+    optional: true
+
+  '@oxlint-tsgolint/win32-arm64@0.16.0':
+    optional: true
+
+  '@oxlint-tsgolint/win32-x64@0.16.0':
+    optional: true
+
   '@oxlint/binding-android-arm-eabi@1.55.0':
     optional: true
 
@@ -15280,7 +15338,7 @@ snapshots:
       parse5: 7.3.0
       parse5-htmlparser2-tree-adapter: 7.1.0
       parse5-parser-stream: 7.1.2
-      undici: 7.24.0
+      undici: 7.24.1
       whatwg-mimetype: 4.0.0
 
   chokidar@4.0.3:
@@ -16207,7 +16265,7 @@ snapshots:
       esquery: 1.7.0
       jsonc-eslint-parser: 3.1.0
 
-  eslint-plugin-better-tailwindcss@4.3.2(eslint@10.0.3(jiti@2.6.1))(oxlint@1.55.0)(tailwindcss@4.2.1)(typescript@5.9.3):
+  eslint-plugin-better-tailwindcss@4.3.2(eslint@10.0.3(jiti@2.6.1))(oxlint@1.55.0(oxlint-tsgolint@0.16.0))(tailwindcss@4.2.1)(typescript@5.9.3):
     dependencies:
       '@eslint/css-tree': 3.6.9
       '@valibot/to-json-schema': 1.5.0(valibot@1.2.0(typescript@5.9.3))
@@ -16220,7 +16278,7 @@ snapshots:
       valibot: 1.2.0(typescript@5.9.3)
     optionalDependencies:
       eslint: 10.0.3(jiti@2.6.1)
-      oxlint: 1.55.0
+      oxlint: 1.55.0(oxlint-tsgolint@0.16.0)
     transitivePeerDependencies:
       - typescript
 
@@ -18284,7 +18342,16 @@ snapshots:
       '@oxfmt/binding-win32-ia32-msvc': 0.40.0
       '@oxfmt/binding-win32-x64-msvc': 0.40.0
 
-  oxlint@1.55.0:
+  oxlint-tsgolint@0.16.0:
+    optionalDependencies:
+      '@oxlint-tsgolint/darwin-arm64': 0.16.0
+      '@oxlint-tsgolint/darwin-x64': 0.16.0
+      '@oxlint-tsgolint/linux-arm64': 0.16.0
+      '@oxlint-tsgolint/linux-x64': 0.16.0
+      '@oxlint-tsgolint/win32-arm64': 0.16.0
+      '@oxlint-tsgolint/win32-x64': 0.16.0
+
+  oxlint@1.55.0(oxlint-tsgolint@0.16.0):
     optionalDependencies:
       '@oxlint/binding-android-arm-eabi': 1.55.0
       '@oxlint/binding-android-arm64': 1.55.0
@@ -18305,6 +18372,7 @@ snapshots:
       '@oxlint/binding-win32-arm64-msvc': 1.55.0
       '@oxlint/binding-win32-ia32-msvc': 1.55.0
       '@oxlint/binding-win32-x64-msvc': 1.55.0
+      oxlint-tsgolint: 0.16.0
 
   p-filter@2.1.0:
     dependencies:
@@ -20001,7 +20069,7 @@ snapshots:
 
   undici-types@7.18.2: {}
 
-  undici@7.24.0: {}
+  undici@7.24.1: {}
 
   unenv@2.0.0-rc.24:
     dependencies: