denoland / deno_lint

Blazing fast linter for JavaScript and TypeScript written in Rust
https://lint.deno.land/
MIT License
1.55k stars 174 forks source link

deno lint doesn't detect that I forgot to import "foo" before calling foo() #1342

Open mo opened 6 days ago

mo commented 6 days ago

image

echo -e "foo()\nlet x" > test.js deno lint test.js

Deno lint finds the unused "x" but it doesn't warn me that I forgot to import foo().

If I try eslint (npx eslint test.js) instead, it immediately says: 1:1 error 'foo' is not defined no-undef

i'm using deno 2.0.6

mo commented 6 days ago

I also did "deno lint --rules" and "no-undef" was NOT included in the list on available rules. However, when I added it to my deno.json it started to work properly. How are newcomers to deno project supposed to understand this?

  "lint": {
    "rules": {
      "include": [
        "no-undef"
      ]
    }
  },
mo commented 6 days ago

hmm, I found this comment now: https://github.com/denoland/deno_lint/issues/630#issuecomment-810286231

...what were the arguments against no-undef in recommended?