Add .eslintrc to RN project template (#23901)

Summary:
The goal of this PR is to enable eslint checks in the projects generated by `react-native init` command. I added `template/_eslintrc` file, that would be replaced in an initialized project with `.eslintrc` file. This PR comes in parallel with https://github.com/react-native-community/react-native-cli/pull/229

[General] [Added] - Added `.eslintrc` file to generated template.
Pull Request resolved: https://github.com/facebook/react-native/pull/23901

Differential Revision: D14561084

Pulled By: cpojer

fbshipit-source-id: 6eb717bf03c45d83ae8a393e6a0abb79e1e2f915
This commit is contained in:
michalchudziak
2019-03-21 07:07:54 -07:00
committed by Facebook Github Bot
parent 3c2300f4fe
commit 395197dafe
3 changed files with 13 additions and 1 deletions

View File

@@ -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,

View File

@@ -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": {

4
template/_eslintrc.js Normal file
View File

@@ -0,0 +1,4 @@
module.exports = {
root: true,
extends: '@react-native-community',
};