Skip to content

Commit

Permalink
feat: Add eslint to react native project template. (#229)
Browse files Browse the repository at this point in the history
* chore: add eslint to RN template

* Change .eslintrc to .eslintrc.js
  • Loading branch information
michalchudziak authored and thymikee committed Mar 21, 2019
1 parent 872d91a commit c6d46b3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/cli/src/commands/init/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ function generateProject(destinationRoot, newProjectName, options) {
PackageManager.installDev([
'@babel/core',
'@babel/runtime',
'@react-native-community/eslint-config',
'eslint',
'jest',
'babel-jest',
'metro-react-native-babel-preset',
Expand All @@ -84,6 +86,7 @@ function addJestToPackageJson(destinationRoot) {
const packageJSON = JSON.parse(fs.readFileSync(packageJSONPath));

packageJSON.scripts.test = 'jest';
packageJSON.scripts.lint = 'eslint .';
packageJSON.jest = {
preset: 'react-native',
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ function translateFilePath(filePath) {
.replace('_gitignore', '.gitignore')
.replace('_gitattributes', '.gitattributes')
.replace('_babelrc', '.babelrc')
.replace('_eslintrc.js', '.eslintrc.js')
.replace('_flowconfig', '.flowconfig')
.replace('_buckconfig', '.buckconfig')
.replace('_watchmanconfig', '.watchmanconfig');
Expand Down

0 comments on commit c6d46b3

Please sign in to comment.