unsplash / intlc

Compile ICU messages into code. Supports TypeScript and JSX. No runtime.
MIT License
56 stars 3 forks source link

Lint with line/column info #142

Closed samhh closed 1 year ago

samhh commented 2 years ago

More like the parser errors.

This'll probably be a large task.

samhh commented 1 year ago

A limitation of the approach described at the end of #48, potentially implemented with Cofree, is that we can only store source information where the pattern functor recurses.

Consider a lint against SelectNamedF where we want to match on a branch. We'll have the offset of the branches, because we recurse there, but not on the branch names themselves, which is often what we'll want to point to. In this specific example we should be able to calculate an accurate offset (roughly head node - length branchName - 1), but that mightn't solve the problem universally. It's a bit inelegant.