codex-team / codex-team/editor.js

Enable strict mode of TypeScript to prevent `undefined` errors

Open
#1,437 2 comments 3 reactions 0 assignees View on GitHub
important
Dominant language
TypeScript
Stars
31.9k
Forks
2.2k
Avg merge
1d 1h
Merged PRs (30d)
1

Description

I recommend to add `strict: true` in tsconfig.json
https://www.typescriptlang.org/tsconfig#strict

The strict mode checks `undefined` and `null` values.
So, it will prevent some `undefined` errors in the future.

https://github.com/codex-team/editor.js/issues/1405
https://github.com/codex-team/editor.js/issues/1403
https://github.com/codex-team/editor.js/issues/1179

Currently, strict mode throws 396 errors.

```
$ yarn tsc --noEmit
(... Error dumps ...)
Found 396 errors.
```

But, webpack can build by `transpileonly` option in ts-loader .
https://github.com/TypeStrong/ts-loader#transpileonly

Would you enable strict mode to prevent `undefined` errors in the future?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.