mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2026-06-23 04:10:17 +00:00
chore(lint): enable TypeScript linting in frontend
oxlint now includes support for TypeScript-aware linting by using the oxlint-tsgolint package. While this increases the chance of finding bugs early, it requires a few changes to the TypeScript configuration, especially the explicit declaration of CSS imports and changing the moduleResolution to bundler mode. Signed-off-by: Erik Michelson <github@erik.michelson.eu>
This commit is contained in:
committed by
Philip Molares
parent
9558c5d50d
commit
faaea84a73
@@ -25,5 +25,10 @@
|
||||
"env": {
|
||||
"browser": true,
|
||||
"jest": true
|
||||
},
|
||||
"options": {
|
||||
"typeAware": true,
|
||||
"typeCheck": true,
|
||||
"maxWarnings": 0
|
||||
}
|
||||
}
|
||||
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2026 The HedgeDoc developers (see AUTHORS file)
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
declare module '*.css'
|
||||
declare module '*.scss'
|
||||
|
||||
declare module '*.module.css' {
|
||||
const classes: Record<string, string>
|
||||
export default classes
|
||||
}
|
||||
|
||||
declare module '*.module.scss' {
|
||||
const classes: Record<string, string>
|
||||
export default classes
|
||||
}
|
||||
@@ -13,7 +13,7 @@
|
||||
"noEmit": true,
|
||||
"esModuleInterop": true,
|
||||
"module": "esnext",
|
||||
"moduleResolution": "node",
|
||||
"moduleResolution": "bundler",
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"jsx": "preserve",
|
||||
@@ -30,6 +30,7 @@
|
||||
]
|
||||
},
|
||||
"include": [
|
||||
"src/external-types/css/index.d.ts",
|
||||
"src/external-types/images/index.d.ts",
|
||||
"next-env.d.ts",
|
||||
"**/*.ts",
|
||||
|
||||
+2
-1
@@ -48,7 +48,8 @@
|
||||
"devDependencies": {
|
||||
"dotenv-cli": "11.0.0",
|
||||
"oxfmt": "0.23.0",
|
||||
"oxlint": "1.38.0",
|
||||
"oxlint": "1.63.0",
|
||||
"oxlint-tsgolint": "0.22.1",
|
||||
"turbo": "2.8.13"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4730,6 +4730,48 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@oxlint-tsgolint/darwin-arm64@npm:0.22.1":
|
||||
version: 0.22.1
|
||||
resolution: "@oxlint-tsgolint/darwin-arm64@npm:0.22.1"
|
||||
conditions: os=darwin & cpu=arm64
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@oxlint-tsgolint/darwin-x64@npm:0.22.1":
|
||||
version: 0.22.1
|
||||
resolution: "@oxlint-tsgolint/darwin-x64@npm:0.22.1"
|
||||
conditions: os=darwin & cpu=x64
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@oxlint-tsgolint/linux-arm64@npm:0.22.1":
|
||||
version: 0.22.1
|
||||
resolution: "@oxlint-tsgolint/linux-arm64@npm:0.22.1"
|
||||
conditions: os=linux & cpu=arm64
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@oxlint-tsgolint/linux-x64@npm:0.22.1":
|
||||
version: 0.22.1
|
||||
resolution: "@oxlint-tsgolint/linux-x64@npm:0.22.1"
|
||||
conditions: os=linux & cpu=x64
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@oxlint-tsgolint/win32-arm64@npm:0.22.1":
|
||||
version: 0.22.1
|
||||
resolution: "@oxlint-tsgolint/win32-arm64@npm:0.22.1"
|
||||
conditions: os=win32 & cpu=arm64
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@oxlint-tsgolint/win32-x64@npm:0.22.1":
|
||||
version: 0.22.1
|
||||
resolution: "@oxlint-tsgolint/win32-x64@npm:0.22.1"
|
||||
conditions: os=win32 & cpu=x64
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@oxlint/darwin-arm64@npm:1.38.0":
|
||||
version: 1.38.0
|
||||
resolution: "@oxlint/darwin-arm64@npm:1.38.0"
|
||||
@@ -10984,6 +11026,7 @@ __metadata:
|
||||
dotenv-cli: "npm:11.0.0"
|
||||
oxfmt: "npm:0.23.0"
|
||||
oxlint: "npm:1.38.0"
|
||||
oxlint-tsgolint: "npm:0.22.1"
|
||||
turbo: "npm:2.8.13"
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
@@ -14327,6 +14370,35 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"oxlint-tsgolint@npm:0.22.1":
|
||||
version: 0.22.1
|
||||
resolution: "oxlint-tsgolint@npm:0.22.1"
|
||||
dependencies:
|
||||
"@oxlint-tsgolint/darwin-arm64": "npm:0.22.1"
|
||||
"@oxlint-tsgolint/darwin-x64": "npm:0.22.1"
|
||||
"@oxlint-tsgolint/linux-arm64": "npm:0.22.1"
|
||||
"@oxlint-tsgolint/linux-x64": "npm:0.22.1"
|
||||
"@oxlint-tsgolint/win32-arm64": "npm:0.22.1"
|
||||
"@oxlint-tsgolint/win32-x64": "npm:0.22.1"
|
||||
dependenciesMeta:
|
||||
"@oxlint-tsgolint/darwin-arm64":
|
||||
optional: true
|
||||
"@oxlint-tsgolint/darwin-x64":
|
||||
optional: true
|
||||
"@oxlint-tsgolint/linux-arm64":
|
||||
optional: true
|
||||
"@oxlint-tsgolint/linux-x64":
|
||||
optional: true
|
||||
"@oxlint-tsgolint/win32-arm64":
|
||||
optional: true
|
||||
"@oxlint-tsgolint/win32-x64":
|
||||
optional: true
|
||||
bin:
|
||||
tsgolint: bin/tsgolint.js
|
||||
checksum: 10c0/1f2e3840993e85ebe73f394e7e7441c1482aa4c7da38408c5887e2635be64a577edc887688c8a5232e9f3c8b963fbcecec93036e5fbf2fb863784175e1336aa4
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"oxlint@npm:1.38.0":
|
||||
version: 1.38.0
|
||||
resolution: "oxlint@npm:1.38.0"
|
||||
|
||||
Reference in New Issue
Block a user