Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

Use a separate package for typeguards and other utilities #2180

Closed
ajafff opened this issue Feb 6, 2017 · 1 comment
Closed

Use a separate package for typeguards and other utilities #2180

ajafff opened this issue Feb 6, 2017 · 1 comment

Comments

@ajafff
Copy link
Contributor

ajafff commented Feb 6, 2017

As a followup of #2093 (comment) we want / need to add typeguards to the codebase to keep code readable.

While moving all typeguards to a newly created typeguard.ts I realized, that it is really awkward to use Lint.isStringLiteral etc.
tslint core is not the right place to provide typeguard functions for every rule, even custom rules.

The idea was to create a separate project which maintains typeguards and AST utilities for everyone, not just tslint and custom rules packages. This way tslint core could remain just a runtime for rules instead of growing to a bulk of utility functions.

Now there is this repository: https://github.com/ajafff/tsutils
I haven't released a package on npm yet, because I wanted to get your feedback first.
Of course I can add you and others as collaborators so this can be maintained even if I don't have time.

@nchen63
Copy link
Contributor

nchen63 commented Feb 9, 2017

Sounds like a good idea. Maybe the super node for discriminated unions can go there too if microsoft/TypeScript#13634 isn't implemented

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants