shikijs / twoslash

You take some Shiki, add a hint of TypeScript compiler, and 🎉 incredible static code samples
https://shikijs.github.io/twoslash/
MIT License
1.06k stars 51 forks source link

Console output of code should say the LOC for errors #78

Closed orta closed 3 years ago

orta commented 3 years ago
Error: Errors were thrown in the sample, but not included in an errors tag: 7006 2554
Expected:
// @errors: 7006 2554

  [7006] - Parameter 'state' implicitly has an 'any' type.
  [2554] - Expected 1 arguments, but got 0.

## Code

'''ts
declare function prepareState(state: any): boolean;
declare function validateState(state: any): boolean;
declare function waitOnState(state: any): Promise<void>;
// ---cut---
test('prepareState prepares a valid state', () => {
  expect.hasAssertions();
  prepareState(state => {
    expect(validateState(state)).toBeTruthy();
  });
  return waitOnState();
});
'''

Yeah, but where?

orta commented 3 years ago

I added the name and position in the file inside #79 - I think that's probably enough