Skip to content

Commit

Permalink
Merge pull request #472 from cggh/fixlint
Browse files Browse the repository at this point in the history
Fix the linting
  • Loading branch information
leehart authored Jul 26, 2016
2 parents 0c84103 + ce18fcb commit 3d6490f
Show file tree
Hide file tree
Showing 83 changed files with 506 additions and 377 deletions.
65 changes: 33 additions & 32 deletions webapp/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,62 +1,63 @@
module.exports = {
'rules': {
'indent': [
2,
'error',
2
],
'quotes': [
2,
'error',
'single',
'avoid-escape'
],
'linebreak-style': [
2,
'error',
'unix'
],
'semi': [
2,
'error',
'always'
],

'no-console': 0,
'no-unused-vars': [2, {'vars': 'all', 'args': 'none'}],
'array-bracket-spacing': 2,
'block-spacing': 2,
'brace-style': [2, '1tbs', {'allowSingleLine': true}],
'camelcase': 2,
'comma-spacing': 2,
'comma-style': 2,
'eol-last': 2,
'key-spacing': 2,
'no-spaced-func': 2,
'no-trailing-spaces': 2,
'object-curly-spacing': 2,
'space-before-blocks': 2,
'space-before-function-paren': [2, 'never'],
'space-infix-ops': [2, {'int32Hint': true}],
'space-unary-ops': 2,
'keyword-spacing': 2,
'no-console': 'off',
'no-unused-vars': ['error', {'vars': 'all', 'args': 'none'}],
'array-bracket-spacing': 'error',
'block-spacing': 'error',
'brace-style': ['error', '1tbs', {'allowSingleLine': true}],
'camelcase': 'error',
'comma-spacing': 'error',
'comma-style': 'error',
'eol-last': 'error',
'key-spacing': 'error',
'no-spaced-func': 'error',
'no-trailing-spaces': 'error',
'object-curly-spacing': 'error',
'space-before-blocks': 'error',
'space-before-function-paren': ['error', 'never'],
'space-infix-ops': ['error', {'int32Hint': true}],
'space-unary-ops': 'error',
'keyword-spacing': 'error',
'jsx-quotes': [
2,
'error',
'prefer-double'
],

//'new-cap': 2, //Disabled as lots of legacy DQX uses caps
'arrow-body-style': 2,
'arrow-parens': 2,
'arrow-spacing': 2,
'no-const-assign': 2,
'no-dupe-class-members': 2,
'no-var': 2,
'prefer-arrow-callback': 2
// 'new-cap': 'error', //Disabled as lots of legacy DQX uses caps
'arrow-body-style': 'error',
'arrow-parens': 'error',
'arrow-spacing': 'error',
'no-const-assign': 'error',
'no-dupe-class-members': 'error',
'no-var': 'error',
'prefer-arrow-callback': 'error',
'no-cond-assign': 'error',

},
'env': {
'es6': true,
'browser': true,
'commonjs': true
},
'extends': 'eslint:recommended',
'extends': ["eslint:recommended", "plugin:react/recommended"],
'parserOptions': {
'ecmaVersion': 6,
'sourceType': "module",
Expand Down
4 changes: 2 additions & 2 deletions webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"babel-preset-react": "^6.5.0",
"babel-preset-stage-1": "^6.5.0",
"css-loader": "^0.23.1",
"eslint": "^3.0.1",
"eslint-plugin-react": "^5.0.1",
"eslint": "^3.1.1",
"eslint-plugin-react": "^5.2.2",
"file-loader": "^0.9.0",
"gulp": "^3.9.1",
"gulp-util": "^3.0.7",
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/js/actions/APIActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ let APIActions = {
})
.catch((error) => {
this.dispatch(APICONST.MODIFY_CONFIG_FAIL);
ErrorReport(this.flux, error.message, () => this.flux.actions.api.modifyConfig(payload));
ErrorReport(this.flux, error.message, () => this.flux.actions.api.modifyConfig(options));
});
}

