mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-02-28 11:14:00 +00:00
TypeScript: Tighten configs to improve type validation
TypeScript considers null and undefined as fine for all variable by default. This patch enables `strictNullChecks`, which should cause errors to be thrown as soon as a variable is null or undefined without having it explicitly decleared for itself.[1] [1]: https://www.typescriptlang.org/docs/handbook/migrating-from-javascript.html#strict-null--undefined-checks Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
This commit is contained in:
parent
d8c424297b
commit
004e2fbcb2
2 changed files with 2 additions and 1 deletions
|
@ -47,7 +47,7 @@ export module NoteUtils {
|
|||
}
|
||||
}
|
||||
|
||||
export function newNote(req: any, res: Response, body: string) {
|
||||
export function newNote(req: any, res: Response, body: string | null) {
|
||||
let owner = null;
|
||||
const noteId = req.params.noteId ? req.params.noteId : null;
|
||||
if (req.isAuthenticated()) {
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
"compilerOptions": {
|
||||
"outDir": "./built",
|
||||
"allowJs": true,
|
||||
"strictNullChecks": true,
|
||||
"target": "es5",
|
||||
"module": "commonjs",
|
||||
"esModuleInterop": true
|
||||
|
|
Loading…
Reference in a new issue