Apply consistent defaults to Web IDE and Single File Editor
<!-- This issue template can be used a great starting point for feature requests. The last section "Release notes" can be used as a summary of the feature and is also required if you want to have your release post blog MR auto generated using the release post item generator: https://about.gitlab.com/handbook/marketing/blog/release-posts/#release-post-item-generator. The remaining sections are the backbone for every feature in GitLab. --> ### Release notes <!-- What is the problem and solution you're proposing? This content sets the overall vision for the feature and serves as the release notes that will populate in various places, including the [release post blog](https://about.gitlab.com/releases/categories/releases/) and [Gitlab project releases](https://gitlab.com/gitlab-org/gitlab/-/releases). " --> ### Problem to solve The default behavior of the Web IDE and Single File Editor are inconsistent. Specifically around how they handle trailing newline characters. ### Proposal Evaluate the default behavior of both editors and make them consistent. This will be blocked by our implementation of `.editorconfig` values in the Single File Editor (Editor Lite) but once that work is completed, we would want the Web IDE and Single File Editor to behave consistently by default. | Behavior | Web IDE default | SFE default | | ------ | ------ | ------ | | Add newline at end of file | :white_check_mark: | :x: | | | | | ### Approach _From the comments_ In general, the rough implementation plan could look like: * create a new extension for the Source Editor * take out the `.editorconfig` functionality out of `app/assets/javascripts/ide/components/repo_editor.vue` and move it into the new extension adapting it to work in the stateless env (we don't have access to the WebIDE's state here) * use the extension in WebIDE (`repo_editor.vue`) and in the blob edit (`app/assets/javascripts/blob_edit/edit_blob.js`) ### Testing This can potentially break some E2E tests that manipulate content within editors. Please run `package-and-qa` and notify the SET in case of any failures - we will need to fix it within the same MR.
issue