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
[no-undef] Exported interface is marked as unused #131
Comments
Make sure you’ve enabled the |
That would avoid the unused-import warning but the type is actually used. Note the second error. |
Does installing the latest |
I just updated the code to do that. Same error though. |
Could you please chuck a succinct repl case into the OP? It's a bit hard for us to reproduce and fix the issue if we have to checkout your entire repo to investigate. |
I'm assume |
Reviewing the source for |
Cool, cool. Still need the REPL demo then? |
@bradzacher to be precise, non of "type" nodes are not added to scope, |
Any update? |
I would suggest not using no-undef on typescript code. We'll look into a fix, though it will not be soon. |
^ Yes, makes sense. 👍 |
Same issue here. Below is my code, it is allowed by typescript, but the linter deny it.
linter error:
|
During the termbox hike and now in the data-bridge hike was mentioned, that it would benefical to get the eslint settings from a dedicated place. To make this happen this patch makes some initial aligments to the existing config in termbox and will use the same config in data-bridge as well. This will be a also the base for a upcomming pull request to https://github.com/wikimedia/eslint-config-wikimedia. It also algines with https://eslint.org/docs/user-guide/configuring#configuration-file-formats in terms of not using deprecated formats anymore. See also: I2df9b5e31d90546db458e9c8dfabb0d3601b2434 and: I22115b36ea4864ff98761c5ba9e842316b1e5329 Note: This pathc contains a workaround for the "no-undef" issue. For tracking or futher reading see: typescript-eslint/typescript-eslint#131 and eslint/typescript-eslint-parser#437 Bug: T225952 Change-Id: I6c635edb9c75cc79031bcda5d0c7619ba2218a4d
We're running into this same issue. And, unfortunately, TypeScript does not catch the undefined globals because in this case we're dealing with JQuery. In the type defs for JQuery, it is declared as a global, so TypeScript ignores references to it. For various reasons, we're trying to move to locally importing JQuery in our files, so the The workaround for the moment, was to move the type it was complaining about to being a global type def in a |
This comment has been minimized.
This comment has been minimized.
Merging into #1856 |
What code were you trying to parse?
https://github.com/timdp/standard-typescript-interfaces
What did you expect to happen?
I'm trying to use Standard with TypeScript.
The compiler allows me to export an interface from
types.ts
and import it intoindex.ts
, but the linter and formatter complain.My goal is actually to create a shared
types
package in a monorepo, but I've simplified it to a plain old module.I'm well aware that interfaces don't exist in JavaScript, but given that
tsc
allows me to do this, ESLint should understand it as well, right?What actually happened?
Versions
@typescript-eslint/parser
1.1.0
TypeScript
3.2.4
ESLint
5.4.0
node
10.15.0
npm
yarn
1.13.0
The text was updated successfully, but these errors were encountered: