diff --git a/packages/eslint-config-react-native-community/index.js b/packages/eslint-config-react-native-community/index.js index 9a870649783f55..191a7356682ae2 100644 --- a/packages/eslint-config-react-native-community/index.js +++ b/packages/eslint-config-react-native-community/index.js @@ -30,6 +30,14 @@ module.exports = { }, }, + overrides: { + files: ['**/__tests__/**/*.js', '**/?(*.)(spec|test).js'], + env: { + jest: true, + 'jest/globals': true, + }, + }, + // Map from global var to bool specifying if it can be redefined globals: { __DEV__: true, diff --git a/packages/eslint-config-react-native-community/package.json b/packages/eslint-config-react-native-community/package.json index 59037359a7d5e3..92fff6943818a9 100644 --- a/packages/eslint-config-react-native-community/package.json +++ b/packages/eslint-config-react-native-community/package.json @@ -1,6 +1,6 @@ { "name": "@react-native-community/eslint-config", - "version": "0.0.2", + "version": "0.0.3", "description": "ESLint config for React Native", "main": "index.js", "repository": { diff --git a/template/_eslintrc.js b/template/_eslintrc.js new file mode 100644 index 00000000000000..40c6dcd05f3100 --- /dev/null +++ b/template/_eslintrc.js @@ -0,0 +1,4 @@ +module.exports = { + root: true, + extends: '@react-native-community', +};