Rule: ```js 'import/order': [ 'warn', { named: true, }, ], ``` minimal repro case: ```js const test = { a: 1, browser: 2, }; module.exports = { ...test, target: 'node', }; ```
Activity
ljharb commentedon Jan 17, 2025
What does native node do when importing this module into ESM? I assume it breaks cjs-module-lexer's static analysis as well?
UnderKoen commentedon Jan 20, 2025
@ljharb It doesn't break but it ignores it.
https://www.npmjs.com/package/cjs-module-lexer#:~:text=Object%20properties%20that%20are%20not%20identifiers%20or%20string%20expressions%20will%20bail%20out%20of%20the%20object%20detection%2C%20while%20spreads%20are%20ignored%3A
ljharb commentedon Jan 20, 2025
By ignore, that means it won’t treat those as named imports, which would match the current behavior of this plugin?
UnderKoen commentedon Jan 20, 2025
Currently it crashes. As
node.right.properties[i].key
is undefined. That why there is just an truthy check added in #3146ljharb commentedon Jan 20, 2025
aha :-) ok, i'll give that PR a review then.