Add formating and linting on test files#1445
Conversation
Upgrade the version of `prettier` package from 3.3.3 to 3.8.1. This gives access to `objectWrap` rule, introduced in 3.5, with the `collapse` option that fits objects to a single line when possible. Also, introduced in 3.6, there is the `@noprettier` or `@noformat` that can be added at the top of a file to ignore a specific file when formatting, which can be useful for mocks or test files.
** To be documented when we agree **
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Et je sais qu'il manque des règles de linting qu'il faut ignorer ou fixer, mais avant de passer du temps là-dessus, je voulais juste votre avis sur le formatage proposé. |
|
T'en es où avec ce PR? :) @tahini |
Nulle part, c'était là pour discussion, on n'en a pas vraiment discuté! :D |
This adds overrides rules for the prettier and eslint rules for files in
__tests__folders.Using a line width of 150, a little longer than our usual 120, but ok for tests, I think.
Also, it tries to fit objects in one line with the
objectWrap: 'collapse'(but honestly I have no idea if I prefer withcollapseorpreserve, you can try locally and let me know)@kaligrafy @samuel-duhaime Can you both take a quick look at the test file formatting and let me know if something outrages you and we should try some more rules or if to have a proper formatting once and for all in test files is worth a bit of water in our wine.
When we agree on the rules, I'll put the rules in the official config files and document in the commit message the rules we agreed upon.
Also note that I upgrade version of
prettierso there are a very few changes in files that are not in test folders (2 I think)