This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Internal: `js-file` - add es6/module to escope options

Fixes #1875
  • Loading branch information...
hzoo committed Oct 17, 2015
1 parent da81cd6 commit 63526b73d55eed3719d79527a7a7c7490b4cd2cb
Showing with 10 additions and 1 deletion.
  1. +4 −1 lib/js-file.js
  2. +6 −0 test/specs/rules/disallow-unused-params.js
View
@@ -754,7 +754,10 @@ JsFile.prototype = {
*/
getScope: function() {
if (!this._scope) {
this._scope = escope.analyze(this._tree);
this._scope = escope.analyze(this._tree, {
ecmaVersion: 6,
sourceType: 'module'

This comment has been minimized.

Show comment
Hide comment
@markelog

markelog Oct 20, 2015

Member

nice

@markelog
});
}
return this._scope;
@@ -23,6 +23,12 @@ describe('rules/disallow-unused-params', function() {
)).to.have.no.errors();
});
it('should not error with es6 imports #1875', function() {
expect(checker.checkString(
'import one from "one"; function some() {}'
)).to.have.no.errors();
});
it('should report unused param', function() {
expect(checker.checkString(
'function fun(test) { }'

0 comments on commit 63526b7

Please sign in to comment.