You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
***Low Noise**: Violations are reported as "Message" diagnostics, avoiding interference with compiler errors.
31
+
***Built-in Rule Traceability**: Diagnostics automatically carry a source trace. In your editor, you can jump from a reported error directly to the exact line in your **rule's source code** that generated it.
TSSLint's high performance comes from its intelligent caching strategy, which automatically distinguishes between **Syntax-Aware** and **Type-Aware** rules.
111
113
112
114
All rule diagnostics are cached by default. The cache is automatically disabled for a rule in two scenarios:
@@ -116,6 +118,21 @@ All rule diagnostics are cached by default. The cache is automatically disabled
116
118
117
119
This automatic differentiation maximizes performance for simple syntax rules while maintaining correctness for complex type-aware rules.
118
120
121
+
### Rule Debugging & Traceability (The `.at()` Magic)
122
+
123
+
TSSLint is designed to make rule debugging trivial. Every time you call `report()`, TSSLint automatically captures the current JavaScript stack trace and attaches it to the diagnostic as **Related Information**.
124
+
125
+
This means: **You can click on the diagnostic in your editor and jump directly to the line in your rule's source code that triggered the report.**
126
+
127
+
The `.at()` method is generally not needed, but is provided for advanced scenarios where you wrap `report()` in a helper function and need to adjust the stack depth to point to the correct logic:
128
+
129
+
```ts
130
+
// Example of advanced usage to adjust stack depth
131
+
report('message', start, end)
132
+
.at(newError(), 2) // Adjusts the stack index to skip the helper function's frame
133
+
.withFix(...);
134
+
```
135
+
119
136
## CLI Usage
120
137
121
138
The `@tsslint/cli` package provides a command-line tool for CI/CD and build processes.
0 commit comments