The transformRef method is not found on the most recent versions of @vue/compiler-sfc (3.4.x), because it seems to have only existed for some versions of 3.x (including the version we use in devDependencies, which is why our tests passed). I couldn't find any mention of it in the Vue changelog, though it seems like it should have been a breaking change to remove the method.
So, now instead of relying on the presence of a method, we'll import the package.json directly, look at the version field, and make our decision based on that, which should be much safer.
Fixes https://github.com/IanVS/prettier-plugin-sort-imports/issues/158
The
transformRef
method is not found on the most recent versions of @vue/compiler-sfc (3.4.x), because it seems to have only existed for some versions of 3.x (including the version we use in devDependencies, which is why our tests passed). I couldn't find any mention of it in the Vue changelog, though it seems like it should have been a breaking change to remove the method.So, now instead of relying on the presence of a method, we'll import the package.json directly, look at the version field, and make our decision based on that, which should be much safer.