Skip to content

Built-in linter system #1785

Description

Bring this back on the table. We are currently using @typespec/linter a library to make linter rules that plug in the onValidate step of the typescript compilation.

The problem with this approach:

  • getting issue when libraries get loaded twice(e.g. different version loaded in emitter jscode and typespec import)
  • not very clean to enable rules provided by another library

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

#enable no-inline-models warn
#disable no-unions

this could even be the way libraries decide which rules they enable themself.

Other related issues

Proposal https://gist.github.com/timotheeguerin/9d665c82f89d3a07a406a8928fb1e2bd

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

design:neededA design request has been raised that needs a proposal

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions