Skip to content

fix: handle diff-sequences import issue#536

Merged
ota-meshi merged 4 commits intoota-meshi:masterfrom
luxass:fix/esm-diff-sequences-import
Jan 19, 2026
Merged

fix: handle diff-sequences import issue#536
ota-meshi merged 4 commits intoota-meshi:masterfrom
luxass:fix/esm-diff-sequences-import

Conversation

@luxass
Copy link
Contributor

@luxass luxass commented Jan 18, 2026

This PR fixes the error TypeError: diff is not a function after converting to ESM-only in v2.0.0.

The diff-sequences package exports { default: function } in ESM but the function directly in CommonJS. Added dynamic detection to handle both cases.

Before this fix:
https://eslint-online-playground.netlify.app/#eNqtU01v2zAM/SuEMCBAENtdj+5lA7ZbtxXoMKCIskG1aUeJPgxJ6RoU+e+jZOVrLXooerEt8ZF8fHx+Yt41FT4KPSgst0IrVrOiKLi5V7ZZ34atwpobgEE0a9Hjd6GxBvRKmlAMatNLU2y1iogWfePkEKQ1NfxcSg9fb68JBiMMBmcfJIEg5krTg9soOnXWwd3nb9dlrNHLsNzc17AMYfB1VY3nsrG6skEUGv1SVi9075T9O3KFpxO2f8zLdGfvwTcVeSNjyt1xw2ZsjBDcdLIvV57Ul3qwLsCKWjmrgbNPI6haec6uuMnx8fImlbzTag9+Lk7MwceU02InNirAPFJf+dzWlw6Jr0bTYpumKsvyv/J76JyzTolQ+SBMK1zL2WLUIckO0EnSqIb5ZDqtpslPkxnkA31nMChh+g0t6EeSnxJyetyc8+ie38d9JfJR+1/ofFrb5GN5Ock1AXb5a/9OCzupwRlxqDwpUaxxS2oSUVLMOes4m532sq5FF6OHm5h9cBmhzyPHn4WzY2Q/7ThXWN6IENARbc5+fzgCd4tMO77osbgiY2QHkyWsIVMkbpyF7UAdYgFtW5ouE+GsxYcvOMQNmkZiGi2Pc+6fmEr7Qx8OM+w982rwzFARd1lelBfjDER5x3b/AP7rajs=

After this fix:
https://eslint-online-playground.netlify.app/#eNqtU01r3DAQ/StCFBaWtU16CMS5pNDe0jaQUgirbVHssVe7+kLSJlnC/veOZHk/uqGHkottad7MvHnz/Eq9ayp44cpKKLdcSVrToiiYfpSmWd+HrYSaaUIsb9a8h29cQU3AS6FDYeWmF7rYKhkRLfjGCRuE0TX5sRSefLm/RRgZYMQ68yQQRGKu0D1xG4mnzjjy8OnrbRlr9CIsN481WYZgfV1Vw7lsjKpM4IUCvxTVG907aZ4HruT1iO1v/Tbd2XvwTUX+kzHm7pimMzpEEK470Zcrj+oLZY0LZIWtnFGE0ZsBVK08o9dM5/hweZdKPig5gs/FiTlMw0vKaqHjGxnIPJJf+dzYlw6QsQLdQpvmKsvyrwYjdM5oJ3mofOC65a5ldDEokYQnpBOoUk3mk+m0miZHTWYkH/A7g4nkut/gir6nBWBCTo+7cx7c+X3cWCIf1f8JzqfFTS7Kj5Nck5Bd/hrfaWVHNRhFDpVHJYo1bFFPJIqaOWcco7PjXsa14GJ0fxOz9z5D9Gnk8LsweoiM0w5zheUdDwEc0mb014cDcLfItOMLH4trtEb2MJrCaLRF4sZo2FrsEAso0+J0mQijLTx9Bhs3qBsBabQ8zqmDYiruD3zYzzC65p/BE0tF3Oh4u+5L60oNz+c+v+kur6745cUwKk62o7s/7y55uw==

@changeset-bot
Copy link

changeset-bot bot commented Jan 18, 2026

🦋 Changeset detected

Latest commit: 5c115a5

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
eslint-plugin-yml Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Jan 18, 2026

@luxass luxass marked this pull request as ready for review January 18, 2026 12:27
@OlivierZal
Copy link

Hi @ota-meshi, I have the same "diff" issue since 2.0 with this project / config: https://github.com/OlivierZal/com.melcloud.extension/blob/main/eslint.config.js (uncomment the commented rules to see that ESLint crashes).

Copy link
Owner

@ota-meshi ota-meshi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants