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.
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.
Upgrade each linter dependency to the latest version that still supports Node 16.
These are due for upgrade again soon when we move Node to 18, 20, or 22.
Move linter configs from kobo-common into kpi
This makes them easier to maintain,
more compatible with VS Code tooling,
and easier to review in relation to kpi PR's.
Move colors.scss from kobo-common into kpi.
Similar advantages for PR's and maintainability,
plus this lets us remove kobo-common from package.json, streamlining the update process.
Future plans for the linters include updating to ESLint 'flat config', separating 'stylistic' and 'inference' rules, and adding somelibrary-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:
.eslintrc.js
.editorconfig
.prettierrc.js
.stylelintrc.js
colors.scss
Importing them via npm adds several extra steps every time we:
change any of them
update a shared npm package
or add a new linter-related package
need to sync versions in both
need to troubleshoot tools
tools that don't expect nested dependencies
npm dependency resolution
git hooks, cli paths, version tags
read or write PR's across two repos
authoring friction: write and manage commits in two repos, while running npm commands to keep them synced
reviewer friction: 1 PR becomes 2 PR's
checkout friction: more re-install's required between checkouts
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
[x] If you've added code that should be tested, add tests
[x] If you've changed APIs, update (or create!) the documentation
[x] Ensure the tests pass
[x] Make sure that your code lints and that you've followed our coding style
[x] Write a title and, if necessary, a description of your work suitable for publishing in our release notes
[x] Mention any related issues in this repository (as #ISSUE) and in other repositories (as kobotoolbox/other#ISSUE)
[x] Open an issue in the docs if there are UI/UX changes
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.
colors.scss
from kobo-common into kpi.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