Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lint: change require-buffer rule message #19701

Closed
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions tools/eslint-rules/require-buffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ const BUFFER_REQUIRE = 'const { Buffer } = require(\'buffer\');\n';
module.exports = function(context) {

function flagIt(reference) {
const msg = 'Use const Buffer = require(\'buffer\').Buffer; ' +
'at the beginning of this file';
const msg = `Use ${BUFFER_REQUIRE} at the beginning of this file`;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: BUFFER_REQUIRE adds a new line, is this wanted?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fantastic catch, thank you :)


context.report({
node: reference.identifier,
Expand Down