From fe376b200fa6a6f81a1e06a1b18a27e3bc0b5ca0 Mon Sep 17 00:00:00 2001 From: cexbrayat Date: Sun, 1 Dec 2019 15:34:44 +0100 Subject: [PATCH] fix: comment eslint disable in cypress config The current cypress config has a global eslint-disable: typescript ``` /* eslint-disable import/no-extraneous-dependencies, global-require, arrow-body-style */ // const webpack = require('@cypress/webpack-preprocessor') ``` But this assumes that `eslint-import-plugin` is present, whereas this is only true when the selected preset is the Airbnb one. In other cases, this fails `yarn lint` right away with: ``` error: Definition for rule 'import/no-extraneous-dependencies' was not found (import/no-extraneous-dependencies) at tests/e2e/plugins/index.js``` Even if using the Airbnb preset, the comment does not have any effect, as, by default, the `require` call is commented. This commit now splits the rules disabling in two: - one commented for the people using Airbnb and who will uncomment the require call below, as it is only useful for them. - one activated that disables `arrow-body-style` as it will fail the linting for people using Airbnb preset with the current config. --- .../generator/template/tests/e2e/plugins/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/@vue/cli-plugin-e2e-cypress/generator/template/tests/e2e/plugins/index.js b/packages/@vue/cli-plugin-e2e-cypress/generator/template/tests/e2e/plugins/index.js index e8412765fe..6f7e63b9ef 100644 --- a/packages/@vue/cli-plugin-e2e-cypress/generator/template/tests/e2e/plugins/index.js +++ b/packages/@vue/cli-plugin-e2e-cypress/generator/template/tests/e2e/plugins/index.js @@ -1,3 +1,4 @@ +/* eslint-disable arrow-body-style */ // https://docs.cypress.io/guides/guides/plugins-guide.html // if you need a custom webpack configuration you can uncomment the following import @@ -5,7 +6,7 @@ // as explained in the cypress docs // https://docs.cypress.io/api/plugins/preprocessors-api.html#Examples -/* eslint-disable import/no-extraneous-dependencies, global-require, arrow-body-style */ +// /* eslint-disable import/no-extraneous-dependencies, global-require */ // const webpack = require('@cypress/webpack-preprocessor') module.exports = (on, config) => {