You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now, eslint-plugin-vue is published as a CommonJS (CJS) package. Since the TypeScript migration is now complete (see #2777) and the code is written in ES modules (ESM) now anyway, publishing it as a dual package (ESM + CJS) should be feasible. This would allow users to migrate to ESM in this minor version and give them some time to do so.
In the next major version (see #3105 and #3167), we can then fully switch to ESM. (Note that #3102 already tried to do this.)
I'd like to pick this up once #3250 and #3252 are merged. One design question first. Two separate builds would load two plugin objects whenever a flat config imports the plugin and a CommonJS shareable config requires it, and ESLint then throws Cannot redefine plugin "vue". To avoid that, I'd ship a thin dist/index.mjs that re-exports the CommonJS build, so import and require() share one instance, and require() keeps returning the plugin without .default. Would that be fine for you, or do you prefer real transpiled ESM files despite the double loading? Should it also add named exports (configs, rules, …)?
@rivajunior you reacted with 👎, may I know why? Do you disagree with the suggestion to publish as dual module, or with the suggestion to go full ESM in the next major version? Or something else?
Two separate builds would load two plugin objects whenever a flat config imports the plugin and a CommonJS shareable config requires it, and ESLint then throws Cannot redefine plugin "vue".
Oh, good to know!
To avoid that, I'd ship a thin dist/index.mjs that re-exports the CommonJS build, so import and require() share one instance, and require() keeps returning the plugin without .default.
Hmm I guess that would be a sensible first step then.
Should it also add named exports (configs, rules, …)?
Not sure, I guess the default export is enough for now.
Activity
ValentinYoushkevich commentedon Nov 16, 2026
I'd like to pick this up once #3250 and #3252 are merged. One design question first. Two separate builds would load two plugin objects whenever a flat config imports the plugin and a CommonJS shareable config requires it, and ESLint then throws
Cannot redefine plugin "vue". To avoid that, I'd ship a thindist/index.mjsthat re-exports the CommonJS build, soimportandrequire()share one instance, andrequire()keeps returning the plugin without.default. Would that be fine for you, or do you prefer real transpiled ESM files despite the double loading? Should it also add named exports (configs,rules, …)?FloEdelmann commentedon Nov 27, 2026
@rivajunior you reacted with 👎, may I know why? Do you disagree with the suggestion to publish as dual module, or with the suggestion to go full ESM in the next major version? Or something else?
FloEdelmann commentedon Nov 27, 2026
Oh, good to know!
Hmm I guess that would be a sensible first step then.
Not sure, I guess the default export is enough for now.
ValentinYoushkevich commentedon Nov 28, 2026
Thanks! I'll keep it to the default export and open the PR once #3250 and #3252 are merged.