Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

suppressing specific warnings #395

Closed
ojanvafai opened this issue Sep 19, 2020 · 5 comments
Closed

suppressing specific warnings #395

ojanvafai opened this issue Sep 19, 2020 · 5 comments

Comments

@ojanvafai
Copy link

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. firebase/firebase-js-sdk#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;
@iamakulov
Copy link

Adding my voice here. I’d love to be able to suppress warnings coming from node_modules. Warnings are useful for first-party code, so I wouldn’t want to do --log-level=error. But for third-party code, they’re typically hard to fix (especially if it’s a transitive dependency) and result in noice.

@ojanvafai
Copy link
Author

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. :)

@evanw
Copy link
Owner

evanw commented Sep 23, 2020

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

@crondaemon
Copy link

crondaemon commented Feb 18, 2022

Hi,
I'm observing the very same behavior before this change:

esbuild app/javascript/*.* --bundle --sourcemap --outdir=/tmp

▲ [WARNING] "types.d.ts" is not a valid value for the "type" field

    node_modules/datatables.net-select/package.json:9:12:
      9 │     "type": "types.d.ts",
        ╵             ~~~~~~~~~~~~

  The "type" field must be set to either "commonjs" or "module".

1 warning

  ../../../../tmp/application.js      3.1mb ⚠️
  ../../../../tmp/application.js.map  4.1mb

⚡ Done in 144ms

Is there something missing, or it's me missing something?

$ npx esbuild --version
0.14.14

@evanw
Copy link
Owner

evanw commented Feb 18, 2022

This is a bug with the package. It should be types not type: https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html#including-declarations-in-your-npm-package. The package author should fix their code.

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

No branches or pull requests

4 participants