squiggle icon indicating copy to clipboard operation
squiggle copied to clipboard

Remove "noImplicitAny": false in components

Open berekuk opened this issue 2 years ago • 1 comments

Context:

  • I tried to remove it after triggering a pretty bad case of unsafe types ({foo: "bar"}[0] is any)
  • but Lezer types are broken: first, they don't provide exports.types field, second, even after I tried to patch node_modules/@lezer/*/package.json by hand and set explicit context: any in squiggle.ts, it didn't work (because generated code is problematic too)

@cab404 this might require PRs to upstream to fix. I couldn't find any issues in https://github.com/lezer-parser/lezer.

berekuk avatar Apr 18 '23 22:04 berekuk

I guess, alternatively, we could try to provide a .d.ts file for generated code, or exclude it from strict typescript checks somehow, and use context: any for squiggle.ts code.

I'd prefer to have "noImplicitAny": true in the entire components repo and sacrifice the type safety in languageSupport, if that's easier for now.

berekuk avatar Apr 18 '23 22:04 berekuk