Skip to content

Commit

Permalink
1.0.01 released
Browse files Browse the repository at this point in the history
  • Loading branch information
subchen committed May 25, 2015
1 parent 91e4428 commit 0dcf46f
Show file tree
Hide file tree
Showing 13 changed files with 712 additions and 1 deletion.
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
node_modules/
coverage/
*.log

.idea/
*.iml
*.iws

.settings/
.project
.classpath
23 changes: 23 additions & 0 deletions .jsbeautifyrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"braceStyle": "collapse",
"breakChainedMethods": false,
"commaFirst": false,
"e4x": false,
"evalCode": false,
"indentChar": " ",
"indentLevel": 0,
"indentSize": 4,
"indentWithTabs": false,
"indentInnerHtml": false,
"indentScripts": "normal",
"jslintHappy": false,
"keepArrayIndentation": false,
"keepFunctionIndentation": false,
"maxPreserveNewlines": 2,
"preserveNewlines": true,
"spaceBeforeConditional": true,
"spaceInParen": false,
"unescapeStrings": false,
"wrapLineLength": 0,
"endWithNewline": true
}
78 changes: 78 additions & 0 deletions .jscsrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{
"esnext": false,

"requireCurlyBraces": [
"if",
"else",
"for",
"while",
"do",
"try",
"catch"
],
"requireBlocksOnNewline": 1,
"requireOperatorBeforeLineBreak": true,
"requireCamelCaseOrUpperCaseIdentifiers": true,
"maximumLineLength": {
"value": 120,
"allowUrlComments": true,
"allowRegex": true
},
"validateIndentation": 4,
"validateQuoteMarks": "'",

"disallowMultipleLineStrings": true,
"disallowMixedSpacesAndTabs": true,
"disallowTrailingWhitespace": true,
"disallowSpaceAfterPrefixUnaryOperators": true,
"disallowMultipleVarDecl": true,

"requireSpaceAfterKeywords": [
"if",
"else",
"for",
"while",
"do",
"switch",
"return",
"try",
"catch"
],
"requireSpaceBeforeBinaryOperators": [
"=", "+=", "-=", "*=", "/=", "%=", "<<=", ">>=", ">>>=",
"&=", "|=", "^=", "+=",
"+", "-", "*", "/", "%", "<<", ">>", ">>>", "&",
"|", "^", "&&", "||", "===", "==", ">=",
"<=", "<", ">", "!=", "!=="
],
"requireSpaceAfterBinaryOperators": true,
"requireSpacesInConditionalExpression": true,
"requireSpaceBeforeBlockStatements": true,
"requireLineFeedAtFileEnd": true,

"requireParenthesesAroundIIFE": true,
"requireSpacesInFunctionDeclaration": {
"beforeOpeningCurlyBrace": true
},
"requireSpacesInAnonymousFunctionExpression": {
"beforeOpeningCurlyBrace": true
},
"requireSpacesInNamedFunctionExpression": {
"beforeOpeningCurlyBrace": true
},

"disallowYodaConditions": true,
"requireDotNotation": true,
"disallowSpacesInsideObjectBrackets": "all",
"disallowSpacesInsideArrayBrackets": "all",
"disallowSpacesInsideParentheses": true,
"disallowEmptyBlocks": true,

"additionalRules": [
"node_modules/jscs-jsdoc/lib/rules/*.js"
],
"validateJSDoc": {
"checkParamNames": true,
"requireParamTypes": true
}
}
74 changes: 74 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{
// Enforcing options
"bitwise" : true, // Prohibit bitwise operators (&, |, ^, etc.)
"curly" : false, // Require {} for every new block or scope
"eqeqeq" : true, // Require triple equals (===) for comparison
"es3" : false, // Adhere to ECMAScript 3
"es5" : false, // Allow ES5 syntax (ex: getters and setters)
"forin" : true, // Require filtering for..in loops with obj.hasOwnProperty()
"freeze" : true, // Prohibits overwriting prototypes of native objects such as Array, Date etc.
"funcscope" : false, // Tolerate defining variables inside control statements
"futurehostile" : true, // Use of identifiers which are defined in future versions of JavaScript
"globalstrict" : false, // Allow global "use strict" (also enables 'strict')
"iterator" : false, // Tolerate using the `__iterator__` property
"latedef" : true, // Require variables/functions to be defined before being used
"maxcomplexity" : 10, // Max cyclomatic complexity per function
"maxdepth" : 8, // Max depth of nested blocks (within functions)
"maxerr" : 50, // Maximum error before stopping
"maxparams" : 5, // Max number of formal params allowed per function
"maxstatements" : 50, // Max number statements per function
"noarg" : true, // Prohibit use of `arguments.caller` and `arguments.callee`
"nocomma" : true, // Prohibits the use of the comma operator
"nonbsp" : true, // Prohibit "non-breaking whitespace" characters.
"nonew" : true, // Prohibit use of constructors for side-effects (without assignment)
"notypeof" : false, // Tolerate invalid typeof operator values
"shadow" : false, // Allows re-define variables later in code e.g. `var x=1; x=2;`
"singleGroups" : false, // Prohibits the use of the grouping operator when it is not strictly required
"undef" : true, // Require all non-global variables to be declared (prevents global leaks)
"unused" : true, // Require all defined variables be used

// Relaxing options
"asi" : true, // Tolerate Automatic Semicolon Insertion (no semicolons)
"boss" : true, // Tolerate assignments where comparisons would be expected
"debug" : false, // Allow debugger statements e.g. browser breakpoints.
"elision" : false, // Tells JSHint that your code uses ES3 array elision elements, or empty element
"eqnull" : true, // Tolerate use of `== null`
"esnext" : true, // Allow ES.next (ES6) syntax (ex: `const`)
"evil" : false, // Tolerate use of `eval` and `new Function()`
"expr" : true, // Tolerate `ExpressionStatement` as Programs
"lastsemic" : false, // Tolerate omitting a semicolon for the last statement of a 1-line block
"loopfunc" : false, // Tolerate functions being defined in loops (ex: `for each`, multiple try/catch, function expression…)
"moz" : false, // Allow Mozilla specific syntax (extends and overrides esnext features)
"noyield" : false, // Tolerate generator functions with no yield statement in them.
"phantom" : false, // Defines globals available when your core is running inside of the PhantomJS runtime environment
"plusplus" : false, // Prohibit use of `++` & `--`
"proto" : false, // Tolerate using the `__proto__` property
"scripturl" : false, // Tolerate script-targeted URLs
"strict" : false, // true: Requires all functions run in ES5 Strict Mode
"supernew" : false, // Tolerate `new function () { ... };` and `new Object;`
"validthis" : false, // Tolerate using this in a non-constructor function
"withstmt" : false, // Suppresses warnings about the use of the with statement

// Environments
"browser" : false, // Web Browser (window, document, etc)
"browserify" : false, // Browserify
"couch" : false, // CouchDB
"devel" : false, // Development/debugging (alert, confirm, etc)
"dojo" : false, // Dojo Toolkit
"jasmine" : false, // Jasmine
"jquery" : false, // jQuery
"mocha" : false, // Mocha
"mootools" : false, // MooTools
"node" : true, // Node.js
"nonstandard" : false, // Widely adopted globals (escape, unescape, etc)
"prototypejs" : false, // Prototype and Scriptaculous
"qunit" : false, // QUnit
"rhino" : false, // Rhino
"shelljs" : false, // ShellJS
"worker" : false, // Web Workers
"wsh" : false, // Windows Scripting Host
"yui" : false, // Yahoo User Interface

// Custom Globals
"globals" : [] // additional predefined global variables
}
12 changes: 12 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
docs/
test/
coverage/

