From 695ddd7a92c3af1750fb16d5077846a93ea4cc08 Mon Sep 17 00:00:00 2001 From: Morning1139Angel <127003598+Morning1139Angel@users.noreply.github.com> Date: Thu, 29 Jun 2023 21:49:03 +0330 Subject: [PATCH] Func style allowing arrow (#461) * eslint func-style rule added to server * eslint func-style rule added to front-end --- front/.eslintrc.js | 3 ++- front/src/modules/hotkeys/hooks/useDirectHotkeys.ts | 4 ++-- server/.eslintrc.js | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/front/.eslintrc.js b/front/.eslintrc.js index d433a16e5..c78088372 100644 --- a/front/.eslintrc.js +++ b/front/.eslintrc.js @@ -46,6 +46,7 @@ module.exports = { 'simple-import-sort/imports': 'error', 'simple-import-sort/exports': 'error', 'twenty/sort-css-properties-alphabetically': 'error', - 'twenty/no-hardcoded-colors': 'error' + 'twenty/no-hardcoded-colors': 'error', + 'func-style':['error', 'declaration', { 'allowArrowFunctions': true }], } }; diff --git a/front/src/modules/hotkeys/hooks/useDirectHotkeys.ts b/front/src/modules/hotkeys/hooks/useDirectHotkeys.ts index c1223f266..c2b76e8db 100644 --- a/front/src/modules/hotkeys/hooks/useDirectHotkeys.ts +++ b/front/src/modules/hotkeys/hooks/useDirectHotkeys.ts @@ -15,7 +15,7 @@ export function useDirectHotkeys( ) { const [pendingHotkey, setPendingHotkey] = useRecoilState(pendingHotkeyState); - const callbackIfDirectKey = function ( + function callbackIfDirectKey( keyboardEvent: KeyboardEvent, hotkeysEvent: Hotkey, ) { @@ -24,7 +24,7 @@ export function useDirectHotkeys( return; } setPendingHotkey(null); - }; + } useHotkeys(keys, callbackIfDirectKey, dependencies); } diff --git a/server/.eslintrc.js b/server/.eslintrc.js index 1672a34e0..495f70b1e 100644 --- a/server/.eslintrc.js +++ b/server/.eslintrc.js @@ -21,5 +21,6 @@ module.exports = { '@typescript-eslint/explicit-function-return-type': 'off', '@typescript-eslint/explicit-module-boundary-types': 'off', '@typescript-eslint/no-explicit-any': 'off', + 'func-style':['error', 'declaration', { 'allowArrowFunctions': true }], }, };