Esbuild: suppressing specific warnings

Created on 19 Sep 2020  路  3Comments  路  Source: evanw/esbuild

Is there a way to suppress specific warnings or classes of warnings?

I get a -0 comparison warning when compiling firestore. This warning seems reasonable and I've filed an issue with firestore. The -0 is unnecessary, but the code isn't technically incorrect in their case. Regardless, not getting my hopes up that they will fix it. https://github.com/firebase/firebase-js-sdk/issues/3814

node_modules/@firebase/firestore/dist/index.cjs.js:718:11: warning: Comparison with -0 using the === operator will also match 0
    return -0 === t && 1 / t == -1 / 0;

Most helpful comment

I've decided to suppress warnings like this coming from node_modules by default.

All 3 comments

Adding my voice here. I鈥檇 love to be able to suppress warnings coming from node_modules. Warnings _are_ useful for first-party code, so I wouldn鈥檛 want to do --log-level=error. But for third-party code, they鈥檙e typically hard to fix (especially if it鈥檚 a transitive dependency) and result in noice.

For what it's worth, I just filtered the warning out with an esbuild wrapper and it looks like firebase has fixed the issue (in 3 days!!). I'd consider this pretty low priority. But I can easily imagine having a lot of warnings and that being less tenable. Will leave open for you to decide what to do with @evanw. While this feels useful, I also wouldn't be offended at all if you just closed this. :)

I've decided to suppress warnings like this coming from node_modules by default.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vforsh picture vforsh  路  3Comments

iamakulov picture iamakulov  路  4Comments

frandiox picture frandiox  路  3Comments

fannheyward picture fannheyward  路  4Comments

aelbore picture aelbore  路  4Comments