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

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

Open
mo opened this issue Nov 20, 2024 · 2 comments
Open
Labels
bug Something isn't working

Comments

@mo
Copy link

mo commented Nov 20, 2024

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 mo added the bug Something isn't working label Nov 20, 2024
@mo
Copy link
Author

mo commented Nov 20, 2024

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
Copy link
Author

mo commented Nov 20, 2024

hmm, I found this comment now:
#630 (comment)

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant