Skip to content
This repository was archived by the owner on Aug 15, 2024. It is now read-only.

Commit 8039bdd

Browse files
author
Kai Cataldo
committed
Upgrade: Update dependencies
1 parent 5d2ec4f commit 8039bdd

19 files changed

+199
-210
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
!.eslintrc.js

.eslintrc.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"use strict";
2+
3+
module.exports = {
4+
root: true,
5+
extends: [
6+
"eslint"
7+
],
8+
overrides: [
9+
{
10+
files: ["tests/**/*"],
11+
env: {
12+
mocha: true
13+
}
14+
}
15+
]
16+
};

.eslintrc.yml

Lines changed: 0 additions & 7 deletions
This file was deleted.

Makefile.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,6 @@ target.test = function() {
8484
let errors = 0;
8585
const lastReturn = exec(`${ISTANBUL} cover ${MOCHA} -- -R progress -c ${TEST_FILES}`);
8686

87-
88-
8987
if (lastReturn.code !== 0) {
9088
errors++;
9189
}
@@ -131,8 +129,7 @@ target.checkLicenses = function() {
131129
impermissible.forEach(dependency => {
132130
console.error("%s license for %s is impermissible.",
133131
dependency.licenses,
134-
dependency.name
135-
);
132+
dependency.name);
136133
});
137134
exit(1);
138135
}

lib/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ function defaultOptions() {
6868
directive: false,
6969
nodejsScope: false,
7070
impliedStrict: false,
71-
sourceType: "script", // one of ['script', 'module']
71+
sourceType: "script", // one of ['script', 'module']
7272
ecmaVersion: 5,
7373
childVisitorKeys: null,
7474
fallback: "iteration"
@@ -93,7 +93,7 @@ function updateDeeply(target, override) {
9393
}
9494

9595
for (const key in override) {
96-
if (override.hasOwnProperty(key)) {
96+
if (Object.prototype.hasOwnProperty.call(override, key)) {
9797
const val = override[key];
9898

9999
if (isHashObject(val)) {

lib/referencer.js

Lines changed: 33 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class Importer extends esrecurse.Visitor {
8181
this.declaration,
8282
null,
8383
null
84-
));
84+
));
8585
});
8686
}
8787

@@ -151,20 +151,26 @@ class Referencer extends esrecurse.Visitor {
151151
assignment.right,
152152
maybeImplicitGlobal,
153153
pattern !== assignment.left,
154-
init);
154+
init
155+
);
155156
});
156157
}
157158

158159
visitPattern(node, options, callback) {
160+
let visitPatternOptions = options;
161+
let visitPatternCallback = callback;
162+
159163
if (typeof options === "function") {
160-
callback = options;
161-
options = { processRightHandNodes: false };
164+
visitPatternCallback = options;
165+
visitPatternOptions = { processRightHandNodes: false };
162166
}
167+
163168
traverseIdentifierInPattern(
164169
this.options,
165170
node,
166-
options.processRightHandNodes ? this : null,
167-
callback);
171+
visitPatternOptions.processRightHandNodes ? this : null,
172+
visitPatternCallback
173+
);
168174
}
169175

170176
visitFunction(node) {
@@ -180,14 +186,14 @@ class Referencer extends esrecurse.Visitor {
180186

181187
// id is defined in upper scope
182188
this.currentScope().__define(node.id,
183-
new Definition(
184-
Variable.FunctionName,
185-
node.id,
186-
node,
187-
null,
188-
null,
189-
null
190-
));
189+
new Definition(
190+
Variable.FunctionName,
191+
node.id,
192+
node,
193+
null,
194+
null,
195+
null
196+
));
191197
}
192198

