Skip to content
This repository was archived by the owner on Jun 9, 2021. It is now read-only.

Commit 807d483

Browse files
committed
Linting with JSHint
* Found JS that may crashes in IE9. #116
1 parent 6e92abe commit 807d483

File tree

6 files changed

+25
-7
lines changed

6 files changed

+25
-7
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
Changelog of Pull Request Notifier for Bitbucket.
44

5+
## Unreleased
6+
### No issue
7+
doc
8+
9+
[6e92abeebfaae7b](https://github.com/tomasbjerre/pull-request-notifier-for-bitbucket/commit/6e92abeebfaae7b) Tomas Bjerre *2016-05-11 15:36:41*
10+
511
## 2.19
612
### No issue
713
Using password type for keystore password field

Gruntfile.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@ module.exports = function(grunt) {
22
grunt.initConfig({
33
pkg: grunt.file.readJSON('package.json'),
44

5+
jshint: {
6+
all: [
7+
'src/main/resources/pr-triggerbutton.js',
8+
'src/main/resources/admin.js',
9+
'src/main/resources/utils.js'
10+
],
11+
options: {
12+
esversion: 3
13+
}
14+
},
515

616
jsbeautifier: {
717
files: ["Gruntfile.js",
@@ -29,6 +39,7 @@ module.exports = function(grunt) {
2939
});
3040

3141
grunt.loadNpmTasks("grunt-jsbeautifier");
42+
grunt.loadNpmTasks('grunt-contrib-jshint');
3243

33-
grunt.registerTask('default', ['jsbeautifier']);
44+
grunt.registerTask('default', ['jsbeautifier', 'jshint']);
3445
};

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"devDependencies": {
33
"grunt": "0.4.5",
44
"grunt-cli": "0.1.13",
5+
"grunt-contrib-jshint": "^1.0.0",
56
"grunt-jsbeautifier": "0.2.10"
67
}
78
}

src/main/resources/3rdparty.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
define('plugin/prnfb/3rdparty', [
2-
'jquery',
2+
'jquery'
33
], function($) {
44

55
/**

src/main/resources/pr-triggerbutton.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ define('plugin/prnfb/pr-triggerbutton', [
2323
$buttonArea.append($buttonDropdownParent);
2424
$buttonDropdownParent.hide();
2525

26-
$("body").append($buttonDropdownArea)
26+
$("body").append($buttonDropdownArea);
2727

2828
function loadSettingsAndShowButtons() {
2929
var hasButtons = false;

src/main/resources/utils.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ define('plugin/prnfb/utils', [
114114
}
115115
}
116116
var textareas = $within.find('textarea');
117-
for (var i = 0; i < textareas.length; i++) {
118-
if ($(textareas[i]).val()) {
117+
for (var j = 0; j < textareas.length; j++) {
118+
if ($(textareas[j]).val()) {
119119
return false;
120120
}
121121
}
@@ -139,7 +139,7 @@ define('plugin/prnfb/utils', [
139139
}
140140
}
141141

142-
if (empties.length == 0) {
142+
if (empties.length === 0) {
143143
$empty = $listField.clone();
144144
$empty.find('input, textarea').val('');
145145
$listFieldsDiv.append($empty);
@@ -252,5 +252,5 @@ define('plugin/prnfb/utils', [
252252
return {
253253
setupForm: setupForm,
254254
setupForms: setupForms
255-
}
255+
};
256256
});

0 commit comments

Comments
 (0)