mirror of
https://github.com/strapi/strapi.git
synced 2025-09-02 13:23:12 +00:00
Lint strapi-generate-new
This commit is contained in:
parent
0bfbdf8e72
commit
50598616f4
@ -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);
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user