Skip to content

Commit a48cb5f

Browse files
authored
Merge pull request #8 from sabeurthabti/master
fix linting errors
2 parents 3c6296a + 1873cf9 commit a48cb5f

File tree

5 files changed

+9
-4
lines changed

5 files changed

+9
-4
lines changed

.eslintrc-node

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ extends:
44
ecmaFeatures:
55
modules: false
66
rules:
7+
"filenames/filenames": 0
78
"func-style":
89
- 0
910
- declaration
1011
"object-shorthand":
1112
- 0
1213
"no-extra-parens":
13-
- 0
14+
- 0

.eslintrc-test

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ rules:
1313
"no-unused-expressions": 0 # for `chai.expect`
1414
"max-len": [2, 150, 2, {ignorePattern: "^\\s*(?:it|describe)\\(.*"}]
1515
"max-statements": 0
16+
"filenames/filenames": 0
1617
"max-nested-callbacks": 0
1718
"prefer-arrow-callback": 0
1819
"func-style":

lib/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
const Module = require("module");
44
const require_ = Module.prototype.require;
55
const InstantiateReactComponent = require("react/lib/instantiateReactComponent");
6-
const EscapeTextContentForBrowser = require("react/lib/escapeTextContentForBrowser");
6+
const escapeTextContentForBrowser = require("react/lib/escapeTextContentForBrowser");
77

88
const get = require("lodash/get");
99
const set = require("lodash/set");
@@ -87,7 +87,7 @@ class InstantiateReactComponentOptimizer {
8787
templateAttrs.forEach((attrKey) => {
8888
const _attrKey = attrKey.replace(".", "__");
8989
set(curEl.props, attrKey, templateAttrValues[_attrKey]);
90-
templateAttrValues[_attrKey] = EscapeTextContentForBrowser(templateAttrValues[_attrKey]);
90+
templateAttrValues[_attrKey] = escapeTextContentForBrowser(templateAttrValues[_attrKey]);
9191
});
9292
return compiled(templateAttrValues);
9393
};

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"chai": "^3.5.0",
3737
"eslint": "^1.10.3",
3838
"eslint-config-defaults": "^8.0.1",
39+
"eslint-plugin-filenames": "^1.1.0",
3940
"intercept-stdout": "^0.1.2",
4041
"istanbul": "^0.4.3",
4142
"mocha": "^2.4.5",

test/spec/index.spec.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,7 @@ describe("react-component-cache", function () {
311311
});
312312

313313
it("should templatize properly even when prop names overlap with '_'", () => {
314+
/*eslint-disable camelcase*/
314315
clearRequireCache();
315316

316317
let renderCount = 0;
@@ -333,13 +334,14 @@ describe("react-component-cache", function () {
333334
}
334335
}
335336

336-
let props = {foo: {bar: "Hello World X!"}, foo_bar: "Hello World Y!"};
337+
const props = {foo: {bar: "Hello World X!"}, foo_bar: "Hello World Y!"};
337338
// Cache Miss
338339
expect(ReactDomServer.renderToString(React.createFactory(HelloWorld)(props))).to.contains("Hello World X!");
339340
expect(renderCount).to.equal(1);
340341
// Cache Hit
341342
expect(ReactDomServer.renderToString(React.createFactory(HelloWorld)(props))).to.contains("Hello World Y!");
342343
expect(renderCount).to.equal(1);
344+
/*eslint-enable camelcase*/
343345
});
344346

345347
it("should should throw error when templateAttr is function or object", () => {

0 commit comments

Comments
 (0)