vize_canon

Crates.iovize_canon
lib.rsvize_canon
version0.0.1-alpha.31
created_at2026-01-11 16:48:02.499065+00
updated_at2026-01-12 12:43:52.09086+00
descriptionCanon - The standard of correctness for Vize type checking
homepage
repositoryhttps://github.com/ubugeeei/vize
max_upload_size
id2036088
size58,649
ubugeeei (ubugeeei)

documentation

README

vize_canon logo

vize_canon

The Canon - TypeScript type checking for Vue SFCs


Name Origin

Canon (/ˈkænən/) in art refers to a set of ideal proportions or standards that define aesthetic perfection. Ancient Greek sculptors like Polykleitos established the "Canon" - mathematical ratios for the ideal human figure that became the standard for classical sculpture.

In the art world, a canon:

  • Defines standards - Establishes rules for correctness
  • Measures perfection - Evaluates against ideal proportions
  • Guides creation - Ensures harmony and balance

Similarly, vize_canon provides:

  • Type checking - Validates TypeScript types in Vue SFCs
  • Error detection - Identifies type mismatches and inconsistencies
  • Code correctness - Ensures your Vue components follow type contracts

Features

  • Template type checking - Validate expressions in {{ }}
  • Directive validation - Type-check v-bind, v-on, etc.
  • Props inference - Infer component prop types
  • Emit validation - Check event handler types

Usage

use vize_canon::{TypeChecker, TypeContext};

let checker = TypeChecker::new();
let ctx = TypeContext::from_sfc(&descriptor);

// Check template for type errors
let diagnostics = checker.check_template(&ctx);

// Get type at position
if let Some(info) = checker.get_type_at(&ctx, offset) {
    println!("Type: {}", info.display());
}

Error Codes

Code Description
2304 Cannot find name
2339 Property does not exist
2345 Argument type mismatch

Part of the Vize Art Collection

vize_canon is part of the Vize compiler's art-themed crate collection:

Crate Art Term Role
vize_carton Carton (Portfolio Case) Shared utilities & allocator
vize_atelier_core - AST & Parser (core)
vize_atelier_dom Atelier (Workshop) DOM compiler
vize_atelier_vapor Atelier (Workshop) Vapor compiler
vize_atelier_sfc Atelier (Workshop) SFC compiler
vize_vitrine Vitrine (Display Case) Bindings (Node.js/WASM)
vize_canon Canon (Standard) Type checker (this crate)

License

MIT License

Commit count: 135

cargo fmt