Closed timotheeguerin closed 1 year ago
I like this idea a lot.
Items to consider for built-in system:
#enable @typesopec/bestpractices:recommended
or #enable @typesopec/bestpractices:all
Another thing we might want to consider is the scope of a linter rule. Lets say you have 2 services defined in the same spec. Each service is using a different library with different set of rules. We probably want to make sure only the relevant linter rules are enabled per service. This would mean having some kind of scope for where the rules can run.
implementation here https://github.com/microsoft/typespec/issues/1996
Bring this back on the table. We are currently using
@typespec/linter
a library to make linter rules that plug in theonValidate
step of the typescript compilation.The problem with this approach:
Idea with a built-in linter system is that the compiler would be aware of the various linting rules and allow better customization from other libraries and spec author.
Ideas
This is just some idea but could have something like this in a spec
this could even be the way libraries decide which rules they enable themself.
Other related issues
warn
as anerror
Proposal https://gist.github.com/timotheeguerin/9d665c82f89d3a07a406a8928fb1e2bd