Skip to content
This repository was archived by the owner on Jan 19, 2019. It is now read-only.

What's the recommended way to work around "is not defined" for type definitions? #466

Closed
trusktr opened this issue Apr 16, 2018 · 1 comment · Fixed by #540
Closed

What's the recommended way to work around "is not defined" for type definitions? #466

trusktr opened this issue Apr 16, 2018 · 1 comment · Fixed by #540

Comments

@trusktr
Copy link
Contributor

trusktr commented Apr 16, 2018

Hello, how can I work around the error

  ✘  http://eslint.org/docs/rules/no-undef                'NodeListOf' is not defined
  src/util.ts:10:60
      const links = document.querySelectorAll( selector ) as NodeListOf<HTMLElement>

? Do I have to use a comment to tell eslint to ignore that error on that line? Is there any other better workaround?

@futagoza
Copy link

futagoza commented Apr 17, 2018

Just put no-undef: 0 in your .eslintrc* file.

If your only using TypeScript files in a specific folder (e.g. src/), then create a new .eslintrc* file that extends the projects default one (if you have one).

mysticatea added a commit that referenced this issue Nov 8, 2018
mysticatea added a commit that referenced this issue Nov 13, 2018
* Update: add proper scope analysis (fixes #535)

* add computed-properties-in-type fixture

* add computed-properties-in-interface fixture

* add function-overload fixture

* add method-overload fixture

* add class-properties fixture

* add decorators fixture

* update visitor-keys

* add declare-global fixture

* fix typo

* add test for typeof in array destructuring

* add namespace fixture

* add declare-module fixture

* fix crash

* add declare-function.ts fixture

* add abstract-class fixture

* add typeof-in-call-signature fixture

* add test for #416

* add test for #435

* add test for #437

* add test for #443

* add test for #459

* add test for #466

* add test for #471

* add test for #487

* add test for #535

* add test for #536

* add test for #476

* fix test to use `expect()`
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants