Repository navigation
[lexical][lexical-clipboard][lexical-code-core][lexical-code-prism][lexical-code-shiki][lexical-eslint-plugin][lexical-extension][lexical-list][lexical-playground][lexical-react][lexical-table][lexical-y] Feature: flag accidental nested editor updates #9106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
dceb5f0
04ff664
a840555
606b176
abc87c5
ec21685
9a59ead
f9abf67
ad8d872
eac3d46
aedef76
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| --- | ||
| '@lexical/eslint-plugin': patch | ||
| '@lexical/list': patch | ||
| '@lexical/react': patch | ||
| '@lexical/y': patch | ||
| --- | ||
|
|
||
| [feature] Warn about accidental nested editor updates in the default ESLint presets | ||
|
|
||
| The new `@lexical/no-nested-editor-updates` rule identifies same-editor | ||
| nested updates and explains how to preserve update options, move updates | ||
| out of read callbacks, and clarify `$function` context ownership. Async | ||
| functions are left alone because their editor context may end at an `await`. | ||
| Both rules preserve the existing ESLint 8 source-code access fallback, and | ||
| the new rule resolves receiver bindings through the scope manager when | ||
| `SourceCode#getScope` is unavailable (before ESLint 8.37). `$function` | ||
| diagnostics condition wrapper removal and option migration on targeting | ||
| the active editor. Transform diagnostics link to the preconditions needed | ||
| for inline mutations to converge. | ||
|
|
||
| Checklist space-key handlers and collaboration initial-state callbacks use | ||
| their surrounding update context. Intentional nested updates and | ||
| cross-editor verification receive targeted lint exemptions. | ||
|
|
||
| Verify: Review new lint warnings in command and transform callbacks, check | ||
| transform preconditions and `$function` editor ownership when removing an | ||
| update wrapper, confirm updates after `await` are left alone, and verify | ||
| checklist toggling and collaboration initialization and undo behavior. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -346,6 +346,11 @@ export default [ | |
| files: ['**/*.ts', '**/*.tsx', '**/*.mts'], | ||
| })), | ||
| lexicalPlugin.configs['flat/all'], | ||
| { | ||
| rules: { | ||
| '@lexical/no-nested-editor-updates': ERROR, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Optional, for the rebase: #9862 on |
||
| }, | ||
| }, | ||
| { | ||
| files: ['**/*.ts', '**/*.tsx', '**/*.mts'], | ||
| languageOptions: { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.