Skip to content

Commit 1ae53e5

Browse files
cexbrayathaoqunjiang
authored andcommitted
fix: comment eslint disable in cypress config (#4910)
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.
1 parent bc2dc96 commit 1ae53e5

File tree

1 file changed

+2
-1
lines changed
  • packages/@vue/cli-plugin-e2e-cypress/generator/template/tests/e2e/plugins

1 file changed

+2
-1
lines changed

packages/@vue/cli-plugin-e2e-cypress/generator/template/tests/e2e/plugins/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1+
/* eslint-disable arrow-body-style */
12
// https://docs.cypress.io/guides/guides/plugins-guide.html
23

34
// if you need a custom webpack configuration you can uncomment the following import
45
// and then use the `file:preprocessor` event
56
// as explained in the cypress docs
67
// https://docs.cypress.io/api/plugins/preprocessors-api.html#Examples
78

8-
/* eslint-disable import/no-extraneous-dependencies, global-require, arrow-body-style */
9+
// /* eslint-disable import/no-extraneous-dependencies, global-require */
910
// const webpack = require('@cypress/webpack-preprocessor')
1011

1112
module.exports = (on, config) => {

0 commit comments

Comments
 (0)