1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//! Linting Module for WASM State Synchronization and Panic Paths
//!
//! Implements static analysis for detecting anti-patterns per PROBAR specs.
//!
//! ## State Sync Rules (PROBAR-SPEC-WASM-001)
//!
//! | Rule ID | Description |
//! |---------|-------------|
//! | WASM-SS-001 | Local `Rc::new()` in method with closure |
//! | WASM-SS-002 | Potential state desync (self.field and local_clone both exist) |
//! | WASM-SS-003 | Closure captures local instead of self field |
//! | WASM-SS-004 | Duplicate state fields (RefCell + non-RefCell) |
//! | WASM-SS-005 | Missing `self.*.clone()` before closure |
//! | WASM-SS-006 | Type alias for Rc (including turbofish `Alias::<T>::new()`) |
//! | WASM-SS-007 | Function returning Rc captured in closure |
//! | WASM-SS-008 | Method chain returning Rc (`.to_rc()`, etc.) |
//!
//! ## Panic Path Rules (PROBAR-WASM-006)
//!
//! | Rule ID | Description | Severity |
//! |---------|-------------|----------|
//! | WASM-PANIC-001 | `unwrap()` call | Error |
//! | WASM-PANIC-002 | `expect()` call | Error |
//! | WASM-PANIC-003 | `panic!()` macro | Error |
//! | WASM-PANIC-004 | `unreachable!()` macro | Warning |
//! | WASM-PANIC-005 | `todo!()` macro | Error |
//! | WASM-PANIC-006 | `unimplemented!()` macro | Error |
//! | WASM-PANIC-007 | Index access without bounds check | Warning |
//!
//! ## AST vs Text-Based Analysis
//!
//! The linter supports two modes:
//! - **AST-based** (`ast_visitor`): Uses `syn` crate for accurate parsing
//! - **Text-based** (`state_sync`): Legacy fallback for edge cases
//!
//! AST-based analysis is preferred as it handles:
//! - Turbofish syntax (`Type::<T>::new()`)
//! - Alternative constructors (`Rc::default()`, `Rc::from()`)
//! - Method chains (`.to_rc()`)
//! - Unusual whitespace/formatting
pub use ;
pub use ;
pub use ;