55 * This source code is licensed under the license found in the
66 * LICENSE file in the root directory of this source tree.
77 *
8- * @flow
98 */
109
10+ const defaultPlugins = [ 'babel' , 'import' , 'flowtype' , 'prefer-object-spread' ] ;
11+
12+ const defaultPresets = [ 'prettier' , 'plugin:import/typescript' , 'plugin:react/recommended' ] ;
13+
1114module . exports = {
1215 root : true ,
1316 parser : 'babel-eslint' ,
@@ -21,9 +24,9 @@ module.exports = {
2124 } ,
2225 } ,
2326 settings : {
24- ' react' : {
25- ' version' : 'detect'
26- }
27+ react : {
28+ version : 'detect' ,
29+ } ,
2730 } ,
2831 // https://github.com/sindresorhus/globals/blob/master/globals.json
2932 env : {
@@ -33,10 +36,9 @@ module.exports = {
3336 jest : true ,
3437 mocha : true ,
3538 browser : true ,
36- 'cypress/globals' : true
3739 } ,
3840
39- extends : [ 'prettier' , 'plugin:import/typescript' , 'plugin:react/recommended' ] ,
41+ extends : defaultPresets ,
4042
4143 globals : {
4244 atom : false ,
@@ -292,9 +294,19 @@ module.exports = {
292294 'prefer-object-spread/prefer-object-spread' : 1 ,
293295 } ,
294296
295- plugins : [ 'babel' , 'import' , 'flowtype' , 'prefer-object-spread' , 'cypress' ] ,
297+ plugins : defaultPlugins ,
296298
297299 overrides : [
300+ // Cypress plugin, global, etc only for cypress directory
301+ // https://github.com/cypress-io/eslint-plugin-cypress
302+ // cypress clashes with jest expect()
303+ {
304+ files : [ '**/cypress/**' ] ,
305+ plugins : [ ...defaultPlugins , 'cypress' ] ,
306+ env : {
307+ 'cypress/globals' : true ,
308+ } ,
309+ } ,
298310 // Rules for TypeScript only
299311 {
300312 files : [ '*.ts' , '*.tsx' ] ,
0 commit comments