[lexical-markdown] Refactor: Remove MarkdownShortcuts.ts Dependency on index.ts#7832
[lexical-markdown] Refactor: Remove MarkdownShortcuts.ts Dependency on index.ts#7832etrepum merged 4 commits intofacebook:mainfrom
Conversation
This import is unused and creates a cyclic dependency.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
It's not unused Practically speaking I don't think the circular reference is really an issue since it should get compiled out in the bundling process, but to break the cycle you'd probably want to move the definition of TRANSFORMERS (and the other arrays used to build it) into MarkdownTransformers.ts or a new file. |
|
Oops, I was looking at the wrong branch, I'll likely do a fix like my original commit in #6474 then. |
Move transformer groups created in index.ts to MarkdownTransformers.ts, co-locating them with the member transformers and avoiding a cyclical dependency involving index.ts.
etrepum
left a comment
There was a problem hiding this comment.
It's failing eslint, the imports should be sorted. npm run lint -- --fix then npm run prettier:fix should fix that (normally this sort of thing is addressed on commit by the git hooks that are installed by husky)
|
Yea, I've been fighting a lint error this whole time. Any ideas? The file is actually present but it fails with: I might just do the linting manually and reclone the repo for my next change if I can't fix it. |
|
I've never seen it error like that. Are you using npm to install everything? Are you invoking eslint from the repo's node_modules and not some global install? |
|
Huh, bizarrely the issue seems to be that it is running from the I get So If I manually add an extra I have a workaround so not a big issue anymore, but any idea why this is the case? I started fresh with |
|
That's interesting, what platform are you using? Maybe it has something to do with whether your platform supports symlinks or not. I've never noticed an issue on macOS or Linux. |
|
Just Linux, though a custom distro. I think I found the issue though, and why it worked for me previously - seems like Indeed running Might be worth doing a quick check to see if this is something Lexical needs to override generally or just something weird on my system. If you remove your Thanks for approval! |
This import is unused and creates a cyclic dependency.
Description
Revival of #6474, which I forgot about. The cycle has been fixed through other changes, the only remaining piece is this dangling import.
Test plan
N/A