Important: An intentional effort is being made during migration to not modify runtime behavior. This implies that there will be several assertions, non-null assertions, and @ts-expect-error. This philosophy applies only to migrating old code to TypeScript strict, not to writing new code. For a more detailed justification for this reasoning, https://github.com/payloadcms/payload/pull/11840#discussion_r2021975897. In this PR, instead of following the approach of migrating a subset of files, I'm migrating all files by disabling a specific rule. In this case, `strictNullChecks`. `strictNullChecks` is a good rule to start the migration with because it's easy to silence with non-null assertions or optional chainings. Additionally, almost all ts strict errors are due to this rule. This PR improves 200+ files, leaving only 68 remaining to migrate to strict mode in the payload package.
Payload Lexical Rich Text Editor
Lexical Rich Text Editor for Payload.
Installation
npm install @payloadcms/richtext-lexical
Usage
import { buildConfig } from 'payload'
import { lexicalEditor } from '@payloadcms/richtext-lexical'
export default buildConfig({
editor: lexicalEditor({}),
// ...rest of config
})
More detailed usage can be found in the Payload Docs.