Add ESLint on generated project

This commit is contained in:
Aurélien Georget 2017-01-04 19:13:47 +01:00
parent 5c24f33c28
commit 7ca8dd2074
3 changed files with 37 additions and 1 deletions

View File

@ -0,0 +1 @@
**/node_modules/**

View File

@ -0,0 +1,27 @@
{
"parser": "babel-eslint",
"extends": "eslint:recommended",,
"env": {
"commonjs": true,
"es6": true,
"node": true,
"browser": false
},
"parserOptions": {
"ecmaFeatures": {
"experimentalObjectRestSpread": true,
"jsx": false
},
"sourceType": "module"
},
"globals": {
"strapi": true
},
"rules": {
"indent": ["error", 2, { "SwitchCase": 1 }],
"linebreak-style": ["error", "unix"],
"no-console": 0,
"quotes": ["error", "single"],
"semi": ["error", "always"]
}
}

View File

@ -21,6 +21,13 @@ module.exports = scope => {
'private': true,
'version': '0.1.0',
'description': 'A Strapi application.',
'devDependencies': {
"babel-eslint": "^7.1.1",
"eslint": "^3.12.2",
"eslint-config-airbnb": "^13.0.0",
"eslint-plugin-import": "^2.2.0",
"eslint-plugin-react": "^6.8.0"
},
'dependencies': {
'lodash': '4.x.x',
'strapi': getDependencyVersion(cliPkg, 'strapi'),
@ -29,7 +36,8 @@ module.exports = scope => {
'main': './server.js',
'scripts': {
'start': 'node --harmony-async-await server.js',
'strapi': 'node_modules/strapi/bin/strapi.js' // Allow to use `npm run strapi` CLI
'strapi': 'node_modules/strapi/bin/strapi.js', // Allow to use `npm run strapi` CLI,
'lint': 'node_modules/.bin/eslint api/**/*.js config/**/*.js plugins/**/*.js'
},
'author': {
'name': scope.author || 'A Strapi developer',