Skip to content

Commit

Permalink
Added gulpfile.js, .jshintrc and .jscsrc.
Browse files Browse the repository at this point in the history
  • Loading branch information
baig committed Mar 28, 2015
1 parent 587a2ce commit 9ea4234
Show file tree
Hide file tree
Showing 5 changed files with 212 additions and 31 deletions.
76 changes: 76 additions & 0 deletions .jscsrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
"requireCurlyBraces": [
"if",
"else",
"for",
"while",
"do",
"try",
"catch"
],
"requireSpaceAfterKeywords": [
"if",
"else",
"for",
"while",
"do",
"switch",
"case",
"return",
"try",
"catch",
"function",
"typeof"
],
"requireSpaceBeforeBlockStatements": true,
"requireParenthesesAroundIIFE": true,
"requireSpacesInConditionalExpression": true,
"disallowSpacesInNamedFunctionExpression": {
"beforeOpeningRoundBrace": true
},
"disallowSpacesInFunctionDeclaration": {
"beforeOpeningRoundBrace": true
},
"requireSpaceBetweenArguments": true,
"requireBlocksOnNewline": true,
"disallowEmptyBlocks": true,
"disallowSpacesInsideArrayBrackets": true,
"disallowSpacesInsideParentheses": true,
"requireCommaBeforeLineBreak": true,
"disallowSpaceAfterPrefixUnaryOperators": true,
"disallowSpaceBeforePostfixUnaryOperators": true,
"disallowSpaceBeforeBinaryOperators": [
","
],
"requireSpacesInForStatement": true,
"requireSpaceBeforeBinaryOperators": true,
"requireSpaceAfterBinaryOperators": true,
"disallowKeywords": [
"with",
"continue"
],
"validateIndentation": 4,
"disallowMixedSpacesAndTabs": true,
"disallowTrailingWhitespace": true,
"disallowTrailingComma": true,
"disallowKeywordsOnNewLine": [
"else"
],
"requireLineFeedAtFileEnd": true,
"requireCapitalizedConstructors": true,
"requireDotNotation": true,
"disallowNewlineBeforeBlockStatements": true,
"disallowMultipleLineStrings": true,
"requireSpaceBeforeObjectValues": true,


"maximumLineLength": 100,
"requireDollarBeforejQueryAssignment": true,
"requireCamelCaseOrUpperCaseIdentifiers": true,
"requireAlignedObjectValues": "ignoreLineBreak",
"disallowYodaConditions": true,
"disallowTrailingWhitespace": true,
"disallowOperatorBeforeLineBreak": ["?", "."],
"validateQuoteMarks": { "mark": "\"", "escape": true }

}
70 changes: 70 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"bitwise" : true,
"curly" : true,
"eqeqeq" : true,
"forin" : true,
"immed" : true,
"latedef" : true,
"newcap" : true,
"noarg" : true,
"noempty" : true,
"nonew" : true,
"plusplus" : false,
"regexp" : true,
"undef" : true,
"strict" : true,
"unused" : "vars",

"asi" : false,
"boss" : false,
"debug" : false,
"eqnull" : false,
"es5" : false,
"esnext" : false,
"evil" : false,
"expr" : false,
"funcscope" : false,
"globalstrict" : false,
"iterator" : false,
"lastsemic" : false,
"laxbreak" : true,
"laxcomma" : false,
"loopfunc" : false,
"multistr" : false,
"onecase" : false,
"proto" : false,
"regexdash" : false,
"scripturl" : false,
"shadow" : false,
"sub" : false,
"supernew" : false,
"validthis" : false,

"browser" : false,
"couch" : false,
"devel" : true,
"dojo" : false,
"jquery" : false,
"mootools" : false,
"node" : false,
"nonstandard" : false,
"prototypejs" : false,
"rhino" : false,
"wsh" : false,

"maxerr" : 100,
"indent" : 4,
"globals" : {
"window": false,
"document": false,
"setTimeout": false,
"require": true,
"define": true,
"brackets": true,
"$": true,
"PathUtils": false,
"window": false,
"navigator": false,
"Mustache": true
}
}
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ The subsection are to be interpreted as defined [here](http://keepachangelog.com

[Unreleased][unreleased]

### Added
- Added `lint` task in gulpfile.js for linting using `JSHint` and code
style checking using `JSCS`.

### Changed
- Updated gitignore.

Expand All @@ -22,7 +26,7 @@ The subsection are to be interpreted as defined [here](http://keepachangelog.com
- Replaced string event names with string constants in
Events' namespace.
- Many other minor changes.
- Updated template for existing cites.
- Updated template for existing cites.

### Fixed
- Spaces in URL are replaced by %20 while loading icon
Expand Down Expand Up @@ -111,4 +115,4 @@ Initial release
[0.1.4]: https://github.com/baig/brackets-zotero/compare/0.1.3...0.1.4
[0.1.3]: https://github.com/baig/brackets-zotero/compare/0.1.2...0.1.3
[0.1.2]: https://github.com/baig/brackets-zotero/compare/0.1.1...0.1.2
[0.1.1]: https://github.com/baig/brackets-zotero/compare/0.1.0...0.1.1
[0.1.1]: https://github.com/baig/brackets-zotero/compare/0.1.0...0.1.1
24 changes: 24 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*jslint vars: true */
/*global require */

var gulp = require('gulp');
var noop = function () {
"use strict";
};

gulp.task('lint', function () {
"use strict";
/* style and lint errors */
var jscs = require('gulp-jscs');
var jshint = require('gulp-jshint');
var stylish = require('gulp-jscs-stylish');

gulp.src(['./main.js', 'src/**/*.js', '!src/thirdparty/**/*.js'])
.pipe(jshint()) // hint
.pipe(jscs()) // enforce style guide
.on('error', noop) // don't stop on error
.pipe(stylish.combineWithHintResults()) // combine with jshint results
.pipe(jshint.reporter('jshint-stylish')); // use any jshint reporter to log hint and style guide errors
});

gulp.task('default', ['lint']);
65 changes: 36 additions & 29 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,38 @@
{
"name": "baig.brackets-zotero",
"version": "0.1.6",
"title": "Zotero Integration",
"description": "Add In-Text Citations and Manage Bibliographies in Scholarly Markdown using Zotero",
"homepage": "http://baig.github.io/brackets-zotero/",
"engines": {
"brackets": ">=1.1.0"
},
"author": "Wasif Hasan Baig <[email protected]>",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/baig/brackets-zotero.git"
},
"bugs": {
"url": "https://github.com/baig/brackets-zotero/issues",
"email": "[email protected]"
},
"keywords": [
"zotero",
"citation",
"reference",
"citation management",
"reference management",
"bibliography generation"
],
"i18n": [
"en"
]
"name": "baig.brackets-zotero",
"version": "0.1.6",
"title": "Zotero Integration",
"description": "Add In-Text Citations and Manage Bibliographies in Scholarly Markdown using Zotero",
"homepage": "http://baig.github.io/brackets-zotero/",
"engines": {
"brackets": ">=1.1.0"
},
"author": "Wasif Hasan Baig <[email protected]>",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/baig/brackets-zotero.git"
},
"bugs": {
"url": "https://github.com/baig/brackets-zotero/issues",
"email": "[email protected]"
},
"keywords": [
"zotero",
"citation",
"reference",
"citation management",
"reference management",
"bibliography generation"
],
"i18n": [
"en"
],
"devDependencies": {
"gulp": "^3.8.11",
"gulp-jscs": "^1.4.0",
"gulp-jscs-stylish": "^1.0.2",
"gulp-jshint": "^1.9.4",
"jshint-stylish": "^1.0.1"
}
}

0 comments on commit 9ea4234

Please sign in to comment.