Skip to content

Commit

Permalink
Add basic eslint support. Rules to be tuned.
Browse files Browse the repository at this point in the history
  • Loading branch information
kompot committed Apr 14, 2015
1 parent 3e0638a commit 62cb6ec
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 9 deletions.
33 changes: 33 additions & 0 deletions .eslintrc
@@ -0,0 +1,33 @@
{
"parser": "babel-eslint",
"env": {
"browser": true,
"node": true
},
"plugins": [
"react"
],
"ecmaFeatures": {
"jsx": true
},
"rules": {
"no-multi-spaces": 0,
"quotes": "single",
"react/display-name": 1,
"react/jsx-boolean-value": 1,
"react/jsx-quotes": 1,
"react/jsx-no-undef": 1,
"react/jsx-sort-props": 1,
"react/jsx-uses-react": 1,
"react/jsx-uses-vars": 1,
"react/no-did-mount-set-state": 1,
"react/no-did-update-set-state": 1,
"react/no-multi-comp": 1,
"react/no-unknown-property": 1,
"react/prop-types": 1,
"react/react-in-jsx-scope": 1,
"react/self-closing-comp": 1,
"react/wrap-multilines": 1,
"strict": 0
}
}
3 changes: 3 additions & 0 deletions package.json
Expand Up @@ -34,7 +34,10 @@
"recursive-readdir": "^1.2.1"
},
"devDependencies": {
"babel-eslint": "^3.0.1",
"coveralls": "^2.11.2",
"eslint": "^0.19.0",
"eslint-plugin-react": "^2.1.0",
"isparta": "^3.0.3",
"mocha": "^2.2.4",
"rimraf": "^2.3.2"
Expand Down
4 changes: 2 additions & 2 deletions src/actions/create.js
Expand Up @@ -76,7 +76,7 @@ async function processTemplates(name) {
debug(`Will start processing templates in ${templatesDirName}`);
const templates = await readDir(templatesDirName);
for (let t of templates) {
await templateFile(name, t.substr(templatesDirName.length))
await templateFile(name, t.substr(templatesDirName.length));
}
}

Expand All @@ -85,4 +85,4 @@ export default async function({name}) {
await processTemplates(name);
spawnChildProcess('npm', ['install'], {cwd: name});
}
};
}
2 changes: 1 addition & 1 deletion src/actions/dev.js
Expand Up @@ -2,4 +2,4 @@ import spawnChildProcess from '../utils/spawnChildProcess';

export default function() {
spawnChildProcess('node', ['server.js']);
};
}
8 changes: 4 additions & 4 deletions src/rjanko.js
Expand Up @@ -12,16 +12,16 @@ const commands = _.object(commandStrings, commandStrings);
program
.command(`${commands.create} [name]`)
.description('scaffold new project')
.action(function (name, options) {
console.log('create project %s', name);
.action((name) => {
console.log('create project %s', name);
require(`./actions/${commands.create}.js`)({name});
});

program
.command(`${commands.dev}`)
.description('start development mode')
.action(function (options) {
console.log('Starting development mode');
.action(() => {
console.log('Starting development mode');
require(`./actions/${commands.dev}.js`)();
});

Expand Down
4 changes: 2 additions & 2 deletions src/templates/server.js
Expand Up @@ -2,14 +2,14 @@ var express = require('express');
var app = express();

app.get('/', function (req, res) {
res.send('Hello World, <%= rjanko.name %>!')
res.send('Hello World, <%= rjanko.name %>!');
});

var server = app.listen(3000, function () {

var host = server.address().address;
var port = server.address().port;

console.log('Example app listening at http://%s:%s', host, port)
console.log('Example app listening at http://%s:%s', host, port);

});

0 comments on commit 62cb6ec

Please sign in to comment.