TypL
TypL copied to clipboard
The Type Linter for JS
* Object literals' type assignments to properties * Persistent object type signatures and array type signatures * Destructuring assignments need to be shape checked * Enforce param destructuring shape for...
- [x] Narrower number type inference #17 (requires #6 too) - [x] Enforce `bool` check on `if`, `while`, and `do..while` #7 - [ ] Persistent object/array type shapes #18 -...
```js function foo(v) { return v; } var x = foo(2); x = "hello"; // error: expected 'int' but found 'string' ```
Assert on which specific errors (by ID) are expected. We'd need to expose the MSG.* constants for use by the test assertions, so that as the numbers get re-assigned it...
Pass in various code snippets, verify the error messages produced.
There's nothing to do for this issue... I just want to document this quirk somewhere. ```js var x; foo(x); x = 3; foo(x); function foo(a = number) {} ``` Think...
`check(..)` should return an object with the error/info messages, as well as a `transform()` method on it that will do the transformation of the runtime-assertion bits of the code.
Support basic JSON configs for disabling certain errors
Keeping notes of TODOs for TypVal. This list will be updated as progress occurs. * Embedded External Annotations: allow annotating types/signatures for external ```js "#extern foo" < int; var x...
Type exceptions: allow more fine-grained control over which errors you see. For example: ```js var x = 42; var y = "foo"; var z = [1,2,3]; if (x) { .....