AlessioGr / payload-plugin-lexical

Extends payload CMS with Meta's lexical RichText editor - a much more advanced and customizable richtext editor
MIT License
144 stars 6 forks source link

chore/eslint #32

Closed 58bits closed 1 year ago

58bits commented 1 year ago

Hi @AlessioGr - here's some progress on the eslint / typescript fixups - but please DON'T accept this PR yet (unless you really want to - heh). I've set this up so that you can see the commits that are coming in.

I 'tweaked' the EditorConfigProvider - mainly so that useEditorConfigContext() can never return undefined. I won't perform any other refactoring tasks on this PR (only eslint / typescript fixups) until we've had a chance to look at them together.

Still lots to do, but making good progress. ;-)

It's going to look very tidy when we're done.

More soon...

AlessioGr commented 1 year ago

@58bits one thing: do you maybe want me to merge this PR, so we can do further changes in a separate PR?

Just think it's nice to separate the automatic prettier & eslint formatting diffs from the refactors & manual improvements. That way it's more clear as to what has been improved ^^

58bits commented 1 year ago

Hi @AlessioGr - ah - we could have but I'm about 70% done with the manual fixups. Up to you - but I think it will be okay.

What you could do from master, is create another branch now - called something like chore/before-eslint - or something like that - so that we can keep a reference to the untouched files.

Also in terms of the files that came directly from Lexical - 'refreshing' them if needed will only take a minute or two, as the changes to those are mostly minor.

I'm making a list of suggested refactors / other changes that you might consider as well when chore/eslint is done.

Hope some of this helps, and don't worry - it will all be good in the end :-)

58bits commented 1 year ago

Hi Alessio,

Okay – all done.

I’ve just run the demo app on the chore/eslint branch, and most things are working.

There are quite a few errors in the developer tools console, but as far as I can tell these are all present in the master branch as well.

Tables are broken – i.e. they won’t open the modal and allow you to insert the table. Will take a look in the morning.

Also a strange validation error on the ‘full’ Lexical Rich Texts’ collection – where it fails validation even though there is valid content in the editor. All of the other collections edit and save content fine. Maybe you could take a look? Or I will as well in the morning.

Let me tidy up my list of other thoughts and suggestions, and then I’ll send this along tomorrow as well.

Overall – I think this is good progress. I actually found a few errors in the Lexical code itself.

And again – it might be a good idea if from the master branch you create a new branch called ‘chore/before-eslint’ or something like that – so we can always switch back to review.

More tomorrow…

Best,

Tony