feat: Add ESLint rule to standardise file extensions on imports #1541
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
About the Contributor
Type of Contribution
This is a code improvement
Current Behavior
Between release52 and release53, particularly in d02f416, the standard for imports seemed to be changed to include
.json 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
Affected areas
This PR affects code formatting and it's enforcement.
Time Frame
Other Information
It looks like there is a script to do the modification here: 88c500f. 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