feat: Add ESLint rule to standardise file extensions on imports
About the Contributor
Type of Contribution
This is a code improvement
Current Behavior
Between release52 and release53, particularly in d02f4162, the standard for imports seemed to be changed to include .js on the end of the filename. This caused merge conflicts when I was trying to rebase a branch targeted at release52 onto release53.
New Behavior
Use an eslint plugin to enforce extensions on file imports. This enabled me to automatically resolve a bunch of merge conflicts using my git resolve-formatting-conflicts tool.
Currently I have applied this is just to the webui package because that's where I was working. It could probably be done more widely.
Testing
- [ ] I have added one or more unit tests for this PR
- [ ] I have updated the relevant unit tests
- [X] No unit test changes are needed for this PR
Affected areas
This PR affects code formatting and it's enforcement.
Time Frame
- Not urgent
Other Information
It looks like there is a script to do the modification here: https://github.com/Sofie-Automation/sofie-core/pull/1432/commits/88c500fff3821b76ce27167bae9d01070711675c. The advantage of this is that it is part of normal ESLint formatting, so IDEs and will highlight and auto-correct, CI will catch it, and it will work with tools like git resolve-formatting-conflicts without any further customisation.
Status
- [x] PR is ready to be reviewed.
- [ ] The functionality has been tested by the author.
- [ ] Relevant unit tests has been added / updated.
- [ ] Relevant documentation (code comments, system documentation) has been added / updated.
:warning: Please install the to ensure uploads and comments are reliably processed by Codecov.
Codecov Report
:white_check_mark: All modified and coverable lines are covered by tests.
:loudspeaker: Thoughts on this report? Let us know!