Commit cf5b669
authored
Adopt @microbit/eslint-config (#25)
Replaces the legacy .eslintrc.cjs and per-project plugin set with the
shared flat config, moving to ESLint 9. eslint-plugin-storybook stays a
project dependency as its version tracks Storybook's release cycle; the
one-line flat/recommended addition isn't worth a shared config export
until more Storybook conventions accumulate.
Fixes for the type-aware rules the shared config enables:
- Type the postMessage listeners' event.data, previously any, via
narrow local types that the existing per-message casts build on.
- Rework MakeCodeBlocksRendering's empty-code case to derive the
rendered output instead of setting state synchronously in the effect
(react-hooks set-state-in-effect).
- SnippetAnswerTypes uses (string & {}) to keep the named literals in
autocomplete rather than a union the string member absorbs.
- Type info()'s response resp field, previously any via the intersection
with EditorMessageResponse.
- Mark intentionally unawaited promises with void, drop async from
functions with no await, and remove now-unnecessary assertions.
The lockfile is regenerated as npm could not resolve the ESLint major
bump in place.1 parent f2a9f71 commit cf5b669
13 files changed
Lines changed: 2567 additions & 1057 deletions
File tree
- src
- react
- stories
- react
- vanilla
- vanilla
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
0 commit comments