Skip to content

Commit 94ae1fc

Browse files
committed
small lint fix
1 parent 1f403d8 commit 94ae1fc

File tree

8 files changed

+14
-23
lines changed

8 files changed

+14
-23
lines changed

karma.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ module.exports = function (config) {
1919
],
2020

2121
preprocessors: {
22-
"test/index.js": ["webpack", "sourcemap",],
22+
"test/index.js": ["webpack", "sourcemap"],
2323
},
2424

2525
webpack: webpackConfig,

src/recaptcha-wrapper.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
"use strict";
2-
import React, { PropTypes } from "react";
3-
42
import ReCAPTCHA from "./recaptcha";
53
import makeAsyncScriptLoader from "react-async-script";
64

src/recaptcha.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
/*global grecaptcha*/
21
"use strict";
32
import React, { PropTypes } from "react";
43

54
const ReCAPTCHA = React.createClass({
6-
displayName: "react-reCAPTCHA",
5+
displayName: "reCAPTCHA",
76
propTypes: {
87
sitekey: PropTypes.string.isRequired,
98
onChange: PropTypes.func.isRequired,
9+
grecaptcha: PropTypes.object,
1010
theme: PropTypes.oneOf(["dark", "light"]),
1111
type: PropTypes.oneOf(["image", "audio"]),
1212
tabindex: PropTypes.number,

test/recaptcha-spec.js

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ describe("ReCAPTCHA", function () {
1212

1313
it("Rendered Component should be a div", function () {
1414
let instance = ReactTestUtils.renderIntoDocument(
15-
<ReCAPTCHA siteKey="xxx" onloadCallbackName={callbackName} />
15+
<ReCAPTCHA sitekey="xxx" onloadCallbackName={callbackName} />
1616
);
1717
assert.equal(instance.getDOMNode().nodeName, "DIV");
1818
});
@@ -21,29 +21,25 @@ describe("ReCAPTCHA", function () {
2121
className: "TheClassName",
2222
id: "superdefinedId",
2323
};
24-
let className = "TheClassName";
2524
let instance = ReactTestUtils.renderIntoDocument(
26-
<ReCAPTCHA siteKey="xxx" {...props} />
25+
<ReCAPTCHA sitekey="xxx" {...props} />
2726
);
2827
assert.equal(instance.getDOMNode().id, props.id);
2928
assert.match(instance.getDOMNode().className, new RegExp(props.className));
3029
});
3130

32-
it("should register a callback on the window when grecaptcha is not loaded", function () {
33-
let instance = ReactTestUtils.renderIntoDocument(
34-
<ReCAPTCHA siteKey="xxx" />
35-
);
36-
assert.isNotNull(window[callbackName]);
37-
});
3831
it("should call grecaptcha.render, when it is already loaded", function (done) {
3932
let grecaptchaMock = {
40-
render() {
33+
render(node, options) {
34+
assert.isNotNull(node);
35+
assert.equal(options.sitekey, "xxx");
4136
done();
4237
},
4338
};
4439
let instance = ReactTestUtils.renderIntoDocument(
45-
<ReCAPTCHA siteKey="xxx" grecaptcha={grecaptchaMock} />
40+
<ReCAPTCHA sitekey="xxx" grecaptcha={grecaptchaMock} />
4641
);
42+
assert.ok(instance);
4743
});
4844
it("reset, should call grecaptcha.reset with the widget id", function (done) {
4945
let grecaptchaMock = {
@@ -57,7 +53,7 @@ describe("ReCAPTCHA", function () {
5753
},
5854
};
5955
let instance = ReactTestUtils.renderIntoDocument(
60-
<ReCAPTCHA siteKey="xxx" grecaptcha={grecaptchaMock} />
56+
<ReCAPTCHA sitekey="xxx" grecaptcha={grecaptchaMock} />
6157
);
6258
instance.reset();
6359
});

tools/build.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
/* eslint no-process-exit: 0 */
22
import "colors";
3-
import path from "path";
43
import lib from "./lib/build";
5-
import { exec, spawn } from "child-process-promise";
64

75
export default function Build(noExitOnFailure) {
86
let result = Promise.all([

tools/lib/build.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import "colors";
22
import path from "path";
3-
import fsp from "fs-promise";
4-
import { exec, spawn } from "child-process-promise";
3+
import { exec } from "child-process-promise";
54

65
const repoRoot = path.resolve(__dirname, "../../");
76
const lib = path.join(repoRoot, "lib");

webpack/strategies/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ export default (config, options) => {
1414
return config;
1515
}
1616
return config;
17-
}
17+
};

webpack/webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,4 @@ export default (options) => {
6060
return strategies.reduce((conf, strategy) => {
6161
return strategy(conf, options);
6262
}, config);
63-
}
63+
};

0 commit comments

Comments
 (0)