From f4bfd247da96d2e40424b6d3c5a9e89da8caf51d Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 15 Apr 2022 15:05:43 +0900 Subject: [PATCH] chore: add import/order rule for eslint --- packages/backend/.eslintrc.cjs | 12 ++++++++++++ packages/shared/.eslintrc.js | 3 +++ 2 files changed, 15 insertions(+) diff --git a/packages/backend/.eslintrc.cjs b/packages/backend/.eslintrc.cjs index e2e31e9e3..dfc9d0495 100644 --- a/packages/backend/.eslintrc.cjs +++ b/packages/backend/.eslintrc.cjs @@ -6,4 +6,16 @@ module.exports = { extends: [ '../shared/.eslintrc.js', ], + rules: { + 'import/order': ['warn', { + 'groups': ['builtin', 'external', 'internal', 'parent', 'sibling', 'index', 'object', 'type'], + 'pathGroups': [ + { + 'pattern': '@/**', + 'group': 'external', + 'position': 'after' + } + ], + }] + }, }; diff --git a/packages/shared/.eslintrc.js b/packages/shared/.eslintrc.js index 2d3356c3a..4d9d6f2c8 100644 --- a/packages/shared/.eslintrc.js +++ b/packages/shared/.eslintrc.js @@ -68,5 +68,8 @@ module.exports = { }], 'import/no-unresolved': ['off'], 'import/no-default-export': ['warn'], + 'import/order': ['warn', { + 'groups': ['builtin', 'external', 'internal', 'parent', 'sibling', 'index', 'object', 'type'], + }] }, };