From 2d0e0d63ab35e7f05b108889464d0d0904080031 Mon Sep 17 00:00:00 2001 From: Eason Su Date: Mon, 9 Jan 2023 10:51:19 +0800 Subject: [PATCH] Prevent the "import/no-duplicates" warning for the externalization process --- .eslintrc.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.eslintrc.js b/.eslintrc.js index 9026f96c54..ce9a65a60f 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -40,5 +40,14 @@ module.exports = { additionalHooks: 'useSelect', }, ], + // When a file imports from both `@wordpress/components` and `extracted/@wordpress/components` + // at the same time, it would get the "no-duplicates" warning. It should be considered a + // false positive when working on the externalization process. So here we temporarily change + // to use "no-duplicate-imports" instead. + // + // TODO: After the externalizations of `@wordpress/*` and `@woocommerce/*` are complete, + // remove the following two lines of rule settings. + 'import/no-duplicates': 'off', + 'no-duplicate-imports': 'warn', }, };