Skip to content
This repository has been archived by the owner on Sep 15, 2018. It is now read-only.

Commit

Permalink
Fixed eslint errors + warning according to issue Eslint Rules #13
Browse files Browse the repository at this point in the history
  • Loading branch information
sinan-aumarah committed Jul 24, 2017
1 parent 007ef5d commit 32f26a6
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 19 deletions.
14 changes: 7 additions & 7 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ env:

rules:
arrow-body-style: 0
arrow-parens: 0
arrow-parens: "error"
class-methods-use-this: 0
func-names: 0
indent: ["warn", 2]
indent-legacy: "off"
max-len: ["error", 120]
new-cap: 0
new-cap: "warn"
no-plusplus: 0
no-return-assign: 0
no-return-assign: "error"
quote-props: 0
template-curly-spacing: [2, "always"]
comma-dangle: ["error", {
Expand All @@ -41,12 +41,12 @@ rules:
"functions": "never"
}]
jsx-quotes: [1, "prefer-single"]
react/forbid-prop-types: 0
react/forbid-prop-types: "error"
react/jsx-curly-spacing: [2, "always"]
react/jsx-filename-extension: 0
react/jsx-boolean-value: 0
react/prefer-stateless-function: 0
import/extensions: 0
import/no-extraneous-dependencies: 0
import/no-unresolved: 0
import/extensions: 'error'
import/no-extraneous-dependencies: ["error", {"devDependencies": true}]
import/no-unresolved: 'error'
import/prefer-default-export: 0
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@
"react-dom": "^15.6.1",
"react-moment": "^0.6.0",
"react-router": "^4.1.2",
"react-router-dom": "^4.1.2"
"react-router-dom": "^4.1.2",
"history": "latest"
},
"jest": {
"collectCoverageFrom": [
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/HomePage/HomePage.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { shallow } from 'enzyme';
import HomePage from './HomePage.jsx';
import HomePage from './HomePage';

describe('HomePage', () => {
test('it should display the Watch component', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/framework/components/Button/Button.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { shallow } from 'enzyme';
import Button from './Button.jsx';
import Button from './Button';

describe('Button component', () => {
const buttonId = 'button-id';
Expand Down
2 changes: 1 addition & 1 deletion src/framework/components/GenericList/GenericList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class GenericList extends React.Component {
const objToListItem = (obj, index) => {
return (
<li key={ index }>
{Object.keys(obj).map(key => {
{Object.keys(obj).map((key) => {
const value = obj[key];
return <ListItem key={ key } className='block' text={ value } label={ `${ key }: ` } />;
})}
Expand Down
2 changes: 1 addition & 1 deletion src/framework/components/GenericList/GenericList.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { shallow } from 'enzyme';
import GenericList from './GenericList.jsx';
import GenericList from './GenericList';

describe('GenericList component', () => {
describe('When a list of objects is passed to the [items] props', () => {
Expand Down
6 changes: 3 additions & 3 deletions src/framework/components/ScreenLayout/ScreenLayout.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import { Route } from 'react-router-dom';
import './screen_layout.scss';

class ScreenLayout extends React.Component {
injectHandlerMap = child => {
injectHandlerMap = (child) => {
return React.cloneElement(child, {
handlerMapper: newMap => { this.props.handlerMapper(newMap); },
handlerMapper: (newMap) => { this.props.handlerMapper(newMap); },
});
};

render() {
const wrapChild = child => {
const wrapChild = (child) => {
const clonedChild = this.injectHandlerMap(child);
if (clonedChild.props.path) {
return (<Route
Expand Down
2 changes: 1 addition & 1 deletion src/framework/components/Time/Time.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { shallow } from 'enzyme';
import Time from './Time';

describe('Time component', () => {
const composeComponent = (props) => shallow(
const composeComponent = props => shallow(
<Time { ...props } />
).find('t');

Expand Down
6 changes: 4 additions & 2 deletions src/framework/components/Watch/Watch.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { shallow } from 'enzyme';
import Watch from './Watch.jsx';
import Watch from './Watch';
import history from '../../../framework/Router/BrowserHistory';
import ScreenLayout from '../ScreenLayout/ScreenLayout';

Expand All @@ -12,7 +12,9 @@ describe('Watch component', () => {
const dummyNotificationEvent = { displayNotification: true, text: 'test' };
beforeEach(() => {
WatchComponent = shallow(
<Watch notificationEvent={ dummyNotificationEvent } />);
<Watch notificationEvent={ dummyNotificationEvent }>
<div>Mock</div>
</Watch>);
});

const verifyClickingButtonEvent = (result, resultPath) => {
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import ReactDOM from 'react-dom';

import HomePage from './app/components/HomePage/HomePage.jsx';
import HomePage from './app/components/HomePage/HomePage';

ReactDOM.render(<HomePage />, document.getElementById('root'));

0 comments on commit 32f26a6

Please sign in to comment.