payloadcms / payload

Payload is the open-source, fullstack Next.js framework, giving you instant backend superpowers. Get a full TypeScript backend and admin panel instantly. Use Payload as a headless CMS or for building powerful applications.
https://payloadcms.com
MIT License
27.66k stars 1.72k forks source link

perf(richtext-lexical): fix all eslint errors to get react compiler running on all files, enable strict: true #9394

Closed AlessioGr closed 1 day ago

AlessioGr commented 1 day ago

This PR fixes all eslint errors in the richtext-lexical package. This includes all eslint errors of the react compiler.

Since the react compiler skips files that have react compiler eslint errors, this PR will make it run on files it previously ignored.

Source: https://react.dev/learn/react-compiler#installing-eslint-plugin-react-compiler

The ESLint plugin will display any violations of the rules of React in your editor. When it does this, it means that the compiler has skipped over optimizing that component or hook. This is perfectly okay, and the compiler can recover and continue optimizing other components in your codebase.

This PR also enables strict: true. Thanks to @GermanJablo for doing most of the work by enabling noImplicitAny and strictNullChecks in previous PRs