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

Commit

Permalink
Linting with JSHint
Browse files Browse the repository at this point in the history
 * Found JS that may crashes in IE9. #116
  • Loading branch information
tomasbjerre committed May 12, 2016
1 parent 6e92abe commit 807d483
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 7 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

Changelog of Pull Request Notifier for Bitbucket.

## Unreleased
### No issue
doc

[6e92abeebfaae7b](https://github.com/tomasbjerre/pull-request-notifier-for-bitbucket/commit/6e92abeebfaae7b) Tomas Bjerre *2016-05-11 15:36:41*

## 2.19
### No issue
Using password type for keystore password field
Expand Down
13 changes: 12 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@ module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),

jshint: {
all: [
'src/main/resources/pr-triggerbutton.js',
'src/main/resources/admin.js',
'src/main/resources/utils.js'
],
options: {
esversion: 3
}
},

jsbeautifier: {
files: ["Gruntfile.js",
Expand Down Expand Up @@ -29,6 +39,7 @@ module.exports = function(grunt) {
});

grunt.loadNpmTasks("grunt-jsbeautifier");
grunt.loadNpmTasks('grunt-contrib-jshint');

grunt.registerTask('default', ['jsbeautifier']);
grunt.registerTask('default', ['jsbeautifier', 'jshint']);
};
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"devDependencies": {
"grunt": "0.4.5",
"grunt-cli": "0.1.13",
"grunt-contrib-jshint": "^1.0.0",
"grunt-jsbeautifier": "0.2.10"
}
}
2 changes: 1 addition & 1 deletion src/main/resources/3rdparty.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
define('plugin/prnfb/3rdparty', [
'jquery',
'jquery'
], function($) {

/**
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/pr-triggerbutton.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ define('plugin/prnfb/pr-triggerbutton', [
$buttonArea.append($buttonDropdownParent);
$buttonDropdownParent.hide();

$("body").append($buttonDropdownArea)
$("body").append($buttonDropdownArea);

function loadSettingsAndShowButtons() {
var hasButtons = false;
Expand Down
8 changes: 4 additions & 4 deletions src/main/resources/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ define('plugin/prnfb/utils', [
}
}
var textareas = $within.find('textarea');
for (var i = 0; i < textareas.length; i++) {
if ($(textareas[i]).val()) {
for (var j = 0; j < textareas.length; j++) {
if ($(textareas[j]).val()) {
return false;
}
}
Expand All @@ -139,7 +139,7 @@ define('plugin/prnfb/utils', [
}
}

if (empties.length == 0) {
if (empties.length === 0) {
$empty = $listField.clone();
$empty.find('input, textarea').val('');
$listFieldsDiv.append($empty);
Expand Down Expand Up @@ -252,5 +252,5 @@ define('plugin/prnfb/utils', [
return {
setupForm: setupForm,
setupForms: setupForms
}
};
});

0 comments on commit 807d483

Please sign in to comment.