Lint code in the Web IDE and provide actionable data for resolution

Linting code in real time while writing is an important part of the IDE experience. We should provide a way for users to have their code linted and get feedback on that so that the experience of writing code is better.

Ideally the linting implementation easily supports a variety of languages either natively or through user configuration of some kind.

Possible Solutions

  • Utilizing the Web IDE runner and terminal we can execute linting on that compute.
  • Centralized linting runners for all kinds of linting
  • Some other kind of linting service not tied to runners.
Old Description OLD: Using the attached Web IDE runner (https://gitlab.com/gitlab-org/gitlab-ee/issues/5426) and local changes mirrored from the Web IDE to the runner (https://gitlab.com/gitlab-org/gitlab-ee/issues/5276) we should be able to show linting feedback in the Web IDE.

Proposal

  • Based on the detected filetype run a linter and capture JSON output:
    • ruby: rubocop with json output
    • javascript: eslint with json output

Links

  • https://eslint.org/docs/user-guide/formatters/#json
  • https://github.com/bbatsov/rubocop/blob/master/manual/formatters.md#json-formatter
*This page may contain information related to upcoming products, features and functionality. It is important to note that the information presented is for informational purposes only, so please do not rely on the information for purchasing or planning purposes. Just like with all projects, the items mentioned on the page are subject to change or delay, and the development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.*
Edited Apr 26, 2023 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading