Effect-TS / codemod

Code mod's for the Effect ecosystem
https://effect-ts.github.io/codemod
MIT License
9 stars 1 forks source link

schema-0.65 doesn't transform `formatError` in `formatErrorSync` #36

Closed devmatteini closed 6 months ago

devmatteini commented 6 months ago

What version of Effect is running?

Schema 0.64.11 -> 0.66.14

What steps can reproduce the bug?

After running the codemod schema-0.65, and using an import like

import { formatError } from "@effect/schema/TreeFormatter"

is not transformed into

import { formatErrorSync } from "@effect/schema/TreeFormatter"

This bug leads to use the new effectful formatError that breaks the existing code that was expecting a string instead of an Effect

What is the expected behavior?

Schema 0.64

import { formatError } from "@effect/schema/TreeFormatter"

formatError(ParseResult.parseError(...))

Schema 0.65+

import { formatErrorSync } from "@effect/schema/TreeFormatter"

formatErrorSync(ParseResult.parseError(...))

What do you see instead?

import { formatError } from "@effect/schema/TreeFormatter"

formatError(ParseResult.parseError(...))

Additional information

No response