diff --git a/.eslintrc.js b/.eslintrc.js index 9000a76c5..be23b2373 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -109,6 +109,7 @@ module.exports = { 'exports': 'always-multiline', 'functions': 'never', }], + 'comma-spacing': ['error', { 'before': false, 'after': true }], 'no-trailing-spaces': 'error', 'linebreak-style': ['error', 'unix'], 'prefer-template': ['error'], diff --git a/packages/app-cli/app/command-mv.js b/packages/app-cli/app/command-mv.js index 999033eb9..0e5dd089b 100644 --- a/packages/app-cli/app/command-mv.js +++ b/packages/app-cli/app/command-mv.js @@ -26,7 +26,7 @@ class Command extends BaseCommand { const destinationDuplicates = await Folder.search({ titlePattern: destination, limit: 2 }); if (destinationDuplicates.length > 1) { - throw new Error(_('Ambiguous notebook "%s". Please use short notebook id instead - press "ti" to see the short notebook id' , destination)); + throw new Error(_('Ambiguous notebook "%s". Please use short notebook id instead - press "ti" to see the short notebook id', destination)); } const itemFolder = await app().loadItem(BaseModel.TYPE_FOLDER, pattern); diff --git a/packages/app-cli/app/gui/FolderListWidget.js b/packages/app-cli/app/gui/FolderListWidget.js index c9a694a26..bd6cb960a 100644 --- a/packages/app-cli/app/gui/FolderListWidget.js +++ b/packages/app-cli/app/gui/FolderListWidget.js @@ -36,7 +36,7 @@ class FolderListWidget extends ListWidget { if (Setting.value('showNoteCounts')) { let noteCount = item.note_count; // Subtract children note_count from parent folder. - if (this.folderHasChildren_(this.folders,item.id)) { + if (this.folderHasChildren_(this.folders, item.id)) { for (let i = 0; i < this.folders.length; i++) { if (this.folders[i].parent_id === item.id) { noteCount -= this.folders[i].note_count; diff --git a/packages/app-desktop/checkForUpdates.ts b/packages/app-desktop/checkForUpdates.ts index 5f6100d37..3d5c3087f 100644 --- a/packages/app-desktop/checkForUpdates.ts +++ b/packages/app-desktop/checkForUpdates.ts @@ -40,7 +40,7 @@ async function fetchLatestRelease(options: CheckForUpdateOptions) { if (!response.ok) { const responseText = await response.text(); - throw new Error(`Cannot get latest release info: ${responseText.substr(0,500)}`); + throw new Error(`Cannot get latest release info: ${responseText.substr(0, 500)}`); } const releases = await response.json(); diff --git a/packages/app-desktop/gui/NoteEditor/NoteBody/CodeMirror/utils/useCursorUtils.test.ts b/packages/app-desktop/gui/NoteEditor/NoteBody/CodeMirror/utils/useCursorUtils.test.ts index 70a4c9d02..8a8b6d595 100644 --- a/packages/app-desktop/gui/NoteEditor/NoteBody/CodeMirror/utils/useCursorUtils.test.ts +++ b/packages/app-desktop/gui/NoteEditor/NoteBody/CodeMirror/utils/useCursorUtils.test.ts @@ -35,14 +35,14 @@ describe('useCursorUtils', () => { const numberedListWithEmptyLines = [ '1. item1', '2. item2', - '3. ' , + '3. ', '4. item3', ]; const noPrefixListWithEmptyLines = [ 'item1', 'item2', - '' , + '', 'item3', ]; diff --git a/packages/app-desktop/gui/NoteEditor/NoteBody/CodeMirror/utils/useCursorUtils.ts b/packages/app-desktop/gui/NoteEditor/NoteBody/CodeMirror/utils/useCursorUtils.ts index f55636325..d8019d737 100644 --- a/packages/app-desktop/gui/NoteEditor/NoteBody/CodeMirror/utils/useCursorUtils.ts +++ b/packages/app-desktop/gui/NoteEditor/NoteBody/CodeMirror/utils/useCursorUtils.ts @@ -111,7 +111,7 @@ export default function useCursorUtils(CodeMirror: any) { const lines = selected.split(/\r?\n/); // Save the newline character to restore it later const newLines = selected.match(/\r?\n/); - modifyListLines(lines,num,string1); + modifyListLines(lines, num, string1); const newLine = newLines !== null ? newLines[0] : '\n'; selectedStrings[i] = lines.join(newLine); } diff --git a/packages/app-desktop/gui/NoteEditor/NoteBody/TinyMCE/TinyMCE.tsx b/packages/app-desktop/gui/NoteEditor/NoteBody/TinyMCE/TinyMCE.tsx index 5b5ab1f6b..78d2a1821 100644 --- a/packages/app-desktop/gui/NoteEditor/NoteBody/TinyMCE/TinyMCE.tsx +++ b/packages/app-desktop/gui/NoteEditor/NoteBody/TinyMCE/TinyMCE.tsx @@ -187,7 +187,7 @@ const TinyMCE = (props: NoteBodyEditorProps, ref: any) => { return prop_htmlToMarkdownRef.current(props.contentMarkupLanguage, editorRef.current.getContent(), props.contentOriginalCss); }, resetScroll: () => { - if (editor) editor.getWin().scrollTo(0,0); + if (editor) editor.getWin().scrollTo(0, 0); }, scrollTo: (options: ScrollOptions) => { if (!editor) return; diff --git a/packages/app-desktop/gui/NoteEditor/styles/index.ts b/packages/app-desktop/gui/NoteEditor/styles/index.ts index f64c3d047..25d71265c 100644 --- a/packages/app-desktop/gui/NoteEditor/styles/index.ts +++ b/packages/app-desktop/gui/NoteEditor/styles/index.ts @@ -7,7 +7,7 @@ export default function styles(props: NoteEditorProps) { return { root: { boxSizing: 'border-box', - paddingLeft: 0,// theme.mainPadding, + paddingLeft: 0, // theme.mainPadding, paddingTop: 0, width: '100%', height: '100%', diff --git a/packages/app-desktop/gui/NoteList/NoteList.tsx b/packages/app-desktop/gui/NoteList/NoteList.tsx index add3b5335..369d937f9 100644 --- a/packages/app-desktop/gui/NoteList/NoteList.tsx +++ b/packages/app-desktop/gui/NoteList/NoteList.tsx @@ -124,7 +124,7 @@ const NoteListComponent = (props: Props) => { }); menu.popup(bridge().window()); - }, [props.selectedNoteIds, props.notes, props.dispatch, props.watchedNoteFiles,props.plugins, props.selectedFolderId, props.customCss]); + }, [props.selectedNoteIds, props.notes, props.dispatch, props.watchedNoteFiles, props.plugins, props.selectedFolderId, props.customCss]); const onGlobalDrop_ = () => { unregisterGlobalDragEndEvent_(); @@ -307,7 +307,7 @@ const NoteListComponent = (props: Props) => { updateSizeState(); } // eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied - }, [previousSelectedNoteIds,previousNotes, previousVisible, props.selectedNoteIds, props.notes]); + }, [previousSelectedNoteIds, previousNotes, previousVisible, props.selectedNoteIds, props.notes]); const scrollNoteIndex_ = (keyCode: any, ctrlKey: any, metaKey: any, noteIndex: any) => { diff --git a/packages/app-mobile/components/SelectDateTimeDialog.tsx b/packages/app-mobile/components/SelectDateTimeDialog.tsx index 8a4e94efc..9bb68751a 100644 --- a/packages/app-mobile/components/SelectDateTimeDialog.tsx +++ b/packages/app-mobile/components/SelectDateTimeDialog.tsx @@ -103,7 +103,7 @@ export default class SelectDateTimeDialog extends React.PureComponent return ( - { this.state.date && {time.formatDateToLocal(this.state.date)} } + { this.state.date && {time.formatDateToLocal(this.state.date)} }