Skip to content

Commit 057e6f9

Browse files
committed
chore(lint): declare variable on own line
1 parent 52ce499 commit 057e6f9

6 files changed

Lines changed: 37 additions & 16 deletions

File tree

lib/parseJob.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
const fs = require('fs');
2323
const parser = require('./parser/pbxproj');
2424
const path = process.argv[2];
25-
let fileContents; let obj;
25+
let fileContents;
26+
let obj;
2627

2728
try {
2829
fileContents = fs.readFileSync(path, 'utf-8');

lib/pbxProject.js

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1289,7 +1289,8 @@ PBXProject.prototype.addToOtherLinkerFlags = function (flag) {
12891289
const configurations = nonComments(this.pbxXCBuildConfigurationSection());
12901290
const INHERITED = '"$(inherited)"';
12911291
const OTHER_LDFLAGS = 'OTHER_LDFLAGS';
1292-
let config; let buildSettings;
1292+
let config;
1293+
let buildSettings;
12931294

12941295
for (config in configurations) {
12951296
buildSettings = configurations[config].buildSettings;
@@ -1308,7 +1309,8 @@ PBXProject.prototype.addToOtherLinkerFlags = function (flag) {
13081309
PBXProject.prototype.removeFromOtherLinkerFlags = function (flag) {
13091310
const configurations = nonComments(this.pbxXCBuildConfigurationSection());
13101311
const OTHER_LDFLAGS = 'OTHER_LDFLAGS';
1311-
let config; let buildSettings;
1312+
let config;
1313+
let buildSettings;
13121314

13131315
for (config in configurations) {
13141316
buildSettings = configurations[config].buildSettings;
@@ -1331,7 +1333,8 @@ PBXProject.prototype.removeFromOtherLinkerFlags = function (flag) {
13311333

13321334
PBXProject.prototype.addToBuildSettings = function (buildSetting, value) {
13331335
const configurations = nonComments(this.pbxXCBuildConfigurationSection());
1334-
let config; let buildSettings;
1336+
let config;
1337+
let buildSettings;
13351338

13361339
for (config in configurations) {
13371340
buildSettings = configurations[config].buildSettings;
@@ -1342,7 +1345,8 @@ PBXProject.prototype.addToBuildSettings = function (buildSetting, value) {
13421345

13431346
PBXProject.prototype.removeFromBuildSettings = function (buildSetting) {
13441347
const configurations = nonComments(this.pbxXCBuildConfigurationSection());
1345-
let config; let buildSettings;
1348+
let config;
1349+
let buildSettings;
13461350

13471351
for (config in configurations) {
13481352
buildSettings = configurations[config].buildSettings;
@@ -1356,7 +1360,8 @@ PBXProject.prototype.removeFromBuildSettings = function (buildSetting) {
13561360
// a JS getter. hmmm
13571361
PBXProject.prototype.__defineGetter__('productName', function () {
13581362
const configurations = nonComments(this.pbxXCBuildConfigurationSection());
1359-
let config; let productName;
1363+
let config;
1364+
let productName;
13601365

13611366
for (config in configurations) {
13621367
productName = configurations[config].buildSettings.PRODUCT_NAME;
@@ -1370,7 +1375,9 @@ PBXProject.prototype.__defineGetter__('productName', function () {
13701375
// check if file is present
13711376
PBXProject.prototype.hasFile = function (filePath) {
13721377
const files = nonComments(this.pbxFileReferenceSection());
1373-
let file; let id;
1378+
let file;
1379+
let id;
1380+
13741381
for (id in files) {
13751382
file = files[id];
13761383
if (file.path === filePath || file.path === ('"' + filePath + '"')) {
@@ -1666,7 +1673,8 @@ function searchPathForFile (file, proj) {
16661673

16671674
function nonComments (obj) {
16681675
const keys = Object.keys(obj);
1669-
const newObj = {}; let i = 0;
1676+
const newObj = {};
1677+
let i = 0;
16701678

16711679
for (i; i < keys.length; i++) {
16721680
if (!COMMENT_KEY.test(keys[i])) {

lib/pbxWriter.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,9 @@ pbxWriter.prototype.writeHeadComment = function () {
9797

9898
pbxWriter.prototype.writeProject = function () {
9999
const proj = this.contents.project;
100-
let key; let cmt; let obj;
100+
let key;
101+
let cmt;
102+
let obj;
101103

102104
this.write('{\n');
103105

test/addFramework.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ function nonComments (obj) {
4646
function frameworkSearchPaths (proj) {
4747
const configs = nonComments(proj.pbxXCBuildConfigurationSection());
4848
const allPaths = [];
49-
const ids = Object.keys(configs); let buildSettings;
49+
const ids = Object.keys(configs);
50+
let buildSettings;
5051

5152
for (let i = 0; i < ids.length; i++) {
5253
buildSettings = configs[ids[i]].buildSettings;

test/addStaticLibrary.js

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ function cleanHash () {
3131

3232
function nonComments (obj) {
3333
const keys = Object.keys(obj);
34-
const newObj = {}; let i = 0;
34+
const newObj = {};
35+
let i = 0;
3536

3637
for (i; i < keys.length; i++) {
3738
if (!/_comment$/.test(keys[i])) {
@@ -45,7 +46,9 @@ function nonComments (obj) {
4546
function librarySearchPaths (proj) {
4647
const configs = nonComments(proj.pbxXCBuildConfigurationSection());
4748
const allPaths = [];
48-
const ids = Object.keys(configs); let i; let buildSettings;
49+
const ids = Object.keys(configs);
50+
let i;
51+
let buildSettings;
4952

5053
for (i = 0; i < ids.length; i++) {
5154
buildSettings = configs[ids[i]].buildSettings;
@@ -162,7 +165,9 @@ describe('addStaticLibrary', () => {
162165
it('should set LIBRARY_SEARCH_PATHS for appropriate build configurations', () => {
163166
proj.addStaticLibrary('libGoogleAnalytics.a');
164167
const configs = nonComments(proj.pbxXCBuildConfigurationSection());
165-
const ids = Object.keys(configs); let i; let buildSettings;
168+
const ids = Object.keys(configs);
169+
let i;
170+
let buildSettings;
166171

167172
for (i = 0; i < ids.length; i++) {
168173
buildSettings = configs[ids[i]].buildSettings;
@@ -176,7 +181,8 @@ describe('addStaticLibrary', () => {
176181
it('should ensure LIBRARY_SEARCH_PATHS inherits defaults correctly', () => {
177182
proj.addStaticLibrary('libGoogleAnalytics.a');
178183
const libraryPaths = librarySearchPaths(proj);
179-
let i; let current;
184+
let i;
185+
let current;
180186

181187
for (i = 0; i < libraryPaths.length; i++) {
182188
current = libraryPaths[i];
@@ -188,7 +194,8 @@ describe('addStaticLibrary', () => {
188194
proj.addStaticLibrary('libGoogleAnalytics.a');
189195
const libraryPaths = librarySearchPaths(proj);
190196
const expectedPath = '"\\"$(SRCROOT)/KitchenSinktablet\\""';
191-
let i; let current;
197+
let i;
198+
let current;
192199

193200
for (i = 0; i < libraryPaths.length; i++) {
194201
current = libraryPaths[i];

test/xcode5searchPaths.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ describe('addAndRemoveToFromLibrarySearchPaths', () => {
4040
it('add should add the path to each configuration section', () => {
4141
const expected = '"\\"$(SRCROOT)/$(TARGET_NAME)/some/path\\""';
4242
const config = proj.pbxXCBuildConfigurationSection();
43-
let ref; let lib; let refSettings;
43+
let ref;
44+
let lib;
45+
let refSettings;
4446

4547
proj.addToLibrarySearchPaths(libPoop);
4648

0 commit comments

Comments
 (0)