diff --git a/examples/social-network/.eslintrc.json b/examples/social-network/.eslintrc.json new file mode 100644 index 00000000..4d5b07b5 --- /dev/null +++ b/examples/social-network/.eslintrc.json @@ -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 + } +} diff --git a/examples/social-network/package.json b/examples/social-network/package.json index d94a6cbf..48744b43 100644 --- a/examples/social-network/package.json +++ b/examples/social-network/package.json @@ -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": { diff --git a/examples/todo/.eslintrc.json b/examples/todo/.eslintrc.json new file mode 100644 index 00000000..4d5b07b5 --- /dev/null +++ b/examples/todo/.eslintrc.json @@ -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 + } +} diff --git a/examples/todo/package.json b/examples/todo/package.json index da84aa23..129fb28c 100644 --- a/examples/todo/package.json +++ b/examples/todo/package.json @@ -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": { diff --git a/package.json b/package.json index a9c1d734..6396d2be 100644 --- a/package.json +++ b/package.json @@ -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": [ diff --git a/src/packages/cli/commands/create.js b/src/packages/cli/commands/create.js index ccdb147c..5e8bdb2e 100644 --- a/src/packages/cli/commands/create.js +++ b/src/packages/cli/commands/create.js @@ -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'; @@ -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' ), @@ -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 `; diff --git a/src/packages/cli/templates/babel-rc.js b/src/packages/cli/templates/babelrc.js similarity index 100% rename from src/packages/cli/templates/babel-rc.js rename to src/packages/cli/templates/babelrc.js diff --git a/src/packages/cli/templates/eslintrc.js b/src/packages/cli/templates/eslintrc.js new file mode 100644 index 00000000..0c3540b3 --- /dev/null +++ b/src/packages/cli/templates/eslintrc.js @@ -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 + } + } +`;