From 313533d84e25fd6b4fe1eaa1000a4aac7536835d Mon Sep 17 00:00:00 2001 From: Evan You Date: Sat, 3 Feb 2018 14:18:13 -0500 Subject: [PATCH] fix: fix eslint errors when using airbnb + cypress --- .../@vue/cli-plugin-e2e-cypress/generator/index.js | 3 ++- .../generator/template/test/e2e/_eslintrc | 13 +++++++++++++ .../generator/template/test/e2e/plugins/index.js | 13 +++++++------ 3 files changed, 22 insertions(+), 7 deletions(-) create mode 100644 packages/@vue/cli-plugin-e2e-cypress/generator/template/test/e2e/_eslintrc diff --git a/packages/@vue/cli-plugin-e2e-cypress/generator/index.js b/packages/@vue/cli-plugin-e2e-cypress/generator/index.js index c578208cdf..c5c92b5eb0 100644 --- a/packages/@vue/cli-plugin-e2e-cypress/generator/index.js +++ b/packages/@vue/cli-plugin-e2e-cypress/generator/index.js @@ -1,6 +1,7 @@ module.exports = api => { api.render('./template', { - hasTS: api.hasPlugin('typescript') + hasTS: api.hasPlugin('typescript'), + hasESLint: api.hasPlugin('eslint') }) api.extendPackage({ diff --git a/packages/@vue/cli-plugin-e2e-cypress/generator/template/test/e2e/_eslintrc b/packages/@vue/cli-plugin-e2e-cypress/generator/template/test/e2e/_eslintrc new file mode 100644 index 0000000000..93f7effbc5 --- /dev/null +++ b/packages/@vue/cli-plugin-e2e-cypress/generator/template/test/e2e/_eslintrc @@ -0,0 +1,13 @@ +<%_ if (hasESLint) { _%> +{ + "env": { + "mocha": true + }, + "globals": { + "cy": false, + "Cypress": false, + "expect": false, + "assert": false + } +} +<%_ } _%> diff --git a/packages/@vue/cli-plugin-e2e-cypress/generator/template/test/e2e/plugins/index.js b/packages/@vue/cli-plugin-e2e-cypress/generator/template/test/e2e/plugins/index.js index 60432057ef..49398583d3 100644 --- a/packages/@vue/cli-plugin-e2e-cypress/generator/template/test/e2e/plugins/index.js +++ b/packages/@vue/cli-plugin-e2e-cypress/generator/template/test/e2e/plugins/index.js @@ -1,10 +1,11 @@ // https://docs.cypress.io/guides/guides/plugins-guide.html module.exports = (on, config) => { - config.fixturesFolder = 'test/e2e/fixtures' - config.integrationFolder = 'test/e2e/specs' - config.screenshotsFolder = 'test/e2e/screenshots' - config.videosFolder = 'test/e2e/videos' - config.supportFile = 'test/e2e/support/index.js' - return config + return Object.assign({}, config, { + fixturesFolder: 'test/e2e/fixtures', + integrationFolder: 'test/e2e/specs', + screenshotsFolder: 'test/e2e/screenshots', + videosFolder: 'test/e2e/videos', + supportFile: 'test/e2e/support/index.js' + }) }