Skip to content

Commit

Permalink
fixup! tools: fix bug in prefer-primordials ESLint rule
Browse files Browse the repository at this point in the history
  • Loading branch information
aduh95 committed Oct 27, 2021
1 parent c73865c commit 6d552c8
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/parallel/test-eslint-prefer-primordials.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,15 @@ new RuleTester({
`,
options: [{ name: 'Function' }],
},
{
code: `
const { Function } = primordials;
let rename;
rename = Function;
const obj = { rename };
`,
options: [{ name: 'Function' }],
},
],
invalid: [
{
Expand Down Expand Up @@ -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/ }]
},
]
});

0 comments on commit 6d552c8

Please sign in to comment.