Update linters for VS Code, move files from kobo-common into kpi #4985
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.
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