Skip to content

Is there a recommended way to deal with the window object in TypeScript? #1617

Closed Answered by benrbowers
benrbowers asked this question in Q&A
Discussion options

You must be logged in to vote

The problem was eslint 💀

Add globals to the language options if you're using eslint.config.js:

{
  languageOptions: {
    parser: tsParser,
    parserOptions: {
      project: 'tsconfig.json',
    },
    globals: {
      window: 'readonly',
      console: 'readonly',
    },
  },
}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by benrbowers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant