jumpinjackie / jsdoc-typescript-plugin

Experimental JSDoc plugin to generate TypeScript definition files (.d.ts) from JSDoc-annotated source
34 stars 7 forks source link

Apply Readonly<> to interfaces where the usage of it is clearly read-only #81

Closed jumpinjackie closed 7 years ago

jumpinjackie commented 7 years ago

TypeScript 2.1 introduces a Readonly<T> built-in type that effectively makes an immutable version of T that can be accessed and used as though it were a variable of type T

This should be applied to all usages of jsdoc.IDoclet (except for the typedef rewriting) and any other interfaces we use where it's clear that its properties are only meant to be read from and never written to.

This would've caught (and prevented) that unintentional doclet modification that slipped into #77