Skip to content

Commit 3ba2fbc

Browse files
committed
Fix linter
1 parent 3e0d022 commit 3ba2fbc

File tree

6 files changed

+31
-30
lines changed

6 files changed

+31
-30
lines changed

packages/cubejs-cli/DeployDir.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class DeployDir {
88
}
99

1010
filter(file) {
11-
let baseName = path.basename(file);
11+
const baseName = path.basename(file);
1212
return baseName !== 'node_modules' && baseName !== '.git' && baseName !== '.env';
1313
}
1414

@@ -21,6 +21,7 @@ class DeployDir {
2121
for (const file of files) {
2222
const filePath = path.resolve(directory, file);
2323
if (!this.filter(filePath)) {
24+
// eslint-disable-next-line no-continue
2425
continue;
2526
}
2627
const stat = await fs.stat(filePath);
@@ -41,12 +42,12 @@ class DeployDir {
4142
return fs.createReadStream(file)
4243
.pipe(hash.setEncoding('hex'))
4344
.on('finish', () => {
44-
resolve(hash.digest('hex'))
45+
resolve(hash.digest('hex'));
4546
})
4647
.on('error', (err) => {
4748
reject(err);
4849
});
49-
})
50+
});
5051
}
5152
}
5253

packages/cubejs-cli/cubejsCli.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ const createApp = async (projectName, options) => {
5454
event('Create App', createAppOptions);
5555
if (!options.dbType) {
5656
await displayError([
57-
"You must pass an application name and a database type (-d).",
58-
"",
59-
"Example: ",
60-
" $ cubejs create hello-world -d postgres"
57+
'You must pass an application name and a database type (-d).',
58+
'',
59+
'Example: ',
60+
' $ cubejs create hello-world -d postgres'
6161
], createAppOptions);
6262
}
6363
if (await fs.pathExists(projectName)) {
@@ -83,7 +83,7 @@ const createApp = async (projectName, options) => {
8383
version: '0.0.1',
8484
private: true,
8585
scripts: {
86-
dev: template === 'express' ? 'node index.js' : "./node_modules/.bin/cubejs-dev-server"
86+
dev: template === 'express' ? 'node index.js' : './node_modules/.bin/cubejs-dev-server'
8787
}
8888
});
8989

@@ -153,10 +153,10 @@ const createApp = async (projectName, options) => {
153153
logStage(`${chalk.green(projectName)} app has been created 🎉`);
154154

155155
console.log();
156-
console.log(`📊 Next step: run dev server`);
156+
console.log('📊 Next step: run dev server');
157157
console.log();
158158
console.log(` $ cd ${projectName}`);
159-
console.log(` $ npm run dev`);
159+
console.log(' $ npm run dev');
160160
console.log();
161161
};
162162

@@ -165,15 +165,15 @@ const generateSchema = async (options) => {
165165
event('Generate Schema', generateSchemaOptions);
166166
if (!options.tables) {
167167
await displayError([
168-
"You must pass table names to generate schema from (-t).",
169-
"",
170-
"Example: ",
171-
" $ cubejs generate -t orders,customers"
168+
'You must pass table names to generate schema from (-t).',
169+
'',
170+
'Example: ',
171+
' $ cubejs generate -t orders,customers'
172172
], generateSchemaOptions);
173173
}
174174
if (!(await fs.pathExists(path.join(process.cwd(), 'node_modules', '@cubejs-backend/server')))) {
175175
await displayError(
176-
"@cubejs-backend/server dependency not found. Please run generate command from project directory.",
176+
'@cubejs-backend/server dependency not found. Please run generate command from project directory.',
177177
generateSchemaOptions
178178
);
179179
}

packages/cubejs-cli/deploy.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ const rp = require('request-promise');
22
const jwt = require('jsonwebtoken');
33
const fs = require('fs-extra');
44
const path = require('path');
5-
const DeployDir = require('./DeployDir');
65
const cliProgress = require('cli-progress');
6+
const DeployDir = require('./DeployDir');
77
const { logStage } = require('./utils');
88

99
const cloudReq = (options) => {
@@ -44,7 +44,7 @@ exports.deploy = async ({ directory, auth }) => {
4444
auth
4545
});
4646

47-
await logStage(`Deploying ${deploymentName}...`, `Cube Cloud CLI Deploy`);
47+
await logStage(`Deploying ${deploymentName}...`, 'Cube Cloud CLI Deploy');
4848

4949
const files = Object.keys(fileHashes);
5050
bar.start(files.length, 0, {
@@ -71,7 +71,7 @@ exports.deploy = async ({ directory, auth }) => {
7171
}
7272
},
7373
auth
74-
})
74+
});
7575
}
7676
}
7777
bar.update(files.length, { file: 'Post processing...' });
@@ -87,5 +87,5 @@ exports.deploy = async ({ directory, auth }) => {
8787
} finally {
8888
bar.stop();
8989
}
90-
await logStage(`Done 🎉`, `Cube Cloud CLI Deploy Success`);
91-
};
90+
await logStage('Done 🎉', 'Cube Cloud CLI Deploy Success');
91+
};

