From 83f2da9a0afe30827dda6fb47cdfda7540d6d84e Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Tue, 23 Mar 2021 16:11:43 -0500 Subject: [PATCH] [Added eslint] [Selection title] --- .eslintrc.json | 22 ++++++++++++++++++++++ package.json | 2 ++ src/redux/reducers/mount_reducer.js | 2 +- src/utils.jsx | 18 ++++++++++++++---- 4 files changed, 39 insertions(+), 5 deletions(-) create mode 100644 .eslintrc.json diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..88b65a6 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,22 @@ +{ + "env": { + "browser": true, + "es2021": true + }, + "extends": [ + "eslint:recommended", + "plugin:react/recommended" + ], + "parserOptions": { + "ecmaFeatures": { + "jsx": true + }, + "ecmaVersion": 12, + "sourceType": "module" + }, + "plugins": [ + "react" + ], + "rules": { + } +} diff --git a/package.json b/package.json index e95db90..07e54ee 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,8 @@ "electron": "5.0.13", "electron-builder": "22.9.1", "electron-webpack": "^2.8.2", + "eslint": "^7.22.0", + "eslint-plugin-react": "^7.23.0", "webpack": "4.44.2", "webpack-dev-server": "3.11.1" }, diff --git a/src/redux/reducers/mount_reducer.js b/src/redux/reducers/mount_reducer.js index 1999ce9..0f71cb6 100644 --- a/src/redux/reducers/mount_reducer.js +++ b/src/redux/reducers/mount_reducer.js @@ -153,7 +153,7 @@ export const createMountReducer = (state) => { S3Mounts: s3Mounts, }; }, - [RESET_MOUNTS_STATE]: (state, action) => { + [RESET_MOUNTS_STATE]: (state) => { return { ...state, MountsBusy: false, MountState: mountState }; }, [SET_AUTO_MOUNT_PROCESSED]: (state, action) => { diff --git a/src/utils.jsx b/src/utils.jsx index b2c5885..58a4e0e 100644 --- a/src/utils.jsx +++ b/src/utils.jsx @@ -134,9 +134,15 @@ export const getSelectedVersionFromState = (state) => { }; export const promptLocationAndSaveFile = (fileName, data, notifyError) => { - const location = ipcRenderer.sendSync(Constants.IPC_Select_File + '_sync', {Location: fileName, Title: 'Save File'}); + const location = ipcRenderer.sendSync(Constants.IPC_Select_File + '_sync', { + Location: fileName, + Title: 'Save File', + }); if (location && location.length > 0) { - const ret = ipcRenderer.sendSync(Constants.IPC_Save_File + '_sync', {Location: location, Data: data}); + const ret = ipcRenderer.sendSync(Constants.IPC_Save_File + '_sync', { + Location: location, + Data: data, + }); if (ret.success) { return true; } @@ -148,9 +154,13 @@ export const promptLocationAndSaveFile = (fileName, data, notifyError) => { }; export const promptLocationAndReadFile = (notifyError) => { - const location = ipcRenderer.sendSync(Constants.IPC_Browse_File + '_sync', {Title: 'Open File'}); + const location = ipcRenderer.sendSync(Constants.IPC_Browse_File + '_sync', { + Title: 'Open File', + }); if (location && location.length > 0) { - const ret = ipcRenderer.sendSync(Constants.IPC_Read_File + '_sync', {Location: location}); + const ret = ipcRenderer.sendSync(Constants.IPC_Read_File + '_sync', { + Location: location, + }); if (ret.success) { return ret.contents; }