From 8231abd5389379f68bbd2a822297b1fa43d67e2c Mon Sep 17 00:00:00 2001 From: Jakub Romanczyk Date: Thu, 14 Mar 2024 16:13:20 +0100 Subject: [PATCH] feat: add eslint rule for date-fns imports --- .eslintrc.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.eslintrc.js b/.eslintrc.js index 0661183101ab..33be8cb62fcd 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -51,6 +51,10 @@ const restrictedImportPaths = [ name: '@styles/theme/illustrations', message: 'Do not import theme illustrations directly. Please use the `useThemeIllustrations` hook instead.', }, + { + name: 'date-fns/locale', + message: "Do not import 'date-fns/locale' directly. Please use the submodule import instead, like 'date-fns/locale/en-GB'.", + }, ]; const restrictedImportPatterns = [