Skip to content

Commit

Permalink
🙏 implemented eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanjudis committed May 27, 2015
1 parent 0101dd4 commit 367d8f8
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 16 deletions.
29 changes: 29 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"rules": {
"indent": [
2,
2
],
"quotes": [
2,
"single"
],
"linebreak-style": [
2,
"unix"
],
"semi": [
2,
"always"
],
"no-multi-spaces" : false,
"key-spacing": [2, {
"beforeColon": true,
"afterColon": true
}]
},
"env": {
"es6": true,
"node": true
}
}
19 changes: 9 additions & 10 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,28 @@
* Licensed under the MIT license.
*/

'use strict';

var fs = require( 'fs' );
var meow = require( 'meow' );
var builder = ( require( './' ) ).init();
var usage = fs.readFileSync( __dirname + '/usage.txt' ).toString();
var assign = require( 'lodash.assign' );
var path = require( 'path' );

var builder = ( require( './' ) ).init();
var usage = fs.readFileSync( path.join( __dirname, 'usage.txt' ) ).toString();

var cli = meow( {
help: usage
help : usage
} );

var appPath = path.join( process.cwd(), cli.input[ 0 ] );

builder.build( assign( {
appPath : appPath
appPath : appPath
}, cli.flags ), function( error ) {
if ( error ) {
console.error( error );

return process.exit( 1 );
throw error;
}

console.log( '- Created installer for ' + cli.flags.platform + ' -' );

process.exit();
} );
} );
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
* Licensed under the MIT license.
*/

'use strict';

var platforms = require( './lib/platforms' );
var fs = require( 'fs' );
var path = require( 'path' );
var assign = require( 'lodash.assign' );

/**
* Prototype for electron-builder
Expand Down Expand Up @@ -68,6 +68,6 @@ var Builder = {
*/
module.exports = {
init : function() {
return Object.create( Builder );
return Object.create( Builder );
}
};
4 changes: 3 additions & 1 deletion lib/helper/getPlatformOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* Licensed under the MIT license.
*/

'use strict';

var camelCase = require( 'lodash.camelcase');


Expand All @@ -28,4 +30,4 @@ module.exports = function( options, platform ) {
} );

return newOptions;
};
};
4 changes: 3 additions & 1 deletion lib/helper/writeConfigFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* Licensed under the MIT license.
*/

'use strict';

var fs = require( 'fs' );
var template = require( 'lodash.template' );
var os = require( 'os' );
Expand Down Expand Up @@ -52,4 +54,4 @@ module.exports = function( name, options ) {
);

return outputPath;
};
};
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"description": "Create electron apps installers the easy way",
"main": "index.js",
"scripts": {
"test": "tape ./**/*_spec.js | tnyan",
"lint": "eslint ./lib/**/*.js cli.js index.js",
"test": "npm run lint && tape ./**/*_spec.js | tnyan",
"test:debug": "tape ./**/*_spec.js | tap-spec"
},
"repository": {
Expand Down Expand Up @@ -32,6 +33,7 @@
"meow": "^3.1.0"
},
"devDependencies": {
"eslint": "^0.21.2",
"proxyquire": "^1.5.0",
"tap-nyan": "0.0.2",
"tap-spec": "^3.0.0",
Expand Down

0 comments on commit 367d8f8

Please sign in to comment.