Skip to content

Commit 7d81ec6

Browse files
committed
For parity with modern Core/Gutenberg code, set one-var to "never"
1 parent d27c0b8 commit 7d81ec6

File tree

5 files changed

+34
-31
lines changed

5 files changed

+34
-31
lines changed

.eslintrc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,8 @@
33
"es6": true,
44
"node": true
55
},
6-
"extends": "plugin:@wordpress/eslint-plugin/recommended"
6+
"extends": "plugin:@wordpress/eslint-plugin/recommended",
7+
"rules": {
8+
"one-var": ["error", "never"]
9+
}
710
}

lib/trac.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
const url = require( 'url' ),
2-
grunt = require( 'grunt' );
1+
const url = require( 'url' );
2+
const grunt = require( 'grunt' );
33

44
module.exports = {
55
convertToRaw( parsedUrl ) {

tasks/patch_wordpress.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,10 @@ module.exports = function( grunt ) {
137137
}
138138

139139
function getPatchFromTicket( patchUrl, options ) {
140-
let matches,
141-
longMatches,
142-
matchUrl,
143-
possiblePatches;
140+
let matches;
141+
let longMatches;
142+
let matchUrl;
143+
let possiblePatches;
144144

145145
grunt.log.debug( 'getPatchFromTicket: ' + patchUrl );
146146
request( patchUrl, function( error, response, body ) {
@@ -185,9 +185,9 @@ module.exports = function( grunt ) {
185185
}
186186

187187
function getLocalPatch( patchUrl ) {
188-
const body = grunt.file.read( patchUrl ),
189-
level = patch.isAb( body ) ? 1 : 0,
190-
moveToSrc = patch.moveToSrc( body );
188+
const body = grunt.file.read( patchUrl );
189+
const level = patch.isAb( body ) ? 1 : 0;
190+
const moveToSrc = patch.moveToSrc( body );
191191

192192
grunt.file.copy( patchUrl, tempFile );
193193
grunt.event.emit( 'fileReady', level, moveToSrc );

test/patch_wordpress_test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
'use strict';
22

3-
const grunt = require( 'grunt' ),
4-
patch = require( '../lib/patch.js' ),
5-
url = require( 'url' ),
6-
trac = require( '../lib/trac.js' ),
7-
mapOldToNewFilePath = require( '../lib/map_old_to_new_file_path.js' );
3+
const grunt = require( 'grunt' );
4+
const patch = require( '../lib/patch.js' );
5+
const url = require( 'url' );
6+
const trac = require( '../lib/trac.js' );
7+
const mapOldToNewFilePath = require( '../lib/map_old_to_new_file_path.js' );
88

99
describe( 'grunt_patch_wordpress', function() {
1010
describe( 'sanity checks', function() {

test/patches.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
const grunt = require( 'grunt' ),
2-
patch = require( '../lib/patch.js' ),
3-
coreGit = grunt.file.read( 'test/fixtures/core.git.diff' ),
4-
coreSvn = grunt.file.read( 'test/fixtures/core.svn.diff' ),
5-
developGit = grunt.file.read( 'test/fixtures/develop.git.diff' ),
6-
developSvn = grunt.file.read( 'test/fixtures/develop.svn.diff' ),
7-
coreIndexGit = grunt.file.read( 'test/fixtures/core.git.index.diff' ),
8-
coreIndexSvn = grunt.file.read( 'test/fixtures/core.svn.index.diff' ),
9-
developIndexGit = grunt.file.read( 'test/fixtures/develop.git.index.diff' ),
10-
developIndexSvn = grunt.file.read( 'test/fixtures/develop.svn.index.diff' ),
11-
developSampleGit = grunt.file.read( 'test/fixtures/develop.git.wp-config-sample.diff' ),
12-
developSampleSvn = grunt.file.read( 'test/fixtures/develop.svn.wp-config-sample.diff' ),
13-
testsSvn = grunt.file.read( 'test/fixtures/tests.develop.svn.diff' ),
14-
testsGit = grunt.file.read( 'test/fixtures/tests.develop.git.diff' ),
15-
abyes = grunt.file.read( 'test/fixtures/git.diff.ab.diff' ),
16-
coreTrunkSvn = grunt.file.read( 'test/fixtures/core.svn.trunk.diff' );
1+
const grunt = require( 'grunt' );
2+
const patch = require( '../lib/patch.js' );
3+
const coreGit = grunt.file.read( 'test/fixtures/core.git.diff' );
4+
const coreSvn = grunt.file.read( 'test/fixtures/core.svn.diff' );
5+
const developGit = grunt.file.read( 'test/fixtures/develop.git.diff' );
6+
const developSvn = grunt.file.read( 'test/fixtures/develop.svn.diff' );
7+
const coreIndexGit = grunt.file.read( 'test/fixtures/core.git.index.diff' );
8+
const coreIndexSvn = grunt.file.read( 'test/fixtures/core.svn.index.diff' );
9+
const developIndexGit = grunt.file.read( 'test/fixtures/develop.git.index.diff' );
10+
const developIndexSvn = grunt.file.read( 'test/fixtures/develop.svn.index.diff' );
11+
const developSampleGit = grunt.file.read( 'test/fixtures/develop.git.wp-config-sample.diff' );
12+
const developSampleSvn = grunt.file.read( 'test/fixtures/develop.svn.wp-config-sample.diff' );
13+
const testsSvn = grunt.file.read( 'test/fixtures/tests.develop.svn.diff' );
14+
const testsGit = grunt.file.read( 'test/fixtures/tests.develop.git.diff' );
15+
const abyes = grunt.file.read( 'test/fixtures/git.diff.ab.diff' );
16+
const coreTrunkSvn = grunt.file.read( 'test/fixtures/core.svn.trunk.diff' );
1717

1818
describe( 'Patch helpers', function() {
1919
it( 'git a/b diffs should not automatticaly trigger moving to src', function() {

0 commit comments

Comments
 (0)