Create a pre-commit hook. #4246
Replies: 3 comments 1 reply
-
I don't think Rome will provide such functionality, at least in the near future. BTW, neither Prettier supports git hooks out of the box, in fact in their website they provide some alternatives on how to set it up: https://prettier.io/docs/en/precommit.html#docsNav You could try to set up Rome using this guide and using the appropriate arguments for the CLI. |
Beta Was this translation helpful? Give feedback.
-
An easy solution to this is using a combination of husky and lint-staged... {
"**/*.{js,cjs,mjs,ts}": ["rome format --write", "rome check"]
} Speed is quite good compared to the prettier/eslint combination 🏎️ The lint-staged config could even be simplified with a --ignore-unknown option |
Beta Was this translation helpful? Give feedback.
-
@veritas9872: I was adding Rome to one of my projects and wanted this functionality. LMK if this works for you! Update: This can be easily accomplished using a local node repo as follows:
|
Beta Was this translation helpful? Give feedback.
-
I am very impressed by the Rome project and I would like to suggest creating a pre-commit hook or a mirror to host that hook.
This would be a very simple modification that would greatly improve the usability of the Rome project.
Currently, the only reason that many people, including myself, stay with prettier is the lack of pre-commit support in Rome.
Beta Was this translation helpful? Give feedback.
All reactions