-
-
Notifications
You must be signed in to change notification settings - Fork 129
Readonly Array for PluggableList #266
Copy link
Copy link
Closed as not planned
Labels
☂️ area/typesThis affects typingsThis affects typings👎 phase/noPost cannot or will not be acted onPost cannot or will not be acted on💬 type/discussionThis is a request for commentsThis is a request for comments
Description
Activity
Metadata
Metadata
Assignees
Labels
☂️ area/typesThis affects typingsThis affects typings👎 phase/noPost cannot or will not be acted onPost cannot or will not be acted on💬 type/discussionThis is a request for commentsThis is a request for comments
Initial checklist
Affected package
unified@11.0.5
Steps to reproduce
I'm using the React Markdown library which is using
unifiedas a dependency, especially the plugins. The main component can take a list of plugins with aPluggableListwhich is mutable. However I believe this is not meant to be modified but to handover an immutable list of plugins.Before opening a bug at ReactMarkdown, I want to check in here:
usefunction would take it as an immutable array?If you believe that it should actually stay mutable for some reason, I'll reach out to ReactMarkdown.
Actual behavior
This makes the Typescript check fails as
REMARK_PLUGINSis readonly (due to theas const) whileuseexpects aPluggableListwhich is mutable.Expected behavior
Typescript should not choke and
useshould accept a readonly array of plugins.Runtime
No response
Package manager
No response
Operating system
No response
Build and bundle tools
No response