From 79badbfae225c8d1fe98517efd3c372f970f966e 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 I [fixed the bug][2] in eslint-plugin-import 💅🏻 and this was released in 2.28.1, so we can now revert to the simpler config post-upgrade [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",