Skip to content

Commit

Permalink
chore: optimize ESLint config for cypress files
Browse files Browse the repository at this point in the history
  • Loading branch information
natterstefan committed Apr 9, 2021
1 parent 8d7488c commit f37e1eb
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
10 changes: 9 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,16 @@ module.exports = {
'no-console': 0,
},
},
/**
* exclude jest plugin in cypress files, because test are written
* differently and `expect` is typed different.
*/
{
files: ['./cypress/**/*.ts', './src/**/__cypress__/*.tsx'],
files: [
'./cypress/**/*.ts',
'./cypress/**/*.tsx',
'./src/**/__cypress__/*.tsx',
],
extends: ['plugin:cypress/recommended'],
rules: {
'jest/expect-expect': 0,
Expand Down
3 changes: 3 additions & 0 deletions cypress/integration/app/Navigation.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/**
* TODO: document when and how to use reference types
*/
/// <reference types="../../support" />

/**
Expand Down
3 changes: 3 additions & 0 deletions cypress/support/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// load type definitions that come with Cypress module
/// <reference types="cypress" />

/**
* TODO: remove and use solution proposed in commands.ts instead
*/
declare namespace Cypress {
interface Chainable<Subject> {
/**
Expand Down

0 comments on commit f37e1eb

Please sign in to comment.