From 42799b066263812123b4382f76ee8d4900f767a0 Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Thu, 12 Nov 2020 19:23:54 +0000 Subject: [PATCH] Tools: Apply rule @typescript-eslint/comma-dangle --- .eslintrc.js | 13 +++++++++++-- .../app-desktop/gui/KeymapConfig/utils/useKeymap.ts | 2 +- packages/lib/services/searchengine/queryBuilder.ts | 4 ++-- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 7eb62e767..1694ebbfa 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -115,8 +115,6 @@ module.exports = { 'space-before-blocks': 'error', 'spaced-comment': ['error', 'always'], 'keyword-spacing': ['error', { 'before': true, 'after': true }], - - '@typescript-eslint/type-annotation-spacing': ['error', { 'before': false, 'after': true }], }, 'plugins': [ 'react', @@ -132,6 +130,17 @@ module.exports = { // Warn only because it would make it difficult to convert JS classes to TypeScript, unless we // make everything public which is not great. New code however should specify member accessibility. '@typescript-eslint/explicit-member-accessibility': ['warn'], + '@typescript-eslint/type-annotation-spacing': ['error', { 'before': false, 'after': true }], + '@typescript-eslint/comma-dangle': ['error', { + 'arrays': 'always-multiline', + 'objects': 'always-multiline', + 'imports': 'always-multiline', + 'exports': 'always-multiline', + 'enums': 'always-multiline', + 'generics': 'always-multiline', + 'tuples': 'always-multiline', + 'functions': 'never', + }], }, }, ], diff --git a/packages/app-desktop/gui/KeymapConfig/utils/useKeymap.ts b/packages/app-desktop/gui/KeymapConfig/utils/useKeymap.ts index fe50bc80d..d381c702f 100644 --- a/packages/app-desktop/gui/KeymapConfig/utils/useKeymap.ts +++ b/packages/app-desktop/gui/KeymapConfig/utils/useKeymap.ts @@ -22,7 +22,7 @@ const useKeymap = (): [ Error, (keymapItems: KeymapItem[])=> void, (commandName: string, accelerator: string)=> void, - (commandName: string)=> void + (commandName: string)=> void, ] => { const [keymapItems, setKeymapItems] = useState(() => allKeymapItems()); const [keymapError, setKeymapError] = useState(null); diff --git a/packages/lib/services/searchengine/queryBuilder.ts b/packages/lib/services/searchengine/queryBuilder.ts index cc355d3c8..80692066c 100644 --- a/packages/lib/services/searchengine/queryBuilder.ts +++ b/packages/lib/services/searchengine/queryBuilder.ts @@ -13,12 +13,12 @@ enum Relation { enum Operation { UNION = 'UNION', - INTERSECT = 'INTERSECT' + INTERSECT = 'INTERSECT', } enum Requirement { EXCLUSION = 'EXCLUSION', - INCLUSION = 'INCLUSION' + INCLUSION = 'INCLUSION', } const notebookFilter = (terms: Term[], conditions: string[], params: string[], withs: string[]) => {