Skip to content

Commit 24fc760

Browse files
committed
fix eslint
1 parent 7dbee71 commit 24fc760

File tree

252 files changed

+1281
-1238
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

252 files changed

+1281
-1238
lines changed

.eslintrc

Lines changed: 14 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
{
2-
"parser": "babel-eslint",
3-
"extends": [
4-
"airbnb"
5-
],
6-
"plugins": [
7-
"babel"
8-
],
2+
"extends": "eslint-config-topcoder/react",
93
"env": {
104
"browser": true,
115
"mocha": true
@@ -17,27 +11,20 @@
1711
"google": true,
1812
},
1913
"rules": {
20-
"global-require": 0,
21-
"no-script-url": 0,
14+
"import/no-unresolved": [2, { ignore: ['^components/', '^containers/', '^services/', '^layouts/', '^store/', '^api/', '^routes/'] }],
15+
16+
// temporary for in-progress features
17+
"no-alert": 0,
18+
19+
// disable for unit tests
20+
"no-unused-expressions": 0,
21+
22+
// relax rules
23+
"no-magic-numbers": 0,
2224
"max-len": 0,
23-
"new-cap": 0,
24-
"object-curly-spacing": ["error", "always"],
2525
"react/jsx-no-bind": 0,
26-
"no-mixed-operators": 0,
27-
"arrow-parens": [
28-
2,
29-
"always"
30-
],
31-
"import/extensions": 0,
32-
"import/no-unresolved": 0,
33-
"import/no-named-as-default": 0,
34-
"import/no-extraneous-dependencies": 0,
35-
"no-underscore-dangle": 0,
36-
"react/forbid-prop-types": 0,
37-
"no-unused-expressions": 0,
38-
"jsx-a11y/anchor-has-content": 0,
39-
"no-plusplus": 0,
40-
"jsx-a11y/no-static-element-interactions": 0,
41-
"no-use-before-define": ["error", { "functions": false, "classes": true }],
26+
"import/order": 0,
27+
"import/imports-first": 0,
28+
"no-restricted-syntax": 0,
4229
}
4330
}

package.json

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,7 @@
6666
"react-dropdown": "^1.2.0",
6767
"react-icheck": "^0.3.6",
6868
"react-input-range": "^0.9.3",
69-
"react-modal": "^1.6.2",
70-
"react-flexbox-grid": "^0.10.2",
7169
"react-highcharts": "^11.0.0",
72-
"react-modal": "^1.5.2",
7370
"react-redux": "^4.0.0",
7471
"react-redux-toastr": "^4.2.2",
7572
"react-router": "^2.8.1",
@@ -100,15 +97,13 @@
10097
"yargs": "^4.0.0"
10198
},
10299
"devDependencies": {
100+
"babel-eslint": "^7.1.1",
103101
"chai": "^3.5.0",
104102
"css-modules-require-hook": "^4.0.5",
105103
"enzyme": "^2.6.0",
106-
"eslint": "^3.7.1",
107-
"eslint-config-airbnb": "^12.0.0",
108-
"eslint-plugin-babel": "^3.3.0",
109-
"eslint-plugin-import": "^1.16.0",
110-
"eslint-plugin-jsx-a11y": "^2.2.2",
111-
"eslint-plugin-react": "^6.3.0",
104+
"eslint-config-topcoder": "^1.8.0",
105+
"eslint-plugin-babel": "^4.0.0",
106+
"eslint-plugin-react": "^6.8.0",
112107
"jsdom": "^9.8.3",
113108
"mocha": "^3.2.0",
114109
"mocha-webpack": "^0.7.0",

server.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
/* eslint import/no-commonjs: 0 */
2+
13
/**
24
* Http server for serving the frontend files
35
*/
46

7+
const path = require('path');
58
const express = require('express');
69
const webpack = require('webpack');
7-
const path = require('path');
810
const config = require('config');
911
const webpackConfig = require('./webpack.config');
1012

setup-test.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* eslint import/no-commonjs: 0 */
2+
13
const hook = require('css-modules-require-hook');
24
const sass = require('node-sass');
35

@@ -7,7 +9,7 @@ const sass = require('node-sass');
79
hook({
810
extensions: ['.scss', '.css'],
911
generateScopedName: '[local]___[hash:base64:5]',
10-
preprocessCss: (data, file) => sass.renderSync({ file }).css,
12+
preprocessCss: (data, file) => sass.renderSync({file}).css,
1113
});
1214

1315
/*
@@ -20,7 +22,7 @@ const exposedProperties = ['window', 'navigator', 'document'];
2022
global.document = jsdom('');
2123
global.window = document.defaultView;
2224
Object.keys(document.defaultView).forEach((property) => {
23-
if (typeof global[property] === 'undefined') {
25+
if (!global[property]) {
2426
exposedProperties.push(property);
2527
global[property] = document.defaultView[property];
2628
}

src/components/Accordion/Accordion.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import React, { PropTypes } from 'react';
1+
import React, {PropTypes} from 'react';
22
import uncontrollable from 'uncontrollable';
33
import CSSModules from 'react-css-modules';
44
import cn from 'classnames';
55
import styles from './Accordion.scss';
66

7-
export const Accordion = ({ onToggleExpand, isExpanded, children, title }) => (
8-
<div styleName={cn('accordion', { expanded: isExpanded })}>
7+
export const Accordion = ({onToggleExpand, isExpanded, children, title}) => (
8+
<div styleName={cn('accordion', {expanded: isExpanded})}>
99
<div styleName="title" onClick={() => onToggleExpand(!isExpanded)}>
1010
{title}
1111
</div>
@@ -20,6 +20,6 @@ Accordion.propTypes = {
2020
title: PropTypes.any,
2121
};
2222

23-
export default uncontrollable(CSSModules(Accordion, styles, { allowMultiple: true }), {
23+
export default uncontrollable(CSSModules(Accordion, styles, {allowMultiple: true}), {
2424
isExpanded: 'onToggleExpand',
2525
});

src/components/Breadcrumb/Breadcrumb.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import React, { PropTypes } from 'react';
1+
import React, {PropTypes} from 'react';
22
import CSSModules from 'react-css-modules';
3-
import { Link } from 'react-router';
3+
import {Link} from 'react-router';
44
import styles from './Breadcrumb.scss';
55

6-
export const Breadcrumb = ({ items }) => (
6+
export const Breadcrumb = ({items}) => (
77
<ul styleName="breadcrumb">
88
{items.map((item, index) => (
99
<li styleName="item" key={index}>

src/components/Button/Button.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { PropTypes } from 'react';
1+
import React, {PropTypes} from 'react';
22
import CSSModules from 'react-css-modules';
33
import _ from 'lodash';
44
import cn from 'classnames';
@@ -21,4 +21,4 @@ Button.defaultProps = {
2121
size: 'normal',
2222
};
2323

24-
export default CSSModules(Button, styles, { allowMultiple: true });
24+
export default CSSModules(Button, styles, {allowMultiple: true});

src/components/Checkbox/Checkbox.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import React, { PropTypes } from 'react';
1+
import React, {PropTypes} from 'react';
22
import CSSModules from 'react-css-modules';
33
import _ from 'lodash';
44
import styles from './Checkbox.scss';
55

6-
const Checkbox = ({ children, className, id, ...props }) => (
6+
const Checkbox = ({children, className, id, ...props}) => (
77
<div styleName="checkbox" className={className}>
88
<input id={id} type="checkbox" {..._.pick(props, 'checked', 'onChange', 'defaultChecked')} />
99
<label htmlFor={id}>

src/components/CountdownTimer/Countdown.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { Component, PropTypes} from 'react';
1+
import React, {Component, PropTypes} from 'react';
22
import DateBetween from './DateBetween';
33

44
/**
@@ -9,7 +9,7 @@ export default class Countdown extends Component {
99

1010
constructor(props) {
1111
super(props);
12-
this.state = { remaining: null };
12+
this.state = {remaining: null};
1313
}
1414

1515
componentDidMount() {
@@ -25,7 +25,7 @@ export default class Countdown extends Component {
2525
const startDate = new Date();
2626
const endDate = new Date(this.props.options.endDate);
2727
const remaining = DateBetween(startDate, endDate);
28-
this.setState({remaining });
28+
this.setState({remaining});
2929
}
3030

3131
render() {
Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,17 @@
1-
2-
import React, { Component } from 'react';
1+
import React from 'react';
32
import CSSModules from 'react-css-modules';
43
import Countdown from './Countdown';
54

65
import styles from './CountdownTimer.scss';
76

8-
class CountdownTimer extends Component {
9-
componentDidMount() {
7+
const CountdownTimer = () => {
8+
const OPTIONS = {endDate: '12/20/2016 12:12 AM', prefix: ''};
109

11-
}
12-
render() {
13-
const OPTIONS = { endDate: '12/20/2016 12:12 AM', prefix: '' };
10+
return (
11+
<div>
12+
<Countdown options={OPTIONS} />
13+
</div>
14+
);
15+
};
1416

15-
return (
16-
<div>
17-
<Countdown options={OPTIONS} />
18-
</div>
19-
);
20-
}
21-
}
2217
export default CSSModules(CountdownTimer, styles);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy