Skip to content

Commit f625faa

Browse files
Move to ESLint 10 and @microbit/eslint-config 0.2.1
Drop the react/display-name carve-out: the rule went with eslint-plugin-react. Worth knowing that a stale carve-out like this does not fail the run, because ESLint tolerates an "off" entry for a rule it cannot find. It just quietly stops doing anything. eslint-react reports 25 things the old plugin did not. Eight are worth fixing. Four are leaked conditional renders, all guarding a ReactNode with &&, so a caller passing 0 renders a literal "0". Ternaries with null. SplitViewSized called createRef in a function component, which builds a fresh ref object on every render. That object is in the effect's dependency array, so the effect re-ran every render. useRef is stable. Three components seeded state with a function call on every render: InputDialog, project-hooks and router-hooks. Lazy initialisers. useLast in the language server common module is a Facet combiner, not a hook, and is only used in that file. Now lastOf. The rest are deliberate and now say so: five hooks hand a useState tuple straight to context, the simulator iframe is same-origin-sandboxed because it is served from a separate origin, XTerm's paste listeners share their lifetime with the terminal DOM as its note explains, Highlight's timeouts are a one-shot scroll and highlight sequence, DocString renders documentation HTML from our own pipeline, search extracts and data log rows are positional, and useDeployment is hook-shaped by design. npm cannot resolve this bump in one step. The lockfile pins the old shared config with its eslint ^9.7 peer and npm tries to reconcile that rather than replace it, failing with a circular ERESOLVE. Uninstall eslint and @microbit/eslint-config first, then install the new pair.
1 parent dcf985c commit f625faa

23 files changed

Lines changed: 505 additions & 643 deletions

eslint.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ export default [
3333
"@typescript-eslint/no-unsafe-member-access": "off",
3434
"@typescript-eslint/no-unsafe-return": "off",
3535
"@typescript-eslint/require-await": "off",
36-
"react/display-name": "off",
3736
// Debt to be reviewed: React-compiler-era hooks rules with existing
3837
// violations too involved to fix as part of lint config unification.
3938
"react-hooks/immutability": "off",

0 commit comments

Comments
 (0)