-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider merging the readonly-* rules #10
Comments
readonly-*
rules to readonly
It would probably make more sense to merge |
So we could have a Interface members (including indexers): interface Foo {
readonly bar: string,
readonly [key: string]: string,
} Object type alias members (including indexers): type Foo = {
readonly bar: string,
readonly [key: string]: string,
} Object type literals (including indexers): let foo: { readonly bar: string, readonly [key: string]: string}; Class members (we don't want to support this?) class Circle {
readonly radius: number;
} |
It seems that in all of the above cases, the type of nodes allowing So maybe a check for |
This is the only official mention of where readonly is allowed I can find. It seems to support the theory that readonly is allowed on PropertySignature and IndexSignature nodes:
|
Continued in #31. |
Instead of having separate
readonly-interface
,readonly-indexer
, andreadonly-array
rules we could merge them into one rulereadonly
which could have options forignore-interface
,ignore-indexer
,ignore-array
. This would probably speed things up a bit as we only need to traverse the AST once. Also having fewer rules could be a considered an advantage.The text was updated successfully, but these errors were encountered: