From 10c29c9d18a135ed39de2a3fb0524bd81a664f87 Mon Sep 17 00:00:00 2001 From: jamesgeorge007 Date: Sun, 22 Dec 2019 23:57:41 +0530 Subject: [PATCH] fix: lint --- lib/cli.js | 2 +- lib/commands/init.js | 3 ++- tools/locales/index.js | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/cli.js b/lib/cli.js index 6eab010..777a4a3 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -14,7 +14,7 @@ require('yargonaut') .helpStyle('green') .errorsStyle('red.bold') -const yargs = require('yargs') +require('yargs') .demandCommand(1, chalk.red('[ERROR] 0 arguments passed. Please specify a command')) .strict() .recommendCommands() diff --git a/lib/commands/init.js b/lib/commands/init.js index aadb1ee..6c53641 100644 --- a/lib/commands/init.js +++ b/lib/commands/init.js @@ -17,6 +17,7 @@ const replace = function (file, tpl, replace) { const PKG = util.pkg() +// eslint-disable-next-line module.exports = function (path = '', local, theme) { const msg = '\n' + @@ -28,7 +29,7 @@ module.exports = function (path = '', local, theme) { path = cwd(path || '.') const target = file => resolve(path, file) const readme = exists(cwd('README.md')) || pwd('template/README.md') - const main = pwd('template/index.html') + let main = pwd('template/index.html') if (local) { main = pwd('template/index.local.html') diff --git a/tools/locales/index.js b/tools/locales/index.js index d920f1f..dc262b5 100644 --- a/tools/locales/index.js +++ b/tools/locales/index.js @@ -6,6 +6,7 @@ const fse = require('fs-extra') class Locales { constructor() { + // eslint-disable-next-line this.y18n = Y18n({ directory: path.resolve(__dirname), updateFiles: false, @@ -20,7 +21,7 @@ class Locales { try { this._existsLocaleFile(locale) - } catch (e) { + } catch (e) { // eslint-disable-line return 'en' }