2

I have been using typescript + eslint successfully for node.js. But now when I try to use it for regular client side javascript, I get this

error TS2304: Cannot find name 'alert'.

when I try to do a basic alert(1);.

How can I get it to recognize regular javascript types? Do I need to install something further?

1 Answer 1

4

I think, you should check you tsconfig.json, where you should have dom library

"compilerOptions": {
  ...
  "lib": ["es2019", "dom"],
  ...
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.