5

I have write js code with in ts. But now I have some lint error link this.

  4:1  error  ES2015 module syntax is preferred over custom TypeScript modules and namespaces  typescript/no-namespace
  4:1  error  Use 'namespace' instead of 'module' to declare custom TypeScript modules         typescript/prefer-namespace-keyword

I have declare like this

declare global {
  interface Window {
    aa: any;
  }
}

and use like, it will be ok, but only call lint error

if (typeof window.aa !== 'undefined') {
  // dosth
}

I can't understand the error message, and I have read the doc, but still confuse with it

qiuyuntao
  • 2,314
  • 4
  • 19
  • 24
  • Does this answer your question? [How to declare types for Cypress custom commands under typescript-eslint/no-namespace?](https://stackoverflow.com/questions/71996295/how-to-declare-types-for-cypress-custom-commands-under-typescript-eslint-no-name) – viam0Zah Oct 09 '22 at 10:08

0 Answers0