Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 395197d

Browse files
michalchudziakfacebook-github-bot
authored andcommittedMar 21, 2019
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 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
1 parent 3c2300f commit 395197d

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed
 

‎packages/eslint-config-react-native-community/index.js

+8
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@ module.exports = {
3030
},
3131
},
3232

33+
overrides: {
34+
files: ['**/__tests__/**/*.js', '**/?(*.)(spec|test).js'],
35+
env: {
36+
jest: true,
37+
'jest/globals': true,
38+
},
39+
},
40+
3341
// Map from global var to bool specifying if it can be redefined
3442
globals: {
3543
__DEV__: true,

‎packages/eslint-config-react-native-community/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@react-native-community/eslint-config",
3-
"version": "0.0.2",
3+
"version": "0.0.3",
44
"description": "ESLint config for React Native",
55
"main": "index.js",
66
"repository": {

‎template/_eslintrc.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
root: true,
3+
extends: '@react-native-community',
4+
};

0 commit comments

Comments
 (0)
Please sign in to comment.