Closed rossketron closed 9 months ago
Can you try eslint 8?
Nonissue when using eslint 8, everything works as expected. Thanks!
I'll go ahead and close this, as the workout is pretty simple: either upgrade to eslint 8 so the plugin works with prettier 3.x locally or downgrade to prettier 2.x. If trailing commas are needed when using prettier 2.x locally to match some other formatter that is using prettier 3.x defaults (CI in or case), your locally referenced .prettierrc
can be updated to set the trailingComma
parameter to all
.
Description
Linting fails when using this plugin with Prettier 3.x.
Reproduction
I've created a small example application where Prettier 2.8.8 is used in the
main
branch and Prettier 3.0.3 is used in thenon-working-prettier-3.x
branch.Run
pnpm lint:js
in each and the main branch will be successful, while the 3.x branch will throw the error below:Cause
It seems that this line in
decorator-position.js
along with this line are the culprits.Prettier 3 moves the synchronous API to the
@prettier/sync
module instead of being included in the default module. Details from Prettier documentation can be found here.Potential Solution
I am able to modify this segment of the
lineLength
function indecorator-position.js
to the following and it is able to lint successfully, but I'm not sure if it is the best solution.