Lint strapi-generate-new

This commit is contained in:
soupette 2018-05-04 17:50:39 +02:00
parent 0bfbdf8e72
commit 50598616f4
3 changed files with 160 additions and 157 deletions

View File

@ -24,9 +24,11 @@ const logger = require('strapi-utils').logger;
* @param {Function} cb
*/
/* eslint-disable no-console */
/* eslint-disable prefer-template */
module.exports = (scope, cb) => {
const packageJSON = require(path.resolve(scope.rootPath, 'package.json'));
const strapiRootPath = path.resolve(scope.strapiRoot, '..');
// const strapiRootPath = path.resolve(scope.strapiRoot, '..');
process.chdir(scope.rootPath);

View File

@ -7,7 +7,7 @@
// Node.js core.
const path = require('path');
const exec = require('child_process').exec;
const execSync = require('child_process').execSync;
// Public node modules.
const _ = require('lodash');
@ -26,6 +26,7 @@ const logger = require('strapi-utils').logger;
* @param {Function} cb
*/
/* eslint-disable no-useless-escape */
module.exports = (scope, cb) => {
// App info.
const hasDatabaseConfig = !!scope.database;
@ -161,7 +162,7 @@ module.exports = (scope, cb) => {
prefix: '',
name: 'port',
message: 'Port:',
default: (answers) => {
default: (answers) => { // eslint-disable-line no-unused-vars
if (_.get(scope.database, 'port')) {
return scope.database.port;
}
@ -213,7 +214,7 @@ module.exports = (scope, cb) => {
])
.then(answers => {
if (hasDatabaseConfig) {
answers = _.omit(scope.database.settings, ['client'])
answers = _.omit(scope.database.settings, ['client']);
}
scope.database.settings.host = answers.host;

View File

@ -27,7 +27,7 @@ const watcher = (label, pckgName, type = 'front') => {
const packagesPath = path.resolve(process.env.PWD, 'packages');
shell.ls('* -d', packagesPath)
// TODO temporary just for eslint
.filter(package => package === 'strapi-generate-model')
.filter(package => package === 'strapi-generate-new')
// .filter(package => package !== 'README.md')
.forEach(package => {
watcher(`Testing ${package}`, package);