Skip to content

Commit

Permalink
feat: Add eslint to react native project template. (react-native-co…
Browse files Browse the repository at this point in the history
…mmunity#229)

* chore: add eslint to RN template

* Change .eslintrc to .eslintrc.js
  • Loading branch information
michalchudziak authored and dratwas committed Jul 12, 2019
1 parent bc98510 commit c239c83
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 c239c83

Please sign in to comment.