From 966f55f1fe31605ddf6da248e7fb64fd99f80c11 Mon Sep 17 00:00:00 2001 From: Saeed Ganji Date: Tue, 3 Sep 2019 23:10:11 +0430 Subject: [PATCH] fix(linter): add .dockerignore file & fixed failed build due to linter --- lib/workflow/questionnaire.js | 12 ++++++------ lib/workflow/select-features.js | 16 ++++++++-------- skeleton/common/.dockerignore__if_docker | 19 +++++++++++++++++++ 3 files changed, 33 insertions(+), 14 deletions(-) create mode 100644 skeleton/common/.dockerignore__if_docker diff --git a/lib/workflow/questionnaire.js b/lib/workflow/questionnaire.js index 01f852422..438d81255 100644 --- a/lib/workflow/questionnaire.js +++ b/lib/workflow/questionnaire.js @@ -6,18 +6,18 @@ exports.pickPlugin = { // add "plugin" to feature set for pluginFlow. // because this only provides one choice (default choice), it // is never prompted to end user. - choices: [{value: 'plugin'}] + choices: [{ value: 'plugin' }] }; exports.askDocker = { - message: 'Do you like to add a Dockerfile?' , - choices:[{ - value: 'docker' , message: 'Sure, yes' + message: 'Do you like to add a Dockerfile?', + choices: [{ + value: 'docker', message: 'Sure, yes' }, { - value: 'none' , message: 'No' + value: 'none', message: 'No' } -] + ] }; exports.askBundler = { diff --git a/lib/workflow/select-features.js b/lib/workflow/select-features.js index 28ca9f63e..b66bc54db 100644 --- a/lib/workflow/select-features.js +++ b/lib/workflow/select-features.js @@ -28,13 +28,13 @@ const { // default answer (note: default answer is not always same as recommended feature). // // _debug is used to pass in answers for prompts. -module.exports = async function(preselectedFeatures = [], opts = {}, _debug = []) { +module.exports = async function (preselectedFeatures = [], opts = {}, _debug = []) { const workflow = await selectWorkFlow({ // If user preselected some features, don't ask them to choose work flow. unattended: opts.unattended || !!preselectedFeatures.length, plugin: opts.plugin }, _debug); - const {flow, recommendedFeatures, unattended} = workflow; + const { flow, recommendedFeatures, unattended } = workflow; const flowUnattended = opts.unattended || unattended; // Allow user to overwrite recommended features. @@ -57,12 +57,12 @@ module.exports = async function(preselectedFeatures = [], opts = {}, _debug = [] // For example, unit testing default answer is none (no unit testing), but // we recommend user to have jest in all our default work flow choices. const PRESETS = { - 'default-esnext': {flow: 'app', recommendedFeatures: ['jest', 'vscode'], unattended: true}, - 'default-typescript': {flow: 'app', recommendedFeatures: ['jest', 'typescript', 'vscode'], unattended: true}, - 'custom-app': {flow: 'app'}, - 'default-plugin-esnext': {flow: 'plugin', recommendedFeatures: ['jest', 'vscode'], unattended: true}, - 'default-plugin-typescript': {flow: 'plugin', recommendedFeatures: ['jest', 'typescript', 'vscode'], unattended: true}, - 'custom-plugin': {flow: 'plugin'} + 'default-esnext': { flow: 'app', recommendedFeatures: ['jest', 'vscode'], unattended: true }, + 'default-typescript': { flow: 'app', recommendedFeatures: ['jest', 'typescript', 'vscode'], unattended: true }, + 'custom-app': { flow: 'app' }, + 'default-plugin-esnext': { flow: 'plugin', recommendedFeatures: ['jest', 'vscode'], unattended: true }, + 'default-plugin-typescript': { flow: 'plugin', recommendedFeatures: ['jest', 'typescript', 'vscode'], unattended: true }, + 'custom-plugin': { flow: 'plugin' } }; async function selectWorkFlow(opts, _debug) { diff --git a/skeleton/common/.dockerignore__if_docker b/skeleton/common/.dockerignore__if_docker new file mode 100644 index 000000000..951e803ed --- /dev/null +++ b/skeleton/common/.dockerignore__if_docker @@ -0,0 +1,19 @@ +Dockerfile +.dockerignore + +node_modules + +.git +.gitignore +.eslintrc.json +.editorconfig + +.DS_STORE +Thumbs.db + +.idea +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json