Expand Down
4 changes: 3 additions & 1 deletion webapp/src/js/components/DatasetImportStatus/ItemView.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ let DatasetImportStatusItemView = React.createClass({
],

propTypes: {
logId: React.PropTypes.string.isRequired
logId: React.PropTypes.string.isRequired,
title: React.PropTypes.string,
icon: React.PropTypes.string
},

getInitialState() {
Expand Down
12 changes: 5 additions & 7 deletions webapp/src/js/components/DatasetImportStatus/ListView.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
import React from 'react';
import Immutable from 'immutable';
import ImmutablePropTypes from 'react-immutable-proptypes';
import classNames from 'classnames';
import Color from 'color';
import _throttle from 'lodash/throttle';

// Mixins
import PureRenderMixin from 'mixins/PureRenderMixin';
Expand All @@ -12,7 +7,6 @@ import ConfigMixin from 'mixins/ConfigMixin';

// Panoptes components
import API from 'panoptes/API';
import LRUCache from 'util/LRUCache';
import ErrorReport from 'panoptes/ErrorReporter';

// UI components
Expand All @@ -33,6 +27,10 @@ let DatasetImportStatusListView = React.createClass({
ConfigMixin
],

propTypes: {
refreshMilliseconds: React.PropTypes.number,
},

getInitialState() {
return {
rows: [],
Expand Down Expand Up @@ -64,7 +62,7 @@ let DatasetImportStatusListView = React.createClass({
API.fetchImportStatusData({cancellation: componentCancellation, ...APIargs})
)
.then((data) => {
this.setState({
this.setState({
loadStatus: 'loaded',
rows: data
});
Expand Down
7 changes: 6 additions & 1 deletion webapp/src/js/components/Panoptes.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from 'react';
import Immutable from 'immutable';
import NotificationSystem from 'react-notification-system';

// Mixins
Expand Down Expand Up @@ -155,6 +154,12 @@ let Header = React.createClass({
FluxMixin
],

propTypes: {
name: React.PropTypes.string,
userID: React.PropTypes.string,
logo: React.PropTypes.string
},

render() {
let {name, userID, logo} = this.props;
let actions = this.getFlux().actions;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from 'react';
import ReactDOM from 'react-dom';
import Immutable from 'immutable';
import ImmutablePropTypes from 'react-immutable-proptypes';
import Sidebar from 'react-sidebar';
Expand Down
4 changes: 0 additions & 4 deletions webapp/src/js/components/containers/EmptyTab.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
import _map from 'lodash/map';
import React from 'react';

import PureRenderMixin from 'mixins/PureRenderMixin';
import FluxMixin from 'mixins/FluxMixin';

import {List, ListItem} from 'material-ui/List';
import Subheader from 'material-ui/Subheader';
import Icon from 'ui/Icon';
import ViewList from 'panoptes/ViewList';
import TableList from 'panoptes/TableList';

Expand Down
10 changes: 6 additions & 4 deletions webapp/src/js/components/containers/FindGene.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
import _isFunction from 'lodash/isFunction';


// Mixins
import PureRenderMixin from 'mixins/PureRenderMixin';
Expand All @@ -26,7 +23,12 @@ let FindGene = React.createClass({

propTypes: {
componentUpdate: React.PropTypes.func.isRequired,
activeTab: React.PropTypes.string
activeTab: React.PropTypes.string,
search: React.PropTypes.string,
chromosome: React.PropTypes.string,
startPosition: React.PropTypes.number,
endPosition: React.PropTypes.number,
chromosomeLength: React.PropTypes.number,
},

getDefaultProps: function() {
Expand Down
11 changes: 6 additions & 5 deletions webapp/src/js/components/containers/FindGeneByRegion.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ let FindGeneByRegion = React.createClass({

propTypes: {
componentUpdate: React.PropTypes.func.isRequired,
activeTab: React.PropTypes.string
activeTab: React.PropTypes.string,
search: React.PropTypes.string,
chromosome: React.PropTypes.string,
startPosition: React.PropTypes.number,
endPosition: React.PropTypes.number,
chromosomeLength: React.PropTypes.number,
},

getDefaultProps() {
Expand All @@ -50,10 +55,6 @@ let FindGeneByRegion = React.createClass({
};
},

title() {
return this.props.title;
},

componentWillMount() {
this.props.componentUpdate({'endPosition': parseInt(this.config.chromosomes[this.props.chromosome].len)});
},
Expand Down
6 changes: 6 additions & 0 deletions webapp/src/js/components/containers/Finder.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ let Finder = React.createClass({
ConfigMixin
],

propTypes: {
icon: React.PropTypes.string,
title: React.PropTypes.string,
},


getDefaultProps() {
return {
title: 'Find',
Expand Down
Loading

0 comments on commit 3d6490f

Please sign in to comment.