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 = ({ && (
{ const newSentences = [...sentences]; newSentences[index] = sentence; setGlobalTotalSentences(newSentences); - } + }; useEffect(() => { setBookChange(false); @@ -129,21 +128,21 @@ export default function Editor(props) { } return { ...src, index: counts[src.content] }; }); - currentCs = md5(normalizeString(JSON.stringify(source) + chunk.gloss)) + ''; + currentCs = `${md5(normalizeString(JSON.stringify(source) + chunk.gloss))}`; checksumChuncks += currentCs; return { source, gloss: chunk.gloss, - checksum: currentCs + checksum: currentCs, }; }); - currentCs = md5(checksumChuncks) + ''; + currentCs = `${md5(checksumChuncks)}`; checksumSentences += currentCs; return { originalSource: stc.originalSource, chunks, sourceString: stc.sourceString, - checksum: checksumSentences + checksum: checksumSentences, }; }); }; @@ -167,25 +166,24 @@ export default function Editor(props) { }; }) .filter(({ chunk }) => chunk.length); - } else { - return sentences[curIndex].chunks - .map(({ source, gloss, checksum }, index) => { - return { - chunk: source - .filter((s) => s) - .map((s, n) => { - return { - id: `item-${index * 1000 + n}`, - content: s.content, - index: s.index - }; - }), - gloss, - checksum, - }; - }) - .filter(({ chunk }) => chunk.length); } + return sentences[curIndex].chunks + .map(({ source, gloss, checksum }, index) => { + return { + chunk: source + .filter((s) => s) + .map((s, n) => { + return { + id: `item-${index * 1000 + n}`, + content: s.content, + index: s.index, + }; + }), + gloss, + checksum, + }; + }) + .filter(({ chunk }) => chunk.length); }; const tryLoadSentences = () => { @@ -201,7 +199,7 @@ export default function Editor(props) { } } setLoadingSentencesInProgress(false); - } + }; useEffect(() => { setLoadingSentencesInProgress(true); diff --git a/renderer/src/components/EditorPage/JuxtaTextEditor/EditorMenuBar.jsx b/renderer/src/components/EditorPage/JuxtaTextEditor/EditorMenuBar.jsx index 02af1c37d..ed0045880 100644 --- a/renderer/src/components/EditorPage/JuxtaTextEditor/EditorMenuBar.jsx +++ b/renderer/src/components/EditorPage/JuxtaTextEditor/EditorMenuBar.jsx @@ -2,7 +2,7 @@ import React, { useContext } from 'react'; import { ProjectContext } from '@/components/context/ProjectContext'; // import MenuDropdown from '@/components/MenuDropdown/MenuDropdown'; -import { LockClosedIcon, BookmarkIcon, LockOpenIcon } from '@heroicons/react/24/outline'; +import { LockClosedIcon, LockOpenIcon } from '@heroicons/react/24/outline'; // import BibleNavigationX from '@/components/EditorPage/JuxtaTextEditor/BibleNavigationX'; import BibleNavigationX from './BibleNavigationX'; // import Buttons from './Buttons'; diff --git a/renderer/src/components/EditorPage/Navigation/CustomNavigation.js b/renderer/src/components/EditorPage/Navigation/CustomNavigation.js index b79123d0d..b01c29517 100644 --- a/renderer/src/components/EditorPage/Navigation/CustomNavigation.js +++ b/renderer/src/components/EditorPage/Navigation/CustomNavigation.js @@ -112,6 +112,7 @@ export default function CustomNavigation({ onClick={openBooks} role="button" tabIndex="-2" + aria-label="open books" >