Initial checklist
Affected package
unified@11.0.5
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
use function 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
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