-
-
Notifications
You must be signed in to change notification settings - Fork 121
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
Initial checklist
- I read the support docs
- I read the contributing guide
- I agree to follow the code of conduct
- I searched issues and discussions and couldn’t find anything (or linked relevant results below)
Affected package
Steps to reproduce
I'm using the React Markdown library which is using unified as a dependency, especially the plugins. The main component can take a list of plugins with a PluggableList which is mutable. However I believe this is not meant to be modified but to handover an immutable list of plugins.
const REMARK_PLUGINS = [remarkGfm] as const
...
const processor = unified()
.use(REMARK_PLUGINS)Before opening a bug at ReactMarkdown, I want to check in here:
- is there an alternative which is readonly for PluggableList? (I could not find one)
- is PluggableList actually mostly used as readonly and you would consider making it ReadonlyArray? at least that the
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_PLUGINS is readonly (due to the as const) while use expects a PluggableList which is mutable.
Expected behavior
Typescript should not choke and use should accept a readonly array of plugins.
Runtime
No response
Package manager
No response
Operating system
No response
Build and bundle tools
No response
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