Skip to content

Commit

Permalink
feat: generate basic .eslintrc.json with lux new cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
zacharygolba committed Jun 13, 2016
1 parent 952fa65 commit 723c403
Show file tree
Hide file tree
Showing 8 changed files with 99 additions and 5 deletions.
26 changes: 26 additions & 0 deletions examples/social-network/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"env": {
"node": true
},
"extends": "eslint:recommended",
"globals": {
"after": true,
"before": true,
"describe": true,
"it": true,
"Map": true,
"Promise": true,
"Proxy": true,
"Set": true,
"Symbol": true,
"WeakMap": true
},
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
},
"rules": {
"no-unused-vars": 1
}
}
2 changes: 1 addition & 1 deletion examples/social-network/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"babel-core": "6.9.1",
"babel-preset-lux": "1.0.0",
"knex": "0.11.5",
"lux-framework": "0.0.1-beta.11",
"lux-framework": "0.0.1-beta.12",
"sqlite3": "3.1.4"
},
"devDependencies": {
Expand Down
26 changes: 26 additions & 0 deletions examples/todo/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"env": {
"node": true
},
"extends": "eslint:recommended",
"globals": {
"after": true,
"before": true,
"describe": true,
"it": true,
"Map": true,
"Promise": true,
"Proxy": true,
"Set": true,
"Symbol": true,
"WeakMap": true
},
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
},
"rules": {
"no-unused-vars": 1
}
}
2 changes: 1 addition & 1 deletion examples/todo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"babel-core": "6.9.1",
"babel-preset-lux": "1.0.0",
"knex": "0.11.5",
"lux-framework": "0.0.1-beta.11",
"lux-framework": "0.0.1-beta.12",
"sqlite3": "3.1.4"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lux-framework",
"version": "0.0.1-beta.11",
"version": "0.0.1-beta.12",
"description": "A MVC style Node.js framework for building lightning fast JSON APIs",
"repository": "https://github.com/postlight/lux",
"keywords": [
Expand Down
12 changes: 10 additions & 2 deletions src/packages/cli/commands/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ import routesTemplate from '../templates/routes';
import dbTemplate from '../templates/database';
import seedTemplate from '../templates/seed';
import pkgJSONTemplate from '../templates/package-json';
import babelRcTemplate from '../templates/babel-rc';
import babelrcTemplate from '../templates/babelrc';
import eslintrcTemplate from '../templates/eslintrc';
import readmeTemplate from '../templates/readme';
import licenseTemplate from '../templates/license';
import gitignoreTemplate from '../templates/gitignore';
Expand Down Expand Up @@ -106,7 +107,13 @@ export default async function create(name, database) {

fs.writeFileAsync(
`${project}/.babelrc`,
babelRcTemplate(),
babelrcTemplate(),
'utf8'
),

fs.writeFileAsync(
`${project}/.eslintrc.json`,
eslintrcTemplate(),
'utf8'
),

Expand All @@ -131,6 +138,7 @@ export default async function create(name, database) {
${green('create')} LICENSE
${green('create')} package.json
${green('create')} .babelrc
${green('create')} .eslintrc.json
${green('create')} .gitignore
`;

Expand Down
File renamed without changes.
34 changes: 34 additions & 0 deletions src/packages/cli/templates/eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// @flow
import template from '../../template';

/**
* @private
*/
export default (): string => template`
{
"env": {
"node": true
},
"extends": "eslint:recommended",
"globals": {
"after": true,
"before": true,
"describe": true,
"it": true,
"Map": true,
"Promise": true,
"Proxy": true,
"Set": true,
"Symbol": true,
"WeakMap": true
},
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
},
"rules": {
"no-unused-vars": 1
}
}
`;

0 comments on commit 723c403

Please sign in to comment.