Skip to content

Commit

Permalink
Add .eslintrc to RN project template (#23901)
Browse files Browse the repository at this point in the history
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 react-native-community/cli#229

[General] [Added] - Added `.eslintrc` file to generated template.
Pull Request resolved: #23901

Differential Revision: D14561084

Pulled By: cpojer

fbshipit-source-id: 6eb717bf03c45d83ae8a393e6a0abb79e1e2f915
  • Loading branch information
michalchudziak authored and facebook-github-bot committed Mar 21, 2019
1 parent 3c2300f commit 395197d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
8 changes: 8 additions & 0 deletions packages/eslint-config-react-native-community/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-config-react-native-community/package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
4 changes: 4 additions & 0 deletions template/_eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
root: true,
extends: '@react-native-community',
};

0 comments on commit 395197d

Please sign in to comment.