You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to use prettier-plugin-hermes-parser in my project (because of breaking changes in Prettier 3) and everything seems to be working well except one thing:
I have run gradle clean and confirmed this bug does not occur with JSC
Hermes version: 0.14.0 (prettier-plugin-hermes-parser)
React Native version (if any):
OS version (if any):
Platform (most likely one of arm64-v8a, armeabi-v7a, x86, x86_64):
Steps To Reproduce
Try to format const _ = (path.join(__dirname, 'jest-setup.js') /*: string */) with Prettier using prettier-plugin-hermes-parser (for example: npx prettier --config=./prettier.config.js src/sx-design/jest.config.js)
This isn't really something we can support without heavy modifications to the prettier printer (the reason they also removed it), so it's not realistic for us to support this without forking prettier which we are not interested in doing.
However having done the prettier upgrade within Meta i have found this case pretty easy to work around by shifting the annotation location to the left hand side of the var, e.g.
Bug Description
I am trying to use
prettier-plugin-hermes-parser
in my project (because of breaking changes in Prettier 3) and everything seems to be working well except one thing:Prettier together with
prettier-plugin-hermes-parser
suggest the following change:This is however not correct when running Flow:
gradle clean
and confirmed this bug does not occur with JSCHermes version: 0.14.0 (
prettier-plugin-hermes-parser
)React Native version (if any):
OS version (if any):
Platform (most likely one of arm64-v8a, armeabi-v7a, x86, x86_64):
Steps To Reproduce
const _ = (path.join(__dirname, 'jest-setup.js') /*: string */)
with Prettier usingprettier-plugin-hermes-parser
(for example:npx prettier --config=./prettier.config.js src/sx-design/jest.config.js
)Here is the config I am currently trying to use:
The Expected Behavior
Prettier won't suggest the removal of "()" brackets in
const _ = (path.join(__dirname, 'jest-setup.js') /*: string */)
(no change should be suggested)The text was updated successfully, but these errors were encountered: