diff --git a/.eslintrc.json b/.eslintrc.json index 673289bed..00816a9f4 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -18,9 +18,19 @@ "no-underscore-dangle": "off", "no-unused-expressions": "off", "max-len": "off", - "no-plusplus": ["error", { "allowForLoopAfterthoughts": true }], + "no-plusplus": [ + "error", + { + "allowForLoopAfterthoughts": true + } + ], "prefer-destructuring": "off", - "no-param-reassign": [2, { "props": false }], + "no-param-reassign": [ + 2, + { + "props": false + } + ], "camelcase": "off", "consistent-return": "off", "react/function-component-definition": [ @@ -31,13 +41,19 @@ "function-expression", "arrow-function" ], - "unnamedComponents": ["function-expression", "arrow-function"] + "unnamedComponents": [ + "function-expression", + "arrow-function" + ] } ], "react/jsx-filename-extension": [ 1, { - "extensions": [".js", ".jsx"] + "extensions": [ + ".js", + ".jsx" + ] } ], "react/jsx-no-bind": [ @@ -60,14 +76,23 @@ "react/forbid-prop-types": "off", "linebreak-style": 0, "global-require": 0, - "eslint linebreak-style": [0, "error", "windows"], + "eslint linebreak-style": [ + 0, + "error", + "windows" + ], "import/no-unresolved": [ "error", { - "ignore": [".svg"] + "ignore": [ + ".svg" + ] } ], - "curly": ["error", "all"], + "curly": [ + "error", + "all" + ], "template-curly-spacing": "off", "indent": "off" }, @@ -92,18 +117,43 @@ "import/resolver": { "alias": { "map": [ - ["@/components", "./renderer/src/components/"], - ["@/layouts", "./renderer/src/layouts/"], - ["@/modules", "./renderer/src/modules/"], - ["@/util", "./renderer/src/util/"], - ["@/core", "./renderer/src/core/"], - ["@/hooks", "./renderer/src/hooks/"] + [ + "@/components", + "./renderer/src/components/" + ], + [ + "@/layouts", + "./renderer/src/layouts/" + ], + [ + "@/modules", + "./renderer/src/modules/" + ], + [ + "@/util", + "./renderer/src/util/" + ], + [ + "@/core", + "./renderer/src/core/" + ], + [ + "@/hooks", + "./renderer/src/hooks/" + ] ], "node": { - "extensions": [".js", ".jsx", ".ts", ".tsx"] + "extensions": [ + ".js", + ".jsx", + ".ts", + ".tsx" + ] } } } }, - "plugins": ["react"] -} + "plugins": [ + "react" + ] +} \ No newline at end of file diff --git a/renderer/src/components/AudioRecorder/components/EditorPage.js b/renderer/src/components/AudioRecorder/components/EditorPage.js index 78990ef1b..e40e6f644 100644 --- a/renderer/src/components/AudioRecorder/components/EditorPage.js +++ b/renderer/src/components/AudioRecorder/components/EditorPage.js @@ -31,6 +31,7 @@ const EditorPage = ({ && (
diff --git a/renderer/src/components/Projects/ImportPopUp.js b/renderer/src/components/Projects/ImportPopUp.js
index 0ec51a751..629f1160b 100644
--- a/renderer/src/components/Projects/ImportPopUp.js
+++ b/renderer/src/components/Projects/ImportPopUp.js
@@ -12,7 +12,6 @@ import styles from './ImportPopUp.module.css';
import * as logger from '../../logger';
import CloseIcon from '@/illustrations/close-button-black.svg';
import { updateJsonJuxta } from './utils/updateJsonJuxta';
-import { ReferenceContext } from '@/components/context/ReferenceContext';
const grammar = require('usfm-grammar');
const advanceSettings = require('../../lib/AdvanceSettings.json');
@@ -37,11 +36,6 @@ export default function ImportPopUp(props) {
const { t } = useTranslation();
const [labelImportFiles, setLabelImportFiles] = useState(t('label-choose-usfm-files'));
const {
- states: {
- canonSpecification,
- importedBookCodes,
- importedFiles,
- },
actions: {
setImportedBookCodes,
setImportedFiles,
@@ -119,7 +113,7 @@ export default function ImportPopUp(props) {
logger.debug('ImportPopUp.js', 'Inside importFiles');
const fs = window.require('fs');
const files = [];
- let bookCodeList = [];
+ const bookCodeList = [];
folderPath.forEach((filePath) => {
switch (projectType) {
case 'Translation': {
@@ -237,12 +231,12 @@ export default function ImportPopUp(props) {
break;
}
});
- let newCanonSpecification = {
+ const newCanonSpecification = {
currentScope: bookCodeList,
id: 4,
locked: false,
title: t('label-other'),
- }
+ };
if (bookCodeList.length === advanceSettings.canonSpecification[2].length
&& compareArrays(advanceSettings.currentScope, bookCodeList)) {
newCanonSpecification.title = advanceSettings.canonSpecification[2].title;
diff --git a/renderer/src/components/Projects/NewProject.js b/renderer/src/components/Projects/NewProject.js
index 2a1cd1fbc..bbd8ea143 100644
--- a/renderer/src/components/Projects/NewProject.js
+++ b/renderer/src/components/Projects/NewProject.js
@@ -12,7 +12,6 @@ import { SnackBar } from '@/components/SnackBar';
import useValidator from '@/components/hooks/useValidator';
import ConfirmationModal from '@/layouts/editor/ConfirmationModal';
import CustomMultiComboBox from '@/components/Resources/ResourceUtils/CustomMultiComboBox';
-import { readUsfm } from '@/components/Projects/utils/readUsfm';
import moment from 'moment';
import { v5 as uuidv5 } from 'uuid';
import { BookOpenIcon, InformationCircleIcon } from '@heroicons/react/24/outline';
@@ -24,8 +23,6 @@ import { classNames } from '../../util/classNames';
import * as logger from '../../logger';
import ImportPopUp from './ImportPopUp';
import burrito from '../../lib/BurritoTemplate.json';
-import localforage from 'localforage';
-import packageInfo from '../../../../package.json';
// eslint-disable-next-line no-unused-vars
const solutions = [
{
@@ -200,8 +197,8 @@ export default function NewProject({ call, project, closeEdit }) {
/**
* Works only for 1-depth arrays
- * @param {Array} a
- * @param {Array} b
+ * @param {Array} a
+ * @param {Array} b
* @returns {Boolean} true if the two arrays are equal
*/
const compareArrays = (a, b) => a.length === b.length
@@ -228,7 +225,6 @@ export default function NewProject({ call, project, closeEdit }) {
}
});
};
-
const validate = async () => {
logger.debug('NewProject.js', 'Validating the fields.');
setLoading(true);
@@ -260,13 +256,11 @@ export default function NewProject({ call, project, closeEdit }) {
setSnackText(t('Scope is not selected or scope is empty. Please add scope.'));
setOpenSnackBar(true);
}
-
// juxta scope != imported books
if (call === 'new' && create && headerDropDown === 'Juxta' && !compareArrays(importedBookCodes, canonSpecification.currentScope)) {
create = false;
setOpenModalJuxtaWrongSetOfBooks(true);
}
-
setError({
...error, projectName: checkName, abbr: checkAbbr, description: checkDesc,
});
@@ -305,7 +299,6 @@ export default function NewProject({ call, project, closeEdit }) {
function closeImportPopUp() {
setOpenPopUp(false);
}
-
const loadData = async (project) => {
logger.debug('NewProject.js', 'In loadData for loading current project details in Edit page');
setNewProjectFields({
@@ -541,14 +534,15 @@ export default function NewProject({ call, project, closeEdit }) {
/>