193199
// FunctionExpression with name creates its special scope;
@@ -258,14 +264,14 @@ class Referencer extends esrecurse.Visitor {
258264
visitClass(node) {
259265
if (node.type === Syntax.ClassDeclaration) {
260266
this.currentScope().__define(node.id,
261-
new Definition(
262-
Variable.ClassName,
263-
node.id,
264-
node,
265-
null,
266-
null,
267-
null
268-
));
267+
new Definition(
268+
Variable.ClassName,
269+
node.id,
270+
node,
271+
null,
272+
null,
273+
null
274+
));
269275
}
270276

271277
this.visit(node.superClass);
@@ -274,11 +280,11 @@ class Referencer extends esrecurse.Visitor {
274280

275281
if (node.id) {
276282
this.currentScope().__define(node.id,
277-
new Definition(
278-
Variable.ClassName,
279-
node.id,
280-
node
281-
));
283+
new Definition(
284+
Variable.ClassName,
285+
node.id,
286+
node
287+
));
282288
}
283289
this.visit(node.body);
284290

lib/scope.js

Lines changed: 46 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ class Scope {
161161
*/
162162
this.type = type;
163163

164-
/**
164+
/**
165165
* The scoped {@link Variable}s of this scope, as <code>{ Variable.name
166166
* : Variable }</code>.
167167
* @member {Map} Scope#set
@@ -192,21 +192,21 @@ class Scope {
192192
*/
193193
this.block = block;
194194

195-
/**
195+
/**
196196
* The {@link Reference|references} that are not resolved with this scope.
197197
* @member {Reference[]} Scope#through
198198
*/
199199
this.through = [];
200200

201-
/**
201+
/**
202202
* The scoped {@link Variable}s of this scope. In the case of a
203203
* 'function' scope this includes the automatic argument <em>arguments</em> as
204204
* its first element, as well as all further formal arguments.
205205
* @member {Variable[]} Scope#variables
206206
*/
207207
this.variables = [];
208208

209-
/**
209+
/**
210210
* Any variable {@link Reference|reference} found in this scope. This
211211
* includes occurrences of local variables as well as variables from
212212
* parent scopes (including the global scope). For local variables
@@ -217,7 +217,7 @@ class Scope {
217217
*/
218218
this.references = [];
219219

220-
/**
220+
/**
221221
* For 'global' and 'function' scopes, this is a self-reference. For
222222
* other scope types this is the <em>variableScope</em> value of the
223223
* parent scope.
@@ -226,38 +226,38 @@ class Scope {
226226
this.variableScope =
227227
(this.type === "global" || this.type === "function" || this.type === "module") ? this : upperScope.variableScope;
228228

229-
/**
229+
/**
230230
* Whether this scope is created by a FunctionExpression.
231231
* @member {boolean} Scope#functionExpressionScope
232232
*/
233233
this.functionExpressionScope = false;
234234

235-
/**
235+
/**
236236
* Whether this is a scope that contains an 'eval()' invocation.
237237
* @member {boolean} Scope#directCallToEvalScope
238238
*/
239239
this.directCallToEvalScope = false;
240240

241-
/**
241+
/**
242242
* @member {boolean} Scope#thisFound
243243
*/
244244
this.thisFound = false;
245245

246246
this.__left = [];
247247

248-
/**
248+
/**
249249
* Reference to the parent {@link Scope|scope}.
250250
* @member {Scope} Scope#upper
251251
*/
252252
this.upper = upperScope;
253253

254-
/**
254+
/**
255255
* Whether 'use strict' is in effect in this scope.
256256
* @member {boolean} Scope#isStrict
257257
*/
258258
this.isStrict = isStrictScope(this, block, isMethodDefinition, scopeManager.__useDirective());
259259

260-
/**
260+
/**
261261
* List of nested {@link Scope}s.
262262
* @member {Scope[]} Scope#childScopes
263263
*/
@@ -414,11 +414,12 @@ class Scope {
414414
__define(node, def) {
415415
if (node && node.type === Syntax.Identifier) {
416416
this.__defineGeneric(
417-
node.name,
418-
this.set,
419-
this.variables,
420-
node,
421-
def);
417+
node.name,
418+
this.set,
419+
this.variables,
420+
node,
421+
def
422+
);
422423
}
423424
}
424425

@@ -550,14 +551,14 @@ class GlobalScope extends Scope {
550551
const info = implicit[i];
551552

552553
this.__defineImplicit(info.pattern,
553-
new Definition(
554-
Variable.ImplicitGlobalVariable,
555-
info.pattern,
556-
info.node,
557-
null,
558-
null,
559-
null
560-
));
554+
new Definition(
555+
Variable.ImplicitGlobalVariable,
556+
info.pattern,
557+
info.node,
558+
null,
559+
null,
560+
null
561+
));
561562

562563
}
563564

@@ -569,11 +570,12 @@ class GlobalScope extends Scope {
569570
__defineImplicit(node, def) {
570571
if (node && node.type === Syntax.Identifier) {
571572
this.__defineGeneric(
572-
node.name,
573-
this.implicit.set,
574-
this.implicit.variables,
575-
node,
576-
def);
573+
node.name,
574+
this.implicit.set,
575+
this.implicit.variables,
576+
node,
577+
def
578+
);
577579
}
578580
}
579581
}
@@ -588,14 +590,14 @@ class FunctionExpressionNameScope extends Scope {
588590
constructor(scopeManager, upperScope, block) {
589591
super(scopeManager, "function-expression-name", upperScope, block, false);
590592
this.__define(block.id,
591-
new Definition(
592-
Variable.FunctionName,
593-
block.id,
594-
block,
595-
null,
596-
null,
597-
null
598-
));
593+
new Definition(
594+
Variable.FunctionName,
595+
block.id,
596+
block,
597+
null,
598+
null,
599+
null
600+
));
599601
this.functionExpressionScope = true;
600602
}
601603
}
@@ -684,11 +686,12 @@ class FunctionScope extends Scope {
684686

685687
__defineArguments() {
686688
this.__defineGeneric(
687-
"arguments",
688-
this.set,
689-
this.variables,
690-
null,
691-
null);
689+
"arguments",
690+
this.set,
691+
this.variables,
692+
null,
693+
null
694+
);
692695
this.taints.set("arguments", true);
693696
}
694697

@@ -710,7 +713,7 @@ class FunctionScope extends Scope {
710713
// It's invalid resolution in the following case:
711714
return !(
712715
variable.scope === this &&
713-
ref.identifier.range[0] < bodyStart && // the reference is in the parameter part.
716+
ref.identifier.range[0] < bodyStart && // the reference is in the parameter part.
714717
variable.defs.every(d => d.name.range[0] >= bodyStart) // the variable is in the body.
715718
);
716719
}

package.json

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,17 @@
3131
"estraverse": "^4.1.1"
3232
},
3333
"devDependencies": {
34-
"chai": "^3.4.1",
35-
"eslint": "^3.15.0",
36-
"eslint-config-eslint": "^4.0.0",
34+
"@typescript-eslint/parser": "^1.11.0",
35+
"chai": "^4.2.0",
36+
"eslint": "^6.0.1",
37+
"eslint-config-eslint": "^5.0.1",
38+
"eslint-plugin-node": "^9.1.0",
3739
"eslint-release": "^1.0.0",
38-
"espree": "^3.1.1",
40+
"espree": "^6.0.0",
3941
"istanbul": "^0.4.5",
40-
"mocha": "^3.2.0",
42+
"mocha": "^6.1.4",
4143
"npm-license": "^0.3.3",
42-
"shelljs": "^0.7.6",
43-
"typescript": "~2.0.10",
44-
"typescript-eslint-parser": "^1.0.0"
44+
"shelljs": "^0.8.3",
45+
"typescript": "^3.5.2"
4546
}
4647
}

tests/.eslintrc.yml

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)