Skip to content

require-buffer lint fixer

Partially Fixes #16636 (closed) (adds the require-buffer lint fixer).

If the buffer module is not required while Buffer is used, require the buffer module as follows:

const { Buffer } = require('buffer');
  • If the file has a 'use strict'; line, add the require after it on a separate line.
  • If the file does not have any (currently impossible with the strict rule) add it after the first comment and before the real code starts.
Checklist
Affected core subsystem(s)

tools

Merge request reports

Loading