un-ts / eslint-plugin-import-x

`eslint-plugin-import-x` is a fork of `eslint-plugin-import` that aims to provide a more performant and more lightweight version of the original plugin.
https://npm.im/eslint-plugin-import-x
MIT License
368 stars 18 forks source link

import-x/namespace rule not detecting "toBuffer" in bwip-js #89

Open noahnu opened 3 months ago

noahnu commented 3 months ago

I'm using https://github.com/metafloor/bwip-js like so:

import * as bwipjs from 'bwip-js';

bwipjs.toBuffer({})

In VSCode, I see this tooltip/intellisense:

image

toBuffer is defined in the declaration file:

image

https://github.com/metafloor/bwip-js/blob/master/dist/bwip-js-node.d.ts#L192

"toBuffer" is only available in the node declaration, so I suspect this might be a case of the wrong declaration file being loaded. The bwip-js project uses package.json exports.

Environment

SukkaW commented 2 months ago

This looks like an eslint-import-resolver-typescript issue, where conditionNames includes both node and browser: https://github.com/import-js/eslint-import-resolver-typescript#conditionnames