Skip to content
This repository has been archived by the owner on Aug 18, 2021. It is now read-only.

variable is unused even when exported. #63

Closed
romeovs opened this issue Apr 7, 2015 · 2 comments
Closed

variable is unused even when exported. #63

romeovs opened this issue Apr 7, 2015 · 2 comments

Comments

@romeovs
Copy link

romeovs commented Apr 7, 2015

consider the following module:

export class Maybe { }

class Nothing extends Maybe {
  toString() {
    return 'Nothing';
  }
}

class Just extends Maybe 
  constructor(a) {
    this.value = a;
  }

  toString() {
    return `Just(${this.value})`;
  }
}

var nothing = new Nothing;
var just = function(val) 
  return new Just(val);
};

export { just, nothing };

babel-eslint tells me that the variables just and nothing are defined but never used (the no-unused-vars rule), although they are clearly used.

@sebmck
Copy link
Contributor

sebmck commented Apr 14, 2015

Can you please verify that this is still an issue with babel-eslint 3.0.0?

@romeovs
Copy link
Author

romeovs commented Apr 14, 2015

I can confirm the issue does not arise on babel-eslint 3.0.1. I'm closing the issue.

@romeovs romeovs closed this as completed Apr 14, 2015
iquabius added a commit to iquabius/olimat that referenced this issue Jan 28, 2019
[@typescript-eslint](https://github.com/typescript-eslint/typescript-eslint) seems to be the way to go since it actually uses TypeScript under the hood. The alternative is Babel, which "parses and strips the type information, you still need the TypeScript compiler running if you want type checking." see [babel/babel-eslint#63](babel/babel-eslint#663 (comment))

[The future of TypeScript on ESLint (Jan 2019)](https://eslint.org/blog/2019/01/future-typescript-eslint)

Closes #51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants