Skip to content

Commit cf5b669

Browse files
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

.eslintrc.cjs

Lines changed: 0 additions & 20 deletions
This file was deleted.

eslint.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import microbit from '@microbit/eslint-config/react';
2+
import storybook from 'eslint-plugin-storybook';
3+
4+
export default [...microbit, ...storybook.configs['flat/recommended']];

0 commit comments

Comments
 (0)