eslint-plugin

@masknet/no-builtin-base64

Disallow use built-in base64 function

Rule Details

atob and btoa can’t be handled

:x: Incorrect

atob('...') // decode base64
btoa('...') // encode base64

:white_check_mark: Correct

import Buffer from 'buffer'
Buffer.from(input, 'base64') // decode base64 with Buffer
buffer.toString('base64') // encode base64 with Buffer

When Not To Use It

When you don’t want to include the “buffer” module in your bundle.

Attributes