Commit e0c7d78 1 parent 58f61db commit e0c7d78 Copy full SHA for e0c7d78
File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
- const BUFFER_REQUIRE = 'const { Buffer } = require(\'buffer\');\n ' ;
2
+ const BUFFER_REQUIRE = 'const { Buffer } = require(\'buffer\');' ;
3
3
4
4
module . exports = function ( context ) {
5
5
6
6
function flagIt ( reference ) {
7
- const msg = 'Use const Buffer = require(\'buffer\').Buffer; ' +
8
- 'at the beginning of this file' ;
7
+ const msg = `Use ${ BUFFER_REQUIRE } at the beginning of this file` ;
9
8
10
9
context . report ( {
11
10
node : reference . identifier ,
@@ -18,7 +17,8 @@ module.exports = function(context) {
18
17
const firstLOC = sourceCode . ast . range [ 0 ] ;
19
18
const rangeNeedle = hasUseStrict ? useStrict . lastIndex : firstLOC ;
20
19
21
- return fixer . insertTextBeforeRange ( [ rangeNeedle ] , BUFFER_REQUIRE ) ;
20
+ return fixer . insertTextBeforeRange ( [ rangeNeedle ] ,
21
+ `${ BUFFER_REQUIRE } \n` ) ;
22
22
}
23
23
} ) ;
24
24
}
You can’t perform that action at this time.
0 commit comments