From 47bf31b529f5f4cc252c82d0798b64cb423a8caf Mon Sep 17 00:00:00 2001 From: Ynda Jas Date: Thu, 31 Aug 2023 16:37:14 +0100 Subject: [PATCH] Update eslint-plugin-import MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2.28.0 introduced a breaking change to `import/order` where the order of nested groups (whose purpose is to define different types of imports that are of equivalent rank) started to matter: a single nested group would be treated as though it wasn't nested We [got around this][1] by adding a second nested group with most if not all of the other import types we use It looks like https://github.com/ministryofjustice/hmpps-accredited-programmes-ui/pull/141 brought us back to 2.27.5. If we go back to 2.28.0 now and revert to the simpler config, for some reason the ESLint errors don't reappear In any case, I submitted a [bug fix][2] in eslint-plugin-import 💅 This was released in 2.28.1, so we should upgrade, hopefully preventing an unexpected return to confusing errors [1]: https://github.com/ministryofjustice/hmpps-accredited-programmes-ui/commit/ab5a73e73b4a0a0223ddf0eb3c2362db81cc12f2 [2]: https://github.com/import-js/eslint-plugin-import/pull/2854 --- .eslintrc.json | 5 +---- package-lock.json | 2 +- package.json | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index c567ea99a..37f7701ff 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -105,10 +105,7 @@ "error", { "alphabetize": { "order": "asc", "orderImportKind": "asc" }, - "groups": [ - ["builtin", "external"], - ["internal", "parent", "sibling"] - ], + "groups": [["builtin", "external"]], "newlines-between": "always" } ], diff --git a/package-lock.json b/package-lock.json index 33f9ff19d..82bda1bf2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -79,7 +79,7 @@ "eslint-config-prettier": "^9.0.0", "eslint-import-resolver-typescript": "^3.5.5", "eslint-plugin-cypress": "^2.13.2", - "eslint-plugin-import": "^2.27.5", + "eslint-plugin-import": "^2.28.1", "eslint-plugin-no-only-tests": "^3.1.0", "eslint-plugin-prettier": "^5.0.0", "eslint-plugin-sort-exports": "^0.8.0", diff --git a/package.json b/package.json index 4c2d22649..39067371b 100644 --- a/package.json +++ b/package.json @@ -121,7 +121,7 @@ "eslint-config-prettier": "^9.0.0", "eslint-import-resolver-typescript": "^3.5.5", "eslint-plugin-cypress": "^2.13.2", - "eslint-plugin-import": "^2.27.5", + "eslint-plugin-import": "^2.28.1", "eslint-plugin-no-only-tests": "^3.1.0", "eslint-plugin-prettier": "^5.0.0", "eslint-plugin-sort-exports": "^0.8.0",