packages/cubejs-cli/templates.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
global test expect
33
*/
4-
const { express } = require("./templates");
4+
const { express } = require('./templates');
55

66
const dotEnv = express.files['.env'];
77

packages/cubejs-cli/token.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,20 @@ const token = async (options = {}) => {
2323
if (!secret) throw new Error('No app secret found').message;
2424

2525
const extraOptions = {};
26-
if (expiry !== "0") extraOptions.expiresIn = expiry;
26+
if (expiry !== '0') extraOptions.expiresIn = expiry;
2727

2828
const payload = parsePayload(options.payload);
2929

30-
console.log(`Generating Cube.js JWT token`);
31-
console.log(``);
30+
console.log('Generating Cube.js JWT token');
31+
console.log('');
3232
console.log(`${chalk.yellow('-----------------------------------------------------------------------------------------')}`);
33-
console.log(` ${chalk.yellow(`Use these manually generated tokens in production with caution.`)}`);
33+
console.log(` ${chalk.yellow('Use these manually generated tokens in production with caution.')}`);
3434
console.log(` ${chalk.yellow(`Please refer to ${chalk.cyan('https://cube.dev/docs/security')} for production security best practices.`)}`);
3535
console.log(`${chalk.yellow('-----------------------------------------------------------------------------------------')}`);
36-
console.log(``);
36+
console.log('');
3737
console.log(`Expires in: ${chalk.green(expiry)}`);
3838
console.log(`Payload: ${chalk.green(JSON.stringify(payload))}`);
39-
console.log(``);
39+
console.log('');
4040

4141
const signedToken = jwt.sign(payload, secret, extraOptions);
4242
console.log(`Token: ${chalk.green(signedToken)}`);

packages/cubejs-cli/utils.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ const displayError = async (text, options = {}) => {
3333
console.error(chalk.yellow('Need some help? -------------------------------------'));
3434
await event('Error', { error: Array.isArray(text) ? text.join('\n') : text.toString(), ...options });
3535
console.error('');
36-
console.error(`${chalk.yellow(` Ask this question in Cube.js Slack:`)} https://slack.cube.dev`);
37-
console.error(`${chalk.yellow(` Post an issue:`)} https://github.com/cube-js/cube.js/issues`);
36+
console.error(`${chalk.yellow(' Ask this question in Cube.js Slack:')} https://slack.cube.dev`);
37+
console.error(`${chalk.yellow(' Post an issue:')} https://github.com/cube-js/cube.js/issues`);
3838
console.error('');
3939
process.exit(1);
4040
};
@@ -58,7 +58,7 @@ exports.requireFromPackage = async (module) => {
5858
const logStage = async (stage, eventName, props) => {
5959
console.log(`- ${stage}`);
6060
if (eventName) {
61-
await event(eventName, props)
61+
await event(eventName, props);
6262
}
6363
};
6464

0 commit comments

Comments
 (0)