Skip to content

Commit 6d552c8

Browse files
committed
fixup! tools: fix bug in prefer-primordials ESLint rule
1 parent c73865c commit 6d552c8

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

test/parallel/test-eslint-prefer-primordials.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,15 @@ new RuleTester({
8989
`,
9090
options: [{ name: 'Function' }],
9191
},
92+
{
93+
code: `
94+
const { Function } = primordials;
95+
let rename;
96+
rename = Function;
97+
const obj = { rename };
98+
`,
99+
options: [{ name: 'Function' }],
100+
},
92101
],
93102
invalid: [
94103
{
@@ -211,5 +220,14 @@ new RuleTester({
211220
options: [{ name: 'Function' }],
212221
errors: [{ message: /const { Function } = primordials/ }]
213222
},
223+
{
224+
code: `
225+
let rename;
226+
rename = Function;
227+
const obj = { rename };
228+
`,
229+
options: [{ name: 'Function' }],
230+
errors: [{ message: /const { Function } = primordials/ }]
231+
},
214232
]
215233
});

0 commit comments

Comments
 (0)