Skip to content
Browse files

Fix linter warnings

Summary:Fixes linter warnings.

Also adds linting to the CI build, but warnings still exit with `0` which doesn't cause the suite to fail. I'm not even sure whether you guys want the suite to fail on this condition; though the contributing docs asks users to make sure that the linter passes before submitting a PR.
Closes #78

Reviewed By: spicyj

Differential Revision: D2987193

fb-gh-sync-id: bfcf661be729fd9f27c65a8237973ce6ff25cb16
shipit-source-id: bfcf661be729fd9f27c65a8237973ce6ff25cb16
  • Loading branch information...
1 parent b213d5b commit 86793334d0a6a21ae0f6f0371366612d235547a7 @garbles garbles committed with Facebook Github Bot 5
Showing with 15 additions and 12 deletions.
  1. +1 −1 .travis.yml
  2. +2 −1 package.json
  3. +3 −1 src/model/immutable/ContentState.js
  4. +9 −9 src/model/immutable/__tests__/EditorState-test.js
View
2 .travis.yml
@@ -14,7 +14,7 @@ script:
if [ "$TEST_TYPE" = test ]
then
- npm test
+ npm run test-ci
elif [ "$TEST_TYPE" = build_website ]
then
View
3 package.json
@@ -23,7 +23,8 @@
"pretest": "node node_modules/fbjs-scripts/node/check-dev-engines.js package.json",
"build": "gulp",
"lint": "eslint .",
- "test": "NODE_ENV=test jest"
+ "test": "NODE_ENV=test jest",
+ "test-ci": "NODE_ENV=test npm run lint && npm run test"
},
"dependencies": {
"fbjs": "^0.8.0-alpha.1",
View
4 src/model/immutable/ContentState.js
@@ -98,7 +98,9 @@ class ContentState extends ContentStateRecord {
getPlainText(delimiter?: string): string {
return this.getBlockMap()
- .map(block => block ? block.getText() : '')
+ .map(block => {
+ return block ? block.getText() : '';
+ })
.join(delimiter || '\n');
}
View
18 src/model/immutable/__tests__/EditorState-test.js
@@ -215,9 +215,9 @@ describe('EditorState', () => {
beforeEach(() => {
Decorator.prototype.getDecorations.mockClear();
- Decorator.prototype.getDecorations.mockImplementation(
- v => v === boldBlock ? boldA : List(Repeat(undefined, v.getLength()))
- );
+ Decorator.prototype.getDecorations.mockImplementation(v => {
+ return v === boldBlock ? boldA : List(Repeat(undefined, v.getLength()));
+ });
});
it('must set a new decorator', () => {
@@ -225,13 +225,13 @@ describe('EditorState', () => {
var editorState = getDecoratedEditorState(decorator);
expect(decorator.getDecorations.mock.calls.length).toBe(2);
- Decorator.prototype.getDecorations.mockImplementation(
- v => v === boldBlock ? boldB : List(Repeat(undefined, v.getLength()))
- );
+ Decorator.prototype.getDecorations.mockImplementation(v => {
+ return v === boldBlock ? boldB : List(Repeat(undefined, v.getLength()));
+ });
var newDecorator = new NextDecorator();
- NextDecorator.prototype.getDecorations.mockImplementation(
- v => v === boldBlock ? boldB : List(Repeat(undefined, v.getLength()))
- );
+ NextDecorator.prototype.getDecorations.mockImplementation(v => {
+ return v === boldBlock ? boldB : List(Repeat(undefined, v.getLength()));
+ });
var withNewDecorator = EditorState.set(editorState, {
decorator: newDecorator,

0 comments on commit 8679333

Please sign in to comment.
Something went wrong with that request. Please try again.