wit-bindgen icon indicating copy to clipboard operation
wit-bindgen copied to clipboard

WIT linting

Open lann opened this issue 5 months ago • 2 comments

While discussing the design of WIT it has occasionally been suggested that certain things should be discouraged without being forbidden. Some examples:

  • Referencing a @deprecated type
  • Using deprecated WIT features
  • Common reserved keywords as labels (new, yield, assert, etc.) which can require awkward and confusing name mangling in some language bindings
  • Patterns that are expected to conflict with future features, like (proposed) resource properties

This could be handled by a linting tool, which might look like:

  • A new wit-bindgen lint subcommand
  • Some mechanism to suppress specific lints, like a new WIT annotation e.g. @allow(common-reserved-labels)

lann avatar Jun 07 '25 18:06 lann

would this be appropriate for wasm-tools?

jsturtevant avatar Jun 10 '25 21:06 jsturtevant

Sure, as far I'm concerned! The split between wasm-tools and wit-bindgen seems pretty arbitrary anyway.

lann avatar Jun 10 '25 21:06 lann