From 9a0fb3df2f393851b692ba4832a5554d410d4b33 Mon Sep 17 00:00:00 2001 From: Eric Wei Date: Tue, 9 Jan 2024 11:04:52 -0800 Subject: [PATCH] separate linting rules for cypress (#1344) Signed-off-by: Eric --- .cypress/.eslintrc.js | 16 ++++++++++++++++ .eslintrc.js | 14 +------------- 2 files changed, 17 insertions(+), 13 deletions(-) create mode 100644 .cypress/.eslintrc.js diff --git a/.cypress/.eslintrc.js b/.cypress/.eslintrc.js new file mode 100644 index 0000000000..d38ee9d66c --- /dev/null +++ b/.cypress/.eslintrc.js @@ -0,0 +1,16 @@ +module.exports = { + root: true, + extends: ['plugin:cypress/recommended'], + env: { + 'cypress/globals': true, + }, + plugins: ['cypress'], + rules: { + // Add cypress specific rules here + 'cypress/no-assigning-return-values': 'error', + 'cypress/no-unnecessary-waiting': 'error', + 'cypress/assertion-before-screenshot': 'warn', + 'cypress/no-force': 'warn', + 'cypress/no-async-tests': 'error', + }, +}; diff --git a/.eslintrc.js b/.eslintrc.js index 527f17bba7..12f093d2ed 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -14,16 +14,10 @@ module.exports = { '@elastic/eslint-config-kibana', 'plugin:@elastic/eui/recommended', 'plugin:react-hooks/recommended', - "plugin:cypress/recommended", 'plugin:jest/recommended', 'plugin:prettier/recommended', ], - env: { - 'cypress/globals': true, - }, - plugins: [ - 'cypress', - ], + rules: { '@typescript-eslint/no-unused-vars': [ 'error', @@ -45,12 +39,6 @@ module.exports = { ], }, ], - // Add cypress specific rules here - 'cypress/no-assigning-return-values': 'error', - 'cypress/no-unnecessary-waiting': 'error', - 'cypress/assertion-before-screenshot': 'warn', - 'cypress/no-force': 'warn', - 'cypress/no-async-tests': 'error', }, overrides: [ {