From 625689dbb10c15d20cf9d647b8ed15395b5a229e Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Thu, 16 Feb 2023 09:23:19 +0000 Subject: [PATCH] Tools: Add "@typescript-eslint/object-curly-spacing" rule --- .eslintrc.js | 1 + .../gui/ConfigScreen/controls/plugins/PluginBox.tsx | 4 ++-- .../gui/NoteEditor/NoteBody/CodeMirror/CodeMirror.tsx | 2 +- packages/app-desktop/gui/SyncWizard/Dialog.tsx | 6 +++--- packages/app-desktop/gui/style/StyledMessage.tsx | 2 +- packages/app-desktop/services/plugins/UserWebview.tsx | 2 +- packages/app-mobile/utils/fs-driver-rn.ts | 2 +- 7 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index c9eb215870..ce173ce8e8 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -170,6 +170,7 @@ module.exports = { 'tuples': 'always-multiline', 'functions': 'never', }], + '@typescript-eslint/object-curly-spacing': ['error', 'always'], '@typescript-eslint/semi': ['error', 'always'], '@typescript-eslint/member-delimiter-style': ['error', { 'multiline': { diff --git a/packages/app-desktop/gui/ConfigScreen/controls/plugins/PluginBox.tsx b/packages/app-desktop/gui/ConfigScreen/controls/plugins/PluginBox.tsx index 3d4e117bb2..34c63dbcf4 100644 --- a/packages/app-desktop/gui/ConfigScreen/controls/plugins/PluginBox.tsx +++ b/packages/app-desktop/gui/ConfigScreen/controls/plugins/PluginBox.tsx @@ -55,7 +55,7 @@ export interface PluginItem { hasBeenUpdated: boolean; } -const CellRoot = styled.div<{isCompatible: boolean}>` +const CellRoot = styled.div<{ isCompatible: boolean }>` display: flex; box-sizing: border-box; background-color: ${props => props.theme.backgroundColor}; @@ -104,7 +104,7 @@ const DevModeLabel = styled.div` color: ${props => props.theme.color}; `; -const StyledNameAndVersion = styled.div<{mb: any}>` +const StyledNameAndVersion = styled.div<{ mb: any }>` font-family: ${props => props.theme.fontFamily}; color: ${props => props.theme.color}; font-size: ${props => props.theme.fontSize}px; diff --git a/packages/app-desktop/gui/NoteEditor/NoteBody/CodeMirror/CodeMirror.tsx b/packages/app-desktop/gui/NoteEditor/NoteBody/CodeMirror/CodeMirror.tsx index 3b994261c6..eb8eab7b7a 100644 --- a/packages/app-desktop/gui/NoteEditor/NoteBody/CodeMirror/CodeMirror.tsx +++ b/packages/app-desktop/gui/NoteEditor/NoteBody/CodeMirror/CodeMirror.tsx @@ -352,7 +352,7 @@ function CodeMirror(props: NoteBodyEditorProps, ref: any) { let cancelled = false; async function loadScripts() { - const scriptsToLoad: {src: string; id: string; loaded: boolean}[] = [ + const scriptsToLoad: { src: string; id: string; loaded: boolean }[] = [ { src: `${bridge().vendorDir()}/lib/codemirror/addon/dialog/dialog.css`, id: 'codemirrorDialogStyle', diff --git a/packages/app-desktop/gui/SyncWizard/Dialog.tsx b/packages/app-desktop/gui/SyncWizard/Dialog.tsx index 096f70f527..222f4b36aa 100644 --- a/packages/app-desktop/gui/SyncWizard/Dialog.tsx +++ b/packages/app-desktop/gui/SyncWizard/Dialog.tsx @@ -24,7 +24,7 @@ const StyledRoot = styled.div` max-width: 1200px; `; -const SyncTargetDescription = styled.div<{height: number}>` +const SyncTargetDescription = styled.div<{ height: number }>` ${props => props.height ? `height: ${props.height}px` : ''}; margin-bottom: 1.3em; line-height: ${props => props.theme.lineHeight}; @@ -69,7 +69,7 @@ const SyncTargetLogo = styled.img` margin-right: 0.4em; `; -const SyncTargetBox = styled.div<{faded: boolean}>` +const SyncTargetBox = styled.div<{ faded: boolean }>` display: flex; flex: 1; flex-direction: column; @@ -96,7 +96,7 @@ const FeatureIcon = styled.i` position: absolute; `; -const FeatureLine = styled.div<{enabled: boolean}>` +const FeatureLine = styled.div<{ enabled: boolean }>` margin-bottom: .5em; opacity: ${props => props.enabled ? 1 : 0.5}; position: relative; diff --git a/packages/app-desktop/gui/style/StyledMessage.tsx b/packages/app-desktop/gui/style/StyledMessage.tsx index aa34d3bb5a..43ea8c4bd6 100644 --- a/packages/app-desktop/gui/style/StyledMessage.tsx +++ b/packages/app-desktop/gui/style/StyledMessage.tsx @@ -1,6 +1,6 @@ import styled from 'styled-components'; -const StyledMessage = styled.div<{type: string}>` +const StyledMessage = styled.div<{ type: string }>` border-radius: 3px; background-color: ${props => props.type === 'error' ? props.theme.warningBackgroundColor : 'transparent'}; font-size: ${props => props.theme.fontSize}px; diff --git a/packages/app-desktop/services/plugins/UserWebview.tsx b/packages/app-desktop/services/plugins/UserWebview.tsx index f9f145f0fe..373287c33e 100644 --- a/packages/app-desktop/services/plugins/UserWebview.tsx +++ b/packages/app-desktop/services/plugins/UserWebview.tsx @@ -28,7 +28,7 @@ export interface Props { onReady?: Function; } -const StyledFrame = styled.iframe<{fitToContent: boolean; borderBottom: boolean}>` +const StyledFrame = styled.iframe<{ fitToContent: boolean; borderBottom: boolean }>` padding: 0; margin: 0; width: ${(props: any) => props.fitToContent ? `${props.width}px` : '100%'}; diff --git a/packages/app-mobile/utils/fs-driver-rn.ts b/packages/app-mobile/utils/fs-driver-rn.ts index 4f48e38331..4368e80249 100644 --- a/packages/app-mobile/utils/fs-driver-rn.ts +++ b/packages/app-mobile/utils/fs-driver-rn.ts @@ -271,7 +271,7 @@ export default class FsDriverRN extends FsDriverBase { } /** always returns an array */ - public async pickDocument(options: {multiple: false}) { + public async pickDocument(options: { multiple: false }) { const { multiple = false } = options || {}; let result; try {