[Added eslint] [Selection title]
This commit is contained in:
22
.eslintrc.json
Normal file
22
.eslintrc.json
Normal file
@@ -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": {
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -36,6 +36,8 @@
|
|||||||
"electron": "5.0.13",
|
"electron": "5.0.13",
|
||||||
"electron-builder": "22.9.1",
|
"electron-builder": "22.9.1",
|
||||||
"electron-webpack": "^2.8.2",
|
"electron-webpack": "^2.8.2",
|
||||||
|
"eslint": "^7.22.0",
|
||||||
|
"eslint-plugin-react": "^7.23.0",
|
||||||
"webpack": "4.44.2",
|
"webpack": "4.44.2",
|
||||||
"webpack-dev-server": "3.11.1"
|
"webpack-dev-server": "3.11.1"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -153,7 +153,7 @@ export const createMountReducer = (state) => {
|
|||||||
S3Mounts: s3Mounts,
|
S3Mounts: s3Mounts,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
[RESET_MOUNTS_STATE]: (state, action) => {
|
[RESET_MOUNTS_STATE]: (state) => {
|
||||||
return { ...state, MountsBusy: false, MountState: mountState };
|
return { ...state, MountsBusy: false, MountState: mountState };
|
||||||
},
|
},
|
||||||
[SET_AUTO_MOUNT_PROCESSED]: (state, action) => {
|
[SET_AUTO_MOUNT_PROCESSED]: (state, action) => {
|
||||||
|
|||||||
@@ -134,9 +134,15 @@ export const getSelectedVersionFromState = (state) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const promptLocationAndSaveFile = (fileName, data, notifyError) => {
|
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) {
|
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) {
|
if (ret.success) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -148,9 +154,13 @@ export const promptLocationAndSaveFile = (fileName, data, notifyError) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const promptLocationAndReadFile = (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) {
|
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) {
|
if (ret.success) {
|
||||||
return ret.contents;
|
return ret.contents;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user