Most of the time, you want to avoid errors in your code samples. Strictly speaking, this usually means setting the right compiler flags and environment in each code sample.
Some times however, you do want to raise a compiler error - to show incorrect states. In those cases, twoslash has a way to mark the compiler errors you expect.
@errors: [num]
All TypeScript compiler errors have a number, this number is relatively arbitrary and can change between TypeScript versions. For our case these numbers are useful in declaring what we expect to see.
Sometimes you have needs in which a broken TypeScript build is OK, a good example of this is using a completion query // ^| which requires a broken TypeScript project to work. You can use // @noErrors to supress all errors in a code sample, and not have them show inline.