Skip to content

Commit

Permalink
fixup! module: use buffer.toString base64
Browse files Browse the repository at this point in the history
Co-authored-by: Antoine du Hamel <[email protected]>
  • Loading branch information
legendecas and aduh95 authored Dec 19, 2024
1 parent 7572a08 commit 5f90d08
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/eslint.config_partial.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ const noRestrictedSyntax = [
selector: "CallExpression[callee.object.name='assert']:not([callee.property.name='ok']):not([callee.property.name='fail']):not([callee.property.name='ifError'])",
message: 'Only use simple assertions',
},
// Forbids usages of `btoa` like:
// ```
// const { btoa } = internalBinding('buffer');
// btoa('...');
// ```
{
// Forbids usages of `btoa` that are not caught by no-restricted-globals, like:
// ```
// const { btoa } = internalBinding('buffer');
// btoa('...');
// ```
selector: "CallExpression[callee.property.name='btoa'], CallExpression[callee.name='btoa']",
message: "`btoa` supports only latin-1 charset, use Buffer.from(str).toString('base64') instead",
},
Expand Down

0 comments on commit 5f90d08

Please sign in to comment.