Permalink
Browse files

Removed readjs and switched to jshint

  • Loading branch information...
1 parent 5782840 commit ec6a21fa0036c4580cbb7b04f1dc55bcc8e04adc @raoulmillais raoulmillais committed Aug 21, 2011
Showing with 132 additions and 35 deletions.
  1. +111 −0 .jshintrc
  2. +1 −1 Makefile
  3. +1 −1 examples/customconfig.js
  4. +12 −12 examples/oauth.js
  5. +4 −4 examples/simpleclient.js
  6. +2 −2 lib/oauth-helper.js
  7. +1 −1 package.json
  8. +0 −14 readyjs.conf
View
111 .jshintrc
@@ -0,0 +1,111 @@
+{
+ // *Settings*
+ // Stop on first error
+ "passfail" : false,
+ // Maximum error before stopping.
+ "maxerr" : 100,
+
+
+ // *Predefined globals whom JSHint will ignore.*
+ // Standard browser globals e.g. `window`, `document`.
+ "browser" : false,
+ "node" : true,
+ "rhino" : false,
+ "couch" : false,
+ // Windows Scripting Host.
+ "wsh" : false,
+ "jquery" : false,
+ "prototypejs" : false,
+ "mootools" : false,
+ "dojo" : false,
+
+ "predef" : [ // Custom globals.
+ //"exampleVar",
+ //"anotherCoolGlobal",
+ //"iLoveDouglas"
+ ],
+
+
+ // *Development.*
+ // Allow debugger statements e.g. browser breakpoints.
+ "debug" : false,
+ // Allow developments statements e.g. `console.log();`.
+ "devel" : true,
+
+
+ // *EcmaScript 5*
+ // Allow EcmaScript 5 syntax.
+ "es5" : true,
+ // Require `use strict` pragma in every file.
+ "strict" : false,
+ // Allow global "use strict" (also enables 'strict').
+ "globalstrict" : false,
+
+
+ // *The Good Parts*
+ // Tolerate Automatic Semicolon Insertion (no semicolons).
+ "asi" : false,
+ // Tolerate unsafe line breaks e.g. `return [\n] x` without semicolons.
+ "laxbreak" : false,
+ // Prohibit bitwise operators (&, |, ^, etc.).
+ "bitwise" : true,
+ // Tolerate assignments inside if, for & while. Usually conditions & loops
+ // are for comparison, not assignments.
+ "boss" : false,
+ // Require {} for every new block or scope.
+ "curly" : true,
+ // Require triple equals i.e. `===`.
+ "eqeqeq" : true,
+ // Tolerate use of `== null`.
+ "eqnull" : false,
+ // Tolerate use of `eval`.
+ "evil" : false,
+ // Tolerate `ExpressionStatement` as Programs.
+ "expr" : false,
+ // Tolerate `for in` loops without `hasOwnPrototype`.
+ "forin" : false,
+ // Require immediate invocations to be wrapped in parens e.g.
+ // `( function(){}() );`
+ "immed" : true,
+ // Prohipit variable use before definition.
+ "latedef" : true,
+ // Allow functions to be defined within loops.
+ "loopfunc" : false,
+ // Prohibit use of `arguments.caller` and `arguments.callee`.
+ "noarg" : true,
+ // Prohibit `.` and `[^...]` in regular expressions.
+ "regexp" : false,
+ // Tolerate unescaped last dash i.e. `[-...]`.
+ "regexdash" : false,
+ // Tolerate script-targeted URLs.
+ "scripturl" : true,
+ // Allows re-define variables later in code e.g. `var x=1; x=2;`.
+ "shadow" : false,
+ // Tolerate `new function () { ... };` and `new Object;`.
+ "supernew" : false,
+ // Require all non-global variables be declared before they are used.
+ "undef" : true,
+
+
+ // *Personal styling prefrences*
+ // Require capitalization of all constructor functions e.g. `new F()`.
+ "newcap" : true,
+ // Prohipit use of empty blocks.
+ "noempty" : true,
+ // Prohibit use of constructors for side-effects.
+ "nonew" : true,
+ // Prohibit use of initial or trailing underbars in names.
+ "nomen" : true,
+ // Allow only one `var` statement per function.
+ "onevar" : true,
+ // Prohibit use of `++` & `--`.
+ "plusplus" : false,
+ // Tolerate all forms of subscript notation besides dot notation e.g.
+ // `dict['key']` instead of `dict.key`.
+ "sub" : false,
+ // Prohibit trailing whitespaces.
+ "trailing" : true,
+ // Check against strict whitespace and indentation rules.
+ "white" : true
+}
+
View
@@ -4,7 +4,7 @@ test: check
jessie spec/
check: docs
- readyjs readyjs.conf.js
+ jshint lib/*.js examples/*.js
docs:
docco {lib,examples}/*.js
View
@@ -11,6 +11,6 @@ config = {
api = require('../index').configure(config);
artists = new api.Artists();
-artists.getReleases({ artistid: 1 }, function(err, data) {
+artists.getReleases({ artistid: 1 }, function (err, data) {
console.dir(data);
});
View
@@ -1,6 +1,6 @@
// Module dependencies
var
- Step = require('step'),
+ step = require('step'),
readline = require('readline'),
oauthHelper = require('../lib/oauth-helper'),
// Create a readline interface for prompting the user
@@ -9,14 +9,14 @@ var
consumerkey = 'YOUR_KEY_HERE',
consumersecret = 'YOUR_SECRET_HERE';
-Step(
+step(
function getRequestToken() {
// Get a request token using the oauth helper
oauthHelper.getRequestToken({
oauthkey: consumerkey,
oauthsecret: consumersecret,
callbackUrl: ''
- }, this);
+ }, this);
},
function authorise(err, requestToken, requestSecret, authoriseUrl) {
// Throw the error if there is one
@@ -25,17 +25,17 @@ Step(
}
// Show the authorise url
- console.log('Authorise here: %s', authoriseUrl);
+ console.info('Authorise here: %s', authoriseUrl);
// Remember the token and secret so we can access it after the
// user presses enter
- this.requestToken = requestToken;
- this.requestSecret = requestSecret;
+ this.requestToken = requestToken;
+ this.requestSecret = requestSecret;
// Tell the user to visit the authorise url
- consoleInterface.question('Visit the link to authorise this application to' +
- ' access your 7digital account. Press enter to' +
- ' continue', this);
+ consoleInterface.question('Visit the link to authorise this' +
+ ' application to access your 7digital' +
+ 'account. Press enter to continue', this);
},
function continueAfterAuthorisation() {
// Get an access token using the oauth helper using the authorised
@@ -50,7 +50,7 @@ Step(
function logTheAccessToken(err, accesstoken, accesssecret) {
// Log any error
if (err) {
- console.log(err);
+ console.error(err);
// Close the readline interface properly so that the process
// ends cleanly otherwise it will hang.
consoleInterface.close();
@@ -59,8 +59,8 @@ Step(
}
// Write the token and secret out to the commandline
- console.log('Access Token: %s', accesstoken);
- console.log('Access Secret: %s', accesssecret);
+ console.info('Access Token: %s', accesstoken);
+ console.info('Access Secret: %s', accesssecret);
// Close the readline interface properly so that the process
// ends cleanly otherwise it will hang.
View
@@ -1,6 +1,6 @@
-var api = require('../index'),
+var api = require('../index'),
artists = new api.Artists();
-
-artists.getReleases({ artistid: 1 }, function(err, data) {
+
+artists.getReleases({ artistid: 1 }, function (err, data) {
console.dir(data);
-});
+});
View
@@ -2,8 +2,8 @@ var OAuth = require('oauth').OAuth,
step = require('step'),
readline = require('readline'),
// Regular expressions for parsing the XML OAuth response
- tokenPattern = /\<oauth_token\>([^\<]*)\<\/oauth_token\>/,
- secretPattern = /\<oauth_token_secret\>([^\<]*)\<\/oauth_token_secret\>/;
+ tokenPattern = /<oauth_token\>([^<]*)<\/oauth_token\>/,
+ secretPattern = /<oauth_token_secret\>([^<]*)<\/oauth_token_secret\>/;
// Creates an OAuth v1 wrapper configured with the supplied key and
// secret and the necessary options for authenticating with the
View
@@ -37,7 +37,7 @@
"devDependencies": {
"docco": "0.3.0",
"jessie": ">=0.3.7",
- "ready.js": "1.3.1"
+ "jshint": "0.3.0"
},
"contributors": [
"Raoul Millais <raoul.millais@7digital.com> (http://www.raoulmillais.com)",
View
@@ -1,14 +0,0 @@
-{
- src : "./lib/", // the source dir of js files
- dest : "./build", // the destination of your minified files
- compiledExtension : "min", // extension of the minified file
- runJslint : true, // if should run jsLint
- runGCompiler : false, // if should run GoogleCompiler
- keepCompiled : false, // if should keep the minified files
- aggregateTo : "all.js", // If a string is specified, all the .js will be aggregated to this file in the config.dest
- order : [], // The order of aggregation (example : we want jquery before jquery.ui) Must not specified every file.
- exclude : [], // Files that are not compiled but still aggregated
- recursive : true, // Should look for javascript recursively
- debug : false, // If in debug mode
-}
-

0 comments on commit ec6a21f

Please sign in to comment.