diff --git a/.flowconfig b/.flowconfig index 8d966996cb3..04806f560c0 100644 --- a/.flowconfig +++ b/.flowconfig @@ -17,6 +17,7 @@ untyped-type-import=error [options] server.max_workers=4 exact_by_default=true +component_syntax=true ;; [generated-start update-flowconfig] module.name_mapper='^lexical$' -> '/packages/lexical/flow/Lexical.js.flow' @@ -105,4 +106,4 @@ nonstrict-import unclear-type [version] -^0.226.0 +^0.250.0 diff --git a/libdefs/yjs.js b/libdefs/yjs.js index b58fc7a834d..8912a4461e9 100644 --- a/libdefs/yjs.js +++ b/libdefs/yjs.js @@ -644,6 +644,7 @@ declare module 'yjs' { }; declare type StackItem = { + // $FlowFixMe: perhaps add generic typing instead of mixed meta: Map, type: 'undo' | 'redo', }; diff --git a/package-lock.json b/package-lock.json index 97f74d56156..d0e83273504 100644 --- a/package-lock.json +++ b/package-lock.json @@ -65,7 +65,7 @@ "eslint-plugin-react-hooks": "^4.6.2", "eslint-plugin-simple-import-sort": "^12.1.0", "eslint-plugin-sort-keys-fix": "^1.1.2", - "flow-bin": "^0.226.0", + "flow-bin": "^0.250.0", "fs-extra": "^10.0.0", "glob": "^10.4.1", "google-closure-compiler": "^20220202.0.0", @@ -17265,10 +17265,11 @@ "dev": true }, "node_modules/flow-bin": { - "version": "0.226.0", - "resolved": "https://registry.npmjs.org/flow-bin/-/flow-bin-0.226.0.tgz", - "integrity": "sha512-q8hXSRhZ+I14jS0KGDDsPYCvPufvBexk6nJXSOsSP6DgCuXbvCOByWhsXRAjPtmXKmO8v9RKSJm1kRaWaf0fZw==", + "version": "0.250.0", + "resolved": "https://registry.npmjs.org/flow-bin/-/flow-bin-0.250.0.tgz", + "integrity": "sha512-OYEPzpgSzvV+33kBuOOA1C0AjQkzIjrmbS/324CRRijnU1tABKyM5unzf4KIkyN5IQutgxqsSRZ1GsixC8+xIQ==", "dev": true, + "license": "MIT", "bin": { "flow": "cli.js" }, @@ -49129,9 +49130,9 @@ "dev": true }, "flow-bin": { - "version": "0.226.0", - "resolved": "https://registry.npmjs.org/flow-bin/-/flow-bin-0.226.0.tgz", - "integrity": "sha512-q8hXSRhZ+I14jS0KGDDsPYCvPufvBexk6nJXSOsSP6DgCuXbvCOByWhsXRAjPtmXKmO8v9RKSJm1kRaWaf0fZw==", + "version": "0.250.0", + "resolved": "https://registry.npmjs.org/flow-bin/-/flow-bin-0.250.0.tgz", + "integrity": "sha512-OYEPzpgSzvV+33kBuOOA1C0AjQkzIjrmbS/324CRRijnU1tABKyM5unzf4KIkyN5IQutgxqsSRZ1GsixC8+xIQ==", "dev": true }, "flow-enums-runtime": { diff --git a/package.json b/package.json index f1d0d0d401c..e8b913dd2cd 100644 --- a/package.json +++ b/package.json @@ -160,7 +160,7 @@ "eslint-plugin-react-hooks": "^4.6.2", "eslint-plugin-simple-import-sort": "^12.1.0", "eslint-plugin-sort-keys-fix": "^1.1.2", - "flow-bin": "^0.226.0", + "flow-bin": "^0.250.0", "fs-extra": "^10.0.0", "glob": "^10.4.1", "google-closure-compiler": "^20220202.0.0", diff --git a/packages/lexical-react/flow/LexicalContentEditable.js.flow b/packages/lexical-react/flow/LexicalContentEditable.js.flow index 3c50a112513..46fa8ccb950 100644 --- a/packages/lexical-react/flow/LexicalContentEditable.js.flow +++ b/packages/lexical-react/flow/LexicalContentEditable.js.flow @@ -12,11 +12,10 @@ import type { LexicalEditor } from 'lexical'; import type {TRefFor} from 'CoreTypes.flow'; import * as React from 'react'; -import type { AbstractComponent } from "react"; type InlineStyle = { - [key: string]: mixed; -} + [key: string]: mixed, +}; // Due to Flow limitations, we prefer fixed types over the built-in inexact HTMLElement type HTMLDivElementDOMProps = $ReadOnly<{ @@ -29,7 +28,7 @@ type HTMLDivElementDOMProps = $ReadOnly<{ 'aria-invalid'?: void | boolean, 'aria-owns'?: void | string, 'title'?: void | string, - onClick?: void | (e: SyntheticEvent) => mixed, + onClick?: void | ((e: SyntheticEvent) => mixed), autoCapitalize?: void | boolean, autoComplete?: void | boolean, autoCorrect?: void | boolean, @@ -72,11 +71,10 @@ export type Props = $ReadOnly<{ ariaOwns?: string, ariaRequired?: string, autoCapitalize?: boolean, - ref?: TRefFor, - ...PlaceholderProps -}> + ...PlaceholderProps, +}>; -declare export var ContentEditable: AbstractComponent< - Props, - HTMLDivElement, ->; +declare export var ContentEditable: component( + ref: React.RefSetter, + ...Props +);