dolittle / TypeScript.Build

Holds common building blocks for building TypeScript applications and libraries
MIT License
0 stars 1 forks source link

Create custom rules for Eslint around ConceptAs #32

Open woksin opened 4 years ago

jakhog commented 4 years ago

See https://eslint.org/docs/developer-guide/working-with-rules

jakhog commented 4 years ago

We should have rules that:

  1. Checks that the second parameter to a ConceptAs<,> definition is a string, with the same value as the name of the type. So, type ReasonId = ConceptAs<Guid, 'ReasonId'> is valid, but type ReasonId = ConceptAs<Guid, 'FilterId'> or type ReasonId = ConceptAs<Guid, 2> is not.
  2. Checks that ConceptAs<,> types should not be used on either sign of an equality comparison === == != !== (and possibly others).
  3. Checks that ConceptAs<,> types are not used as parameters in Map<,> and Set<> (and possibly others).