Skip to content
Snippets Groups Projects
Commit 5f157f1a authored by Bucknell, Mary S.'s avatar Bucknell, Mary S.
Browse files

Enforce space before keywords

parent c9886195
No related branches found
No related tags found
2 merge requests!293Eslint keyword spacing,!292Eslint keyword spacing
Showing
with 23 additions and 22 deletions
......@@ -16,6 +16,7 @@
"comma-dangle": [2,"never"],
"comma-spacing": ["error", { "before": false, "after": true }],
"curly": "error",
"keyword-spacing": ["error", {"before": true}],
"linebreak-style": ["error", "unix"],
"no-console": "off",
"no-extra-parens": [2,"all"],
......
......@@ -22,7 +22,7 @@
"hash-assets": "gulp --gulpfile ./gulpfile.js revall",
"lint": "run-p lint:*",
"lint:cs": "stylelint src/styles/**/*.scss",
"lint:js": "eslint src/scripts",
"lint:js": "eslint --fix src/scripts",
"serve:python": "../wdfn-server/env/bin/python ../wdfn-server/run.py",
"start": "run-p watch serve:python",
"watch": "run-p watch:*",
......
......@@ -47,7 +47,7 @@ export const drawSimpleLegend = function(div, {legendMarkerRows, layout}) {
try {
const markerGroupBBox = markerGroup.node().getBBox();
return markerGroupBBox.x + markerGroupBBox.width + MARKER_GROUP_X_OFFSET;
} catch(error) {
} catch (error) {
// See above explanation
return lastXPosition;
}
......@@ -95,7 +95,7 @@ export const drawSimpleLegend = function(div, {legendMarkerRows, layout}) {
let bBox;
try {
bBox = legend.node().getBBox();
} catch(error) {
} catch (error) {
return;
}
svg.attr('viewBox', `0 0 ${layout.width} ${bBox.height + 10}`);
......
......@@ -8,7 +8,7 @@ const markerText = function(group, y, text) {
let groupBBox;
try {
groupBBox = group.node().getBBox();
} catch(error) {
} catch (error) {
// Set defaults
groupBBox = {
x: 0,
......
......@@ -2,7 +2,7 @@ import {select} from 'd3-selection';
import * as utils from 'ui/utils';
import{configureStore} from 'ml/store';
import {configureStore} from 'ml/store';
import {drawGraphBrush} from './graph-brush';
......
......@@ -2,7 +2,7 @@ import {select} from 'd3-selection';
import * as utils from 'ui/utils';
import{configureStore} from 'ml/store';
import {configureStore} from 'ml/store';
import {initializeGraphBrush, drawGraphBrush} from './graph-brush';
import {TEST_CURRENT_TIME_RANGE, TEST_PRIMARY_IV_DATA, TEST_GW_LEVELS} from './mock-hydrograph-state';
......
......@@ -44,7 +44,7 @@ export const drawMethodPicker = function(container, sortedIVMethods, store) {
'location and describe sampling details used to distinguish time-series of the same type--examples ' +
'include variations in physical location and sensor type.');
if(hasMethodsWithNoPointsInTimeRange) {
if (hasMethodsWithNoPointsInTimeRange) {
pickerContainer.append('span')
.attr('id', 'no-data-points-note')
.text(' note - some methods/sub-locations are disabled, because there are no data points for these in ' +
......
......@@ -66,7 +66,7 @@ const createTooltipTextGroup = function(elem, {
if (currentPoint) {
tooltipTextData.push(getIVDataTooltipTextInfo(currentPoint, 'primary', unitCode));
}
if(comparePoint) {
if (comparePoint) {
tooltipTextData.push(getIVDataTooltipTextInfo(comparePoint, 'compare', unitCode));
}
if (gwLevelPoint) {
......
......@@ -26,7 +26,7 @@ const fetchLayerLegend = async function(layer, defaultName) {
console.error(`Received bad status, ${response.status} at ${url}`);
return [];
}
} catch(error) {
} catch (error) {
console.error(`Failed fetch for ${url}`);
return [];
}
......
......@@ -34,7 +34,7 @@ const addNetworkRows = function(node, {hasData, networkList}) {
.text(network.title);
});
} else{
} else {
node.html('<p>This site is not in any networks</p>');
}
};
......
......@@ -17,7 +17,7 @@ import config from 'ui/config';
*/
export const hasMeasuredFahrenheitParameter = function(parameterCode, allParameterCodes) {
let isParameterMatching;
switch(parameterCode) {
switch (parameterCode) {
case '00020':
isParameterMatching = allParameterCodes.includes('00021');
break;
......
......@@ -51,7 +51,7 @@ export const retrieveFIMFloodData = function(siteno) {
* Slice reducer
*/
export const floodDataReducer = function(floodData=INITIAL_DATA, action) {
switch(action.type) {
switch (action.type) {
case 'SET_FLOOD_FEATURES':
return {
...floodData,
......@@ -109,7 +109,7 @@ const retrieveFloodLevels = function(siteno) {
*/
export const floodStateReducer = function(floodState={}, action) {
switch(action.type) {
switch (action.type) {
case 'SET_GAGE_HEIGHT':
return {
...floodState,
......
......@@ -79,7 +79,7 @@ export const retrieveGroundwaterLevelData = function(siteno, agencyCd) {
* Slice reducer
*/
export const groundwaterLevelDataReducer = function(data=INITIAL_DATA, action) {
switch(action.type) {
switch (action.type) {
case 'UPDATE_GROUNDWATER_LEVEL_DATA':
return {
...data,
......
......@@ -351,7 +351,7 @@ export const retrieveHydrographData = function(siteno, agencyCode, {parameterCod
};
export const hydrographDataReducer = function(hydrographData = {}, action) {
switch(action.type) {
switch (action.type) {
case 'SET_HYDROGRAPH_TIME_RANGE': {
let newData = {};
newData[`${action.timeRangeKind}TimeRange`] = action.timeRange;
......
......@@ -134,7 +134,7 @@ export const initializeParameters = function() {
};
export const hydrographParametersReducer = function(hydrographParameters= {}, action) {
switch(action.type) {
switch (action.type) {
case 'UPDATE_HYDROGRAPH_PARAMETERS': {
return {
...action.parameters
......
......@@ -25,7 +25,7 @@ const retrieveNetworkListData = function(siteno) {
return item['rel'] == 'collection';
});
dispatch(setNetworkList(networkList));
} else{
} else {
dispatch(setNetworkList([]));
}
......@@ -37,7 +37,7 @@ const retrieveNetworkListData = function(siteno) {
* Slice reducer
*/
export const networkDataReducer = function(networkData=INITIAL_DATA, action) {
switch(action.type) {
switch (action.type) {
case 'SET_NETWORK_LIST':
return {
...networkData,
......
......@@ -45,7 +45,7 @@ const retrieveNldiData = function(siteno) {
* Slice reducer
*/
export const nldiDataReducer = function(nldiData=INITIAL_DATA, action) {
switch(action.type) {
switch (action.type) {
case 'SET_NLDI_FEATURES':
return {
...nldiData,
......
......@@ -13,7 +13,7 @@ const resizeUI = function(windowWidth, width) {
};
export const uiReducer = function(ui={}, action) {
switch(action.type) {
switch (action.type) {
case 'RESIZE_UI':
return {
...ui,
......
......@@ -73,7 +73,7 @@ export const addSitesLayer = function(map, networkSites) {
});
};
if(networkSites.length > 0 && networkSites.length < 10000) {
if (networkSites.length > 0 && networkSites.length < 10000) {
const sitesLayer = getSitesLayer(networkSites, geojsonMarkerOptions);
if (networkSites.length > 50) {
const markers = new MarkerClusterGroup({chunkedLoading: true});
......
......@@ -16,7 +16,7 @@ const setNetworkMonitoringLocations = function(networkData, action) {
* Slice reducer
*/
export const networkDataReducer = function(networkData=INITIAL_STATE, action) {
switch(action.type) {
switch (action.type) {
case 'SET_NETWORK_MONITORING_LOCATIONS': return setNetworkMonitoringLocations(networkData, action);
default: return networkData;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment