kobotoolbox / kpi

kpi is the (frontend) server for KoboToolbox. It includes an API for users to access data and manage their forms, question library, sharing settings, create reports, and export data.
https://www.kobotoolbox.org
GNU Affero General Public License v3.0
131 stars 177 forks source link

Update linters for VS Code, move files from kobo-common into kpi #4985

Closed p2edwards closed 3 months ago

p2edwards commented 3 months ago

Description

Update linter dependencies to support VS Code. Move colors.scss and linter definitions from kobotoolbox/kobo-common directly into kobotoolbox/kpi to make updating and development easier.

Notes

This PR fixes our linters so they work with current versions of VS Code extensions (eslint, Stylelint, Prettier), and changes the way these linters are loaded to make future updates easier.

Future plans for the linters include updating to ESLint 'flat config', separating 'stylistic' and 'inference' rules, and adding some library-specific linters.

Re-adopting these scripts in the kpi repo will make it easier to keep them working, up-to-date, and useful (congruent with our current practices). The kobo-common workflow was adding a little too much friction to common tasks, causing these files to get sidelined:

Importing them via npm adds several extra steps every time we:

One of the goals of kobo-common — to let other repos subscribe to common assets primarily created for kpi — can be replaced with a script, or a periodic semi-automated task, which doesn't need to happen very often. We can still accomplish 'DRY' by more primitive mechanisms, without paying the overhead of using npm + git hooks to factor these out.

Related issues

Part of #4703 Related to #4230

Checklist

  1. [x] If you've added code that should be tested, add tests
  2. [x] If you've changed APIs, update (or create!) the documentation
  3. [x] Ensure the tests pass
  4. [x] Make sure that your code lints and that you've followed our coding style
  5. [x] Write a title and, if necessary, a description of your work suitable for publishing in our release notes
  6. [x] Mention any related issues in this repository (as #ISSUE) and in other repositories (as kobotoolbox/other#ISSUE)
  7. [x] Open an issue in the docs if there are UI/UX changes