Skip to content

Commit 728d47a

Browse files
authored
Merge pull request #254 from acrellin/delint
Lint-roll all JavaScript code
2 parents 5426f28 + b382757 commit 728d47a

22 files changed

+521
-402
lines changed

.eslintrc

+46-45
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,49 @@
11
{
2-
"comment": "off = 0, warn = 1, error = 2",
2+
"comment": "off = 0, warn = 1, error = 2",
33

4-
"parser": "babel-eslint",
5-
"env": {
6-
"browser": true
7-
},
8-
"extends": "airbnb",
9-
"rules": {
10-
"max-len": [1, 100, 2, {ignoreComments: true}],
11-
"quote-props": [1, "consistent-as-needed"],
12-
"no-cond-assign": [2, "except-parens"],
13-
"radix": 0,
14-
"space-infix-ops": 0,
15-
"no-unused-vars": [1, {"vars": "local", "args": "none"}],
16-
"default-case": 0,
17-
"no-else-return": 0,
18-
"no-param-reassign": 0,
19-
"quotes": 0,
20-
"comma-dangle": [1, "only-multiline"],
21-
"vars-on-top": 0,
22-
"prefer-const": 1,
23-
"eqeqeq": 1,
24-
"import/imports-first": 1,
25-
"consistent-return": 0,
26-
"import/no-mutable-exports": 0,
27-
"no-class-assign": 0,
28-
"jsx-a11y/label-has-for": 0,
29-
"jsx-a11y/href-no-hash": 1,
30-
"camelcase": 0,
31-
"no-fallthrough": 0,
32-
"no-restricted-syntax": 1,
33-
"guard-for-in": 1,
34-
"array-callback-return": 1,
35-
"class-methods-use-this": 1,
36-
"jsx-a11y/no-static-element-interactions": 1,
37-
"react/forbid-prop-types": 1,
38-
"arrow-parens": 1,
39-
"no-bitwise": 1,
40-
"no-plusplus": 1,
41-
"no-extend-native": 1,
42-
"no-use-before-define": 1,
43-
"no-unused-expressions": 1,
44-
"no-continue": 1,
45-
"no-prototype-builtins": 1,
46-
"dot-notation": 1,
47-
}
4+
"parser": "babel-eslint",
5+
"env": {
6+
"browser": true
7+
},
8+
"extends": "airbnb",
9+
"rules": {
10+
"max-len": [1, 100, 2, {ignoreComments: true}],
11+
"quote-props": [1, "consistent-as-needed"],
12+
"no-cond-assign": [2, "except-parens"],
13+
"radix": 0,
14+
"space-infix-ops": 0,
15+
"no-unused-vars": [1, {"vars": "local", "args": "none"}],
16+
"default-case": 0,
17+
"no-else-return": 0,
18+
"no-param-reassign": 0,
19+
"quotes": 0,
20+
"comma-dangle": [1, "only-multiline"],
21+
"vars-on-top": 0,
22+
"prefer-const": 1,
23+
"eqeqeq": 1,
24+
"import/imports-first": 1,
25+
"consistent-return": 0,
26+
"import/no-mutable-exports": 0,
27+
"no-class-assign": 0,
28+
"jsx-a11y/label-has-for": 0,
29+
"jsx-a11y/href-no-hash": 1,
30+
"camelcase": 0,
31+
"no-fallthrough": 0,
32+
"no-restricted-syntax": 1,
33+
"guard-for-in": 1,
34+
"array-callback-return": 1,
35+
"class-methods-use-this": 1,
36+
"jsx-a11y/no-static-element-interactions": 1,
37+
"react/forbid-prop-types": 1,
38+
"arrow-parens": 1,
39+
"no-bitwise": 1,
40+
"no-plusplus": 1,
41+
"no-extend-native": 1,
42+
"no-use-before-define": 1,
43+
"no-unused-expressions": 1,
44+
"no-continue": 1,
45+
"no-prototype-builtins": 1,
46+
"dot-notation": 1,
47+
"react/no-array-index-key": 1
48+
}
4849
}

.travis/travis_script.sh

+8-1
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,17 @@
33
set -ex
44

55

6+
section "ESLint"
7+
8+
make lint-install
9+
make lint
10+
11+
section_end "ESLint"
12+
13+
614
section "Tests"
715

816
make log &
917
make ${TEST_TARGET}
1018

1119
section_end "Tests"
12-

baselayer

package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@
3939
"babel-preset-stage-2": "^6.22.0",
4040
"css-loader": "^0.26.1",
4141
"cwise": "^1.0.9",
42-
"eslint": "^3.16.1",
43-
"eslint-config-airbnb": "^14.1.0",
42+
"eslint": "^4.19.1",
43+
"eslint-config-airbnb": "^16.1.0",
4444
"eslint-loader": "^1.6.3",
45-
"eslint-plugin-import": "^2.2.0",
46-
"eslint-plugin-jsx-a11y": "^4.0.0",
47-
"eslint-plugin-react": "^6.10.0",
45+
"eslint-plugin-import": "^2.11.0",
46+
"eslint-plugin-jsx-a11y": "^6.0.3",
47+
"eslint-plugin-react": "^7.7.0",
4848
"exports-loader": "^0.6.3",
4949
"glslify": "^6.0.1",
5050
"imports-loader": "^0.7.0",

static/js/CesiumMessageHandler.js

+30-31
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,36 @@
1-
import * as Action from './actions';
21
import { SHOW_NOTIFICATION, showNotification } from 'baselayer/components/Notifications';
32
import MessageHandler from 'baselayer/MessageHandler';
3+
import * as Action from './actions';
44

5-
let CesiumMessageHandler = dispatch => {
6-
return new MessageHandler(dispatch, message => {
7-
switch (message.action) {
8-
case Action.FETCH_PROJECTS:
9-
dispatch(Action.fetchProjects());
10-
break;
11-
case Action.FETCH_FEATURES:
12-
dispatch(Action.fetchFeatures());
13-
break;
14-
case Action.FETCH_DATASETS:
15-
dispatch(Action.fetchDatasets());
16-
break;
17-
case Action.FETCH_FEATURESETS:
18-
dispatch(Action.fetchFeaturesets());
19-
break;
20-
case Action.FETCH_MODELS:
21-
dispatch(Action.fetchModels());
22-
break;
23-
case Action.FETCH_PREDICTIONS:
24-
dispatch(Action.fetchPredictions());
25-
break;
26-
case Action.FEATURIZE_PROGRESS:
27-
let time_update = message.payload;
28-
dispatch(Action.featurizeUpdateProgress(time_update));
29-
break;
30-
default:
31-
console.log('Unknown message received through flow:',
32-
message);
5+
const CesiumMessageHandler = dispatch => new MessageHandler(dispatch, (message) => {
6+
switch (message.action) {
7+
case Action.FETCH_PROJECTS:
8+
dispatch(Action.fetchProjects());
9+
break;
10+
case Action.FETCH_FEATURES:
11+
dispatch(Action.fetchFeatures());
12+
break;
13+
case Action.FETCH_DATASETS:
14+
dispatch(Action.fetchDatasets());
15+
break;
16+
case Action.FETCH_FEATURESETS:
17+
dispatch(Action.fetchFeaturesets());
18+
break;
19+
case Action.FETCH_MODELS:
20+
dispatch(Action.fetchModels());
21+
break;
22+
case Action.FETCH_PREDICTIONS:
23+
dispatch(Action.fetchPredictions());
24+
break;
25+
case Action.FEATURIZE_PROGRESS: {
26+
const time_update = message.payload;
27+
dispatch(Action.featurizeUpdateProgress(time_update));
28+
break;
3329
}
34-
});
35-
}
30+
default:
31+
console.log('Unknown message received through flow:',
32+
message);
33+
}
34+
});
3635

3736
export default CesiumMessageHandler;

0 commit comments

Comments
 (0)