mirror of
https://github.com/strapi/strapi.git
synced 2025-12-28 15:44:59 +00:00
Add ESLint on generated project
This commit is contained in:
parent
5c24f33c28
commit
7ca8dd2074
1
packages/strapi-generate-new/files/.eslintignore
Normal file
1
packages/strapi-generate-new/files/.eslintignore
Normal file
@ -0,0 +1 @@
|
||||
**/node_modules/**
|
||||
27
packages/strapi-generate-new/files/.eslintrc
Normal file
27
packages/strapi-generate-new/files/.eslintrc
Normal 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"]
|
||||
}
|
||||
}
|
||||
@ -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',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user