*.log

Gruntfile.js
.gitignore
.jsbeautifyrc
.jscsrc
.jshintrc
.travis.yml
9 changes: 9 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
language: node_js
node_js:
- "0.10"
- "0.12"
script:
- "npm run test-sa"
- "npm run test-cc"
after_script:
- "npm run test-cc-post"
47 changes: 47 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
module.exports = function(grunt) {

var jsfiles = [
'Gruntfile.js',
'index.js',
'lib/**/*.js',
'test/**/*.js'
];

grunt.initConfig({
trimtrailingspaces: {
main: {
src: jsfiles
}
},
jsbeautifier: {
options: {
config: '.jsbeautifyrc'
},
files: jsfiles
},
jshint: {
options: {
jshintrc: '.jshintrc'
},
files: jsfiles
},
jscs: {
options: {
config: '.jscsrc'
},
files: jsfiles
}
});

/*
grunt.loadNpmTasks('grunt-trimtrailingspaces');
grunt.loadNpmTasks('grunt-jsbeautifier');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-jscs');
*/
require('load-grunt-tasks')(grunt);

grunt.registerTask('sa-format', ['trimtrailingspaces', 'jsbeautifier']);
grunt.registerTask('sa-lint', ['jshint', 'jscs']);
grunt.registerTask('sa', ['sa-format', 'sa-lint']);
};

0 comments on commit 0dcf46f

Please sign in to comment.