From 6d552c88d7a29458452f2f676887197aac843e26 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Wed, 27 Oct 2021 17:35:13 +0200 Subject: [PATCH] fixup! tools: fix bug in `prefer-primordials` ESLint rule --- .../parallel/test-eslint-prefer-primordials.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/parallel/test-eslint-prefer-primordials.js b/test/parallel/test-eslint-prefer-primordials.js index 0df64083fddb3c..aa7f1940675f77 100644 --- a/test/parallel/test-eslint-prefer-primordials.js +++ b/test/parallel/test-eslint-prefer-primordials.js @@ -89,6 +89,15 @@ new RuleTester({ `, options: [{ name: 'Function' }], }, + { + code: ` + const { Function } = primordials; + let rename; + rename = Function; + const obj = { rename }; + `, + options: [{ name: 'Function' }], + }, ], invalid: [ { @@ -211,5 +220,14 @@ new RuleTester({ options: [{ name: 'Function' }], errors: [{ message: /const { Function } = primordials/ }] }, + { + code: ` + let rename; + rename = Function; + const obj = { rename }; + `, + options: [{ name: 'Function' }], + errors: [{ message: /const { Function } = primordials/ }] + }, ] });