Skip to content

Commit

Permalink
ci: fix jest/cypress clash that broke eslint locally
Browse files Browse the repository at this point in the history
  • Loading branch information
acao committed Nov 19, 2019
1 parent 4de9408 commit ff26e16
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 12 deletions.
26 changes: 19 additions & 7 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@
* This source code is licensed under the license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
*/

const defaultPlugins = ['babel', 'import', 'flowtype', 'prefer-object-spread'];

const defaultPresets = ['prettier', 'plugin:import/typescript', 'plugin:react/recommended'];

module.exports = {
root: true,
parser: 'babel-eslint',
Expand All @@ -21,9 +24,9 @@ module.exports = {
},
},
settings: {
'react': {
'version': 'detect'
}
react: {
version: 'detect',
},
},
// https://github.com/sindresorhus/globals/blob/master/globals.json
env: {
Expand All @@ -33,10 +36,9 @@ module.exports = {
jest: true,
mocha: true,
browser: true,
'cypress/globals': true
},

extends: ['prettier', 'plugin:import/typescript', 'plugin:react/recommended'],
extends: defaultPresets,

globals: {
atom: false,
Expand Down Expand Up @@ -292,9 +294,19 @@ module.exports = {
'prefer-object-spread/prefer-object-spread': 1,
},

plugins: ['babel', 'import', 'flowtype', 'prefer-object-spread', 'cypress'],
plugins: defaultPlugins,

overrides: [
// Cypress plugin, global, etc only for cypress directory
// https://github.com/cypress-io/eslint-plugin-cypress
// cypress clashes with jest expect()
{
files: ['**/cypress/**'],
plugins: [...defaultPlugins, 'cypress'],
env: {
'cypress/globals': true,
},
},
// Rules for TypeScript only
{
files: ['*.ts', '*.tsx'],
Expand Down
Loading

0 comments on commit ff26e16

Please sign in to comment.