Skip to content

Commit 571f0c8

Browse files
committed
Migrate more rules, updated deps
1 parent 02848ea commit 571f0c8

File tree

11 files changed

+352
-356
lines changed

11 files changed

+352
-356
lines changed

.eslintcache

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"/Users/amila/Documents/Projects/parallel.js/lib/eval.js":{"size":272,"mtime":1477279802000,"hashOfConfig":"jeihgr","results":{"filePath":"/Users/amila/Documents/Projects/parallel.js/lib/eval.js","messages":[],"errorCount":0,"warningCount":0}},"/Users/amila/Documents/Projects/parallel.js/lib/Worker.js":{"size":647,"mtime":1477279995000,"hashOfConfig":"jeihgr","results":{"filePath":"/Users/amila/Documents/Projects/parallel.js/lib/Worker.js","messages":[],"errorCount":0,"warningCount":0}}}

package.json

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -33,34 +33,34 @@
3333
"webworkers"
3434
],
3535
"devDependencies": {
36-
"babel-eslint": "^7.0.0",
36+
"babel-eslint": "^7.1.1",
3737
"babel-plugin-add-module-exports": "^0.2.1",
3838
"babel-plugin-dev-expression": "^0.2.1",
3939
"babel-plugin-module-alias": "^1.6.0",
40-
"babel-plugin-syntax-flow": "^6.13.0",
41-
"babel-plugin-tcomb": "^0.3.19",
42-
"babel-plugin-transform-flow-strip-types": "^6.14.0",
40+
"babel-plugin-syntax-flow": "^6.18.0",
41+
"babel-plugin-tcomb": "^0.3.24",
42+
"babel-plugin-transform-flow-strip-types": "^6.21.0",
4343
"babel-plugin-transform-remove-console": "^6.8.0",
4444
"babel-plugin-transform-remove-debugger": "^6.8.0",
4545
"babel-plugin-transform-runtime": "^6.15.0",
46-
"babel-polyfill": "^6.16.0",
46+
"babel-polyfill": "^6.20.0",
4747
"babel-preset-stage-0": "^6.16.0",
48-
"babel-register": "^6.16.3",
49-
"babel-runtime": "^6.11.6",
50-
"eslint": "^3.8.1",
51-
"eslint-config-airbnb": "^12.0.0",
48+
"babel-register": "^6.18.0",
49+
"babel-runtime": "^6.20.0",
50+
"eslint": "^3.12.2",
51+
"eslint-config-airbnb": "^13.0.0",
5252
"eslint-formatter-pretty": "^1.1.0",
53-
"eslint-import-resolver-webpack": "^0.6.0",
53+
"eslint-import-resolver-webpack": "^0.8.0",
5454
"eslint-nibble-ignore": "^3.0.0",
55-
"eslint-plugin-flowtype": "^2.21.0",
56-
"eslint-plugin-flowtype-errors": "^1.5.0-alpha.1",
57-
"eslint-plugin-fp": "^2.2.0",
58-
"eslint-plugin-import": "^2.0.1",
59-
"eslint-plugin-jsx-a11y": "^2.2.3",
60-
"eslint-plugin-mocha": "^4.7.0",
61-
"eslint-plugin-promise": "^3.3.0",
62-
"eslint-plugin-react": "^6.4.1",
63-
"flow-bin": "^0.33.0",
55+
"eslint-plugin-flowtype": "^2.29.2",
56+
"eslint-plugin-flowtype-errors": "^2.0.3",
57+
"eslint-plugin-fp": "^2.3.0",
58+
"eslint-plugin-import": "^2.2.0",
59+
"eslint-plugin-jsx-a11y": "^2.0.2",
60+
"eslint-plugin-mocha": "^4.8.0",
61+
"eslint-plugin-promise": "^3.4.0",
62+
"eslint-plugin-react": "^6.8.0",
63+
"flow-bin": "^0.37.4",
6464
"flow-typed": "^2.0.0",
6565
"jasmine-node": "x",
6666
"q": "x"

test/jasmine/jasmine-html.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ jasmine.HtmlReporterHelpers.getSpecStatus = function (child) {
3636

3737
jasmine.HtmlReporterHelpers.appendToSummary = function (child, childElement) {
3838
let parentDiv = this.dom.summary;
39-
const parentSuite = (typeof child.parentSuite == 'undefined') ? 'suite' : 'parentSuite';
39+
const parentSuite = (typeof child.parentSuite === 'undefined') ? 'suite' : 'parentSuite';
4040
const parent = child[parentSuite];
4141

4242
if (parent) {
43-
if (typeof this.views.suites[parent.id] == 'undefined') {
43+
if (typeof this.views.suites[parent.id] === 'undefined') {
4444
this.views.suites[parent.id] = new jasmine.HtmlReporter.SuiteView(parent, this.dom, this.views);
4545
}
4646
parentDiv = this.views.suites[parent.id].element;

test/jasmine/jasmine.js

Lines changed: 34 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const isCommonJS = typeof window == 'undefined' && typeof exports == 'object';
1+
const isCommonJS = typeof window === 'undefined' && typeof exports === 'object';
22

33
/**
44
* Top level namespace for Jasmine, a lightweight JavaScript BDD/spec/testing framework.
@@ -616,7 +616,7 @@ if (isCommonJS) exports.xdescribe = xdescribe;
616616

617617

618618
// Provide the XMLHttpRequest class for IE 5.x-6.x:
619-
jasmine.XmlHttpRequest = (typeof XMLHttpRequest == 'undefined') ? function () {
619+
jasmine.XmlHttpRequest = (typeof XMLHttpRequest === 'undefined') ? function () {
620620
function tryIt(f) {
621621
try {
622622
return f();
@@ -625,18 +625,10 @@ jasmine.XmlHttpRequest = (typeof XMLHttpRequest == 'undefined') ? function () {
625625
return null;
626626
}
627627

628-
const xhr = tryIt(() => {
629-
return new ActiveXObject('Msxml2.XMLHTTP.6.0');
630-
}) ||
631-
tryIt(() => {
632-
return new ActiveXObject('Msxml2.XMLHTTP.3.0');
633-
}) ||
634-
tryIt(() => {
635-
return new ActiveXObject('Msxml2.XMLHTTP');
636-
}) ||
637-
tryIt(() => {
638-
return new ActiveXObject('Microsoft.XMLHTTP');
639-
});
628+
const xhr = tryIt(() => new ActiveXObject('Msxml2.XMLHTTP.6.0')) ||
629+
tryIt(() => new ActiveXObject('Msxml2.XMLHTTP.3.0')) ||
630+
tryIt(() => new ActiveXObject('Msxml2.XMLHTTP')) ||
631+
tryIt(() => new ActiveXObject('Microsoft.XMLHTTP'));
640632

641633
if (!xhr) throw new Error('This browser does not support XMLHttpRequest.');
642634

@@ -668,17 +660,15 @@ jasmine.util.formatException = function (e) {
668660
let lineNumber;
669661
if (e.line) {
670662
lineNumber = e.line;
671-
}
672-
else if (e.lineNumber) {
663+
} else if (e.lineNumber) {
673664
lineNumber = e.lineNumber;
674665
}
675666

676667
let file;
677668

678669
if (e.sourceURL) {
679670
file = e.sourceURL;
680-
}
681-
else if (e.fileName) {
671+
} else if (e.fileName) {
682672
file = e.fileName;
683673
}
684674

@@ -879,20 +869,25 @@ jasmine.Env.prototype.xit = function (desc, func) {
879869
};
880870

881871
jasmine.Env.prototype.compareRegExps_ = function (a, b, mismatchKeys, mismatchValues) {
882-
if (a.source != b.source)
883-
{ mismatchValues.push(`expected pattern /${b.source}/ is not equal to the pattern /${a.source}/`); }
872+
if (a.source != b.source) {
873+
mismatchValues.push(`expected pattern /${b.source}/ is not equal to the pattern /${a.source}/`);
874+
}
884875

885-
if (a.ignoreCase != b.ignoreCase)
886-
{ mismatchValues.push(`expected modifier i was${b.ignoreCase ? ' ' : ' not '}set and does not equal the origin modifier`); }
876+
if (a.ignoreCase != b.ignoreCase) {
877+
mismatchValues.push(`expected modifier i was${b.ignoreCase ? ' ' : ' not '}set and does not equal the origin modifier`);
878+
}
887879

888-
if (a.global != b.global)
889-
{ mismatchValues.push(`expected modifier g was${b.global ? ' ' : ' not '}set and does not equal the origin modifier`); }
880+
if (a.global != b.global) {
881+
mismatchValues.push(`expected modifier g was${b.global ? ' ' : ' not '}set and does not equal the origin modifier`);
882+
}
890883

891-
if (a.multiline != b.multiline)
892-
{ mismatchValues.push(`expected modifier m was${b.multiline ? ' ' : ' not '}set and does not equal the origin modifier`); }
884+
if (a.multiline != b.multiline) {
885+
mismatchValues.push(`expected modifier m was${b.multiline ? ' ' : ' not '}set and does not equal the origin modifier`);
886+
}
893887

894-
if (a.sticky != b.sticky)
895-
{ mismatchValues.push(`expected modifier y was${b.sticky ? ' ' : ' not '}set and does not equal the origin modifier`); }
888+
if (a.sticky != b.sticky) {
889+
mismatchValues.push(`expected modifier y was${b.sticky ? ' ' : ' not '}set and does not equal the origin modifier`);
890+
}
896891

897892
return (mismatchValues.length === 0);
898893
};
@@ -1056,8 +1051,7 @@ jasmine.Block = function (env, func, spec) {
10561051
jasmine.Block.prototype.execute = function (onComplete) {
10571052
if (!jasmine.CATCH_EXCEPTIONS) {
10581053
this.func.apply(this.spec);
1059-
}
1060-
else {
1054+
} else {
10611055
try {
10621056
this.func.apply(this.spec);
10631057
} catch (e) {
@@ -1219,7 +1213,7 @@ jasmine.Matchers.matcherFn_ = function (matcherName, matcherFunction) {
12191213
message = message[this.isNot ? 1 : 0];
12201214
}
12211215
} else {
1222-
const englishyPredicate = matcherName.replace(/[A-Z]/g, (s) => { return ` ${s.toLowerCase()}`; });
1216+
const englishyPredicate = matcherName.replace(/[A-Z]/g, (s) => ` ${s.toLowerCase()}`);
12231217
message = `Expected ${jasmine.pp(this.actual)}${this.isNot ? ' not ' : ' '}${englishyPredicate}`;
12241218
if (matcherArgs.length > 0) {
12251219
for (let i = 0; i < matcherArgs.length; i++) {
@@ -1488,7 +1482,7 @@ jasmine.Matchers.prototype.toBeCloseTo = function (expected, precision) {
14881482
jasmine.Matchers.prototype.toThrow = function (expected) {
14891483
let result = false;
14901484
let exception;
1491-
if (typeof this.actual != 'function') {
1485+
if (typeof this.actual !== 'function') {
14921486
throw new Error('Actual is not a function');
14931487
}
14941488
try {
@@ -1519,19 +1513,19 @@ jasmine.Matchers.Any = function (expectedClass) {
15191513

15201514
jasmine.Matchers.Any.prototype.jasmineMatches = function (other) {
15211515
if (this.expectedClass == String) {
1522-
return typeof other == 'string' || other instanceof String;
1516+
return typeof other === 'string' || other instanceof String;
15231517
}
15241518

15251519
if (this.expectedClass == Number) {
1526-
return typeof other == 'number' || other instanceof Number;
1520+
return typeof other === 'number' || other instanceof Number;
15271521
}
15281522

15291523
if (this.expectedClass == Function) {
1530-
return typeof other == 'function' || other instanceof Function;
1524+
return typeof other === 'function' || other instanceof Function;
15311525
}
15321526

15331527
if (this.expectedClass == Object) {
1534-
return typeof other == 'object';
1528+
return typeof other === 'object';
15351529
}
15361530

15371531
return other instanceof this.expectedClass;
@@ -1558,8 +1552,7 @@ jasmine.Matchers.ObjectContaining.prototype.jasmineMatches = function (other, mi
15581552
for (const property in this.sample) {
15591553
if (!hasKey(other, property) && hasKey(this.sample, property)) {
15601554
mismatchKeys.push(`expected has key '${property}', but missing from actual.`);
1561-
}
1562-
else if (!env.equals_(this.sample[property], other[property], mismatchKeys, mismatchValues)) {
1555+
} else if (!env.equals_(this.sample[property], other[property], mismatchKeys, mismatchValues)) {
15631556
mismatchValues.push(`'${property}' was '${other[property] ? jasmine.util.htmlEscape(other[property].toString()) : other[property]}' in expected, but was '${this.sample[property] ? jasmine.util.htmlEscape(this.sample[property].toString()) : this.sample[property]}' in actual.`);
15641557
}
15651558
}
@@ -1625,9 +1618,7 @@ jasmine.FakeTimer.prototype.runFunctionsWithinRange = function (oldMillis, nowMi
16251618
}
16261619

16271620
if (funcsToRun.length > 0) {
1628-
funcsToRun.sort((a, b) => {
1629-
return a.runAtMillis - b.runAtMillis;
1630-
});
1621+
funcsToRun.sort((a, b) => a.runAtMillis - b.runAtMillis);
16311622
for (let i = 0; i < funcsToRun.length; ++i) {
16321623
try {
16331624
const funcToRun = funcsToRun[i];
@@ -1904,7 +1895,7 @@ jasmine.PrettyPrinter.prototype.format = function (value) {
19041895
this.emitScalar(`Date(${value})`);
19051896
} else if (value.__Jasmine_been_here_before__) {
19061897
this.emitScalar(`<circular reference: ${jasmine.isArray_(value) ? 'Array' : 'Object'}>`);
1907-
} else if (jasmine.isArray_(value) || typeof value == 'object') {
1898+
} else if (jasmine.isArray_(value) || typeof value === 'object') {
19081899
value.__Jasmine_been_here_before__ = true;
19091900
if (jasmine.isArray_(value)) {
19101901
this.emitArray(value);
@@ -2466,7 +2457,7 @@ jasmine.Suite.prototype.getFullName = function () {
24662457
jasmine.Suite.prototype.finish = function (onComplete) {
24672458
this.env.reporter.reportSuiteResults(this);
24682459
this.finished = true;
2469-
if (typeof (onComplete) == 'function') {
2460+
if (typeof (onComplete) === 'function') {
24702461
onComplete();
24712462
}
24722463
};

0 commit comments

Comments
 (0)