Skip to content

Commit a080bd1

Browse files
authored
IM-177 - apply standards linter to the entire codebase (#178)
* IM-177 - package.json changed to lint entire code base * IM-177 - lint --fix applied to code * IM-177 manual lint fixes * IM-177 safer change to deleting String.prototype.replaceAll
1 parent 9212edb commit a080bd1

130 files changed

Lines changed: 726 additions & 704 deletions

File tree

Some content is hidden

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

jest.setup.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ if (!window.matchMedia) {
1515
dispatchEvent: jest.fn()
1616
}))
1717
})
18-
}
18+
}

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,10 @@
8686
"build": "npm run clean && npm-run-all --parallel build:umd build:esm",
8787
"type-check": "tsc --noEmit",
8888
"lint": "npm run lint:js && npm run lint:scss",
89-
"lint:js": "standard \"src/**/*.{js,jsx,ts,tsx}\"",
89+
"lint:js": "standard \"./**/*.{js,jsx,ts,tsx}\"",
9090
"lint:scss": "stylelint \"src/**/*.{css,scss}\"",
9191
"lint:fix": "npm run lint:js:fix && npm run lint:scss:fix",
92-
"lint:js:fix": "standard \"src/**/*.{js,jsx,ts,tsx}\" --fix",
92+
"lint:js:fix": "standard \"./**/*.{js,jsx,ts,tsx}\" --fix",
9393
"lint:scss:fix": "stylelint \"src/**/*.{css,scss}\" --fix",
9494
"test": "jest --color --coverage --verbose",
9595
"report": "webpack --profile --json --config webpack.prod.mjs > stats.json && webpack-bundle-analyzer --host 0.0.0.0 --port 8888 ./stats.json ./public",

plugins/beta/datasets/src/DatasetsInit.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export function DatasetsInit ({ pluginConfig, pluginState, appState, mapState, m
3131

3232
// Only initialise state if not already set
3333
if (!pluginState.datasets) {
34-
dispatch({ type: 'SET_DATASETS', payload: { datasets: pluginConfig.datasets, datasetDefaults }})
34+
dispatch({ type: 'SET_DATASETS', payload: { datasets: pluginConfig.datasets, datasetDefaults } })
3535
}
3636

3737
datasetsInstanceRef.current = createDatasets({

plugins/beta/datasets/src/api/addDataset.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ export const addDataset = ({ mapProvider, mapState, pluginState }, dataset) => {
99

1010
// Update state
1111
pluginState.dispatch({ type: 'ADD_DATASET', payload: { dataset, datasetDefaults } })
12-
}
12+
}

plugins/beta/datasets/src/api/hideDataset.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ export const hideDataset = ({ mapProvider, pluginState }, datasetId) => {
1111

1212
// Update state
1313
pluginState.dispatch({ type: 'SET_DATASET_VISIBILITY', payload: { id: datasetId, visibility: 'hidden' } })
14-
}
14+
}

plugins/beta/datasets/src/api/hideFeatures.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@ export const hideFeatures = ({ mapProvider, pluginState }, { featureIds, idPrope
3838
if (strokeLayerId) {
3939
applyExclusionFilter(map, strokeLayerId, originalFilter, idProperty, allHiddenIds)
4040
}
41-
}
41+
}

plugins/beta/datasets/src/api/removeDataset.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,4 @@ export const removeDataset = ({ mapProvider, pluginState }, datasetId) => {
4848

4949
// Update plugin state
5050
pluginState.dispatch({ type: 'REMOVE_DATASET', payload: { id: datasetId } })
51-
}
51+
}

plugins/beta/datasets/src/api/showDataset.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ export const showDataset = ({ mapProvider, pluginState }, datasetId) => {
1111

1212
// Update state
1313
pluginState.dispatch({ type: 'SET_DATASET_VISIBILITY', payload: { id: datasetId, visibility: 'visible' } })
14-
}
14+
}

plugins/beta/datasets/src/api/showFeatures.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@ export const showFeatures = ({ mapProvider, pluginState }, { featureIds, idPrope
4141
if (strokeLayerId) {
4242
applyExclusionFilter(map, strokeLayerId, originalFilter, idProperty, remainingHiddenIds)
4343
}
44-
}
44+
}

plugins/beta/datasets/src/datasets.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export const createDatasets = ({
5252
})
5353

5454
return {
55-
remove() {
55+
remove () {
5656
eventBus.off(events.MAP_SET_STYLE, styleHandler)
5757

5858
// Clean up dynamic sources
@@ -82,7 +82,7 @@ export const createDatasets = ({
8282
* Refresh a dynamic source - clears cache and re-fetches
8383
* @param {string} datasetId - Dataset ID to refresh
8484
*/
85-
refreshDataset(datasetId) {
85+
refreshDataset (datasetId) {
8686
const dynamicSource = dynamicSources.get(datasetId)
8787
if (dynamicSource) {
8888
dynamicSource.refresh()
@@ -93,7 +93,7 @@ export const createDatasets = ({
9393
* Clear a dynamic source's cache
9494
* @param {string} datasetId - Dataset ID to clear
9595
*/
96-
clearDatasetCache(datasetId) {
96+
clearDatasetCache (datasetId) {
9797
const dynamicSource = dynamicSources.get(datasetId)
9898
if (dynamicSource) {
9999
dynamicSource.clear()
@@ -105,7 +105,7 @@ export const createDatasets = ({
105105
* @param {string} datasetId - Dataset ID
106106
* @returns {number|null} Feature count or null if not a dynamic source
107107
*/
108-
getFeatureCount(datasetId) {
108+
getFeatureCount (datasetId) {
109109
const dynamicSource = dynamicSources.get(datasetId)
110110
return dynamicSource ? dynamicSource.getFeatureCount() : null
111111
}

0 commit comments

Comments
 (0)