Browse Source

feat: add tsgolint

pull/7645/head
xingyu4j 1 week ago
parent
commit
68cde54bad
  1. 1
      apps/web-antd/tsconfig.json
  2. 1
      apps/web-antdv-next/tsconfig.json
  3. 1
      apps/web-ele/tsconfig.json
  4. 1
      apps/web-naive/tsconfig.json
  5. 1
      apps/web-tdesign/tsconfig.json
  6. 3
      cspell.json
  7. 1
      docs/tsconfig.json
  8. 16
      internal/lint-configs/oxlint-config/src/configs/typescript.ts
  9. 1
      internal/tsconfig/base.json
  10. 1
      internal/tsconfig/node.json
  11. 5
      package.json
  12. 1
      packages/@core/ui-kit/shadcn-ui/tsconfig.json
  13. 1
      playground/tsconfig.json
  14. 88
      pnpm-lock.yaml

1
apps/web-antd/tsconfig.json

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

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

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

1
apps/web-ele/tsconfig.json

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

1
apps/web-naive/tsconfig.json

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

1
apps/web-tdesign/tsconfig.json

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

3
cspell.json

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

1
docs/tsconfig.json

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

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

@ -3,9 +3,25 @@ import type { OxlintConfig } from 'oxlint';
const typescript: OxlintConfig = { const typescript: OxlintConfig = {
rules: { rules: {
'typescript/ban-ts-comment': 'error', '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-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/no-var-requires': 'error',
'typescript/restrict-template-expressions': 'off',
'typescript/triple-slash-reference': 'error', 'typescript/triple-slash-reference': 'error',
'typescript/unbound-method': 'off',
}, },
}; };

1
internal/tsconfig/base.json

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

1
internal/tsconfig/node.json

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

5
package.json

@ -52,6 +52,10 @@
"dev:play": "pnpm -F @vben/playground run dev", "dev:play": "pnpm -F @vben/playground run dev",
"format": "vsh lint --format", "format": "vsh lint --format",
"lint": "vsh lint", "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", "postinstall": "pnpm -r run stub --if-present",
"preinstall": "npx only-allow pnpm", "preinstall": "npx only-allow pnpm",
"preview": "turbo-run preview", "preview": "turbo-run preview",
@ -87,6 +91,7 @@
"lefthook": "catalog:", "lefthook": "catalog:",
"oxfmt": "catalog:", "oxfmt": "catalog:",
"oxlint": "catalog:", "oxlint": "catalog:",
"oxlint-tsgolint": "^0.16.0",
"playwright": "catalog:", "playwright": "catalog:",
"rimraf": "catalog:", "rimraf": "catalog:",
"tailwindcss": "catalog:", "tailwindcss": "catalog:",

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

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

1
playground/tsconfig.json

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

88
pnpm-lock.yaml

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

Loading…
Cancel
Save