Skip to content

Commit

Permalink
Set up linter + prettier configuration for the Expo repo
Browse files Browse the repository at this point in the history
Adds a newer version of eslint-config-universe with base linter configurations. Each workspace does not yet have its own, more precise configuration right now.

The ESLint config contains root: true so that it doesn't inherit from ESLint configs higher up in the file system. There is also a prettierrc file that both prettier and eslint-config-universe will read i.e. our config is consistent.

Closes #3075

fbshipit-source-id: 0c6d05f
  • Loading branch information
expbot committed Aug 28, 2018
1 parent 41458d1 commit 7b8f6e6
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 6 deletions.
17 changes: 17 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Ignore all node_modules

**/node_modules/**

# Git submodules

/react-native-lab/react-native/**

# Other

/android/**
/fastlane/**
/ios/**

# TODO: Lint tools too
/tools/**
/tools-public/**
9 changes: 9 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
root: true,
extends: ['universe/native', 'universe/node', 'universe/web'],
settings: {
react: {
version: '16',
},
},
};
1 change: 1 addition & 0 deletions .prettierignore
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"printWidth": 100,
"tabWidth": 2,
"singleQuote": true,
"jsxBracketSameLine": true,
"trailingComma": "es5"
}
9 changes: 6 additions & 3 deletions home/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
{
"name": "@expo/home",
"main": "node_modules/expo/AppEntry.js",
"version": "0.0.0",
"main": ".expo/AppEntry.js",
"private": true,
"description": "The Expo client app",
"scripts": {
"postinstall": "expo-yarn-workspaces postinstall",
"test": "jest"
},
"author": "650 Industries",
Expand Down Expand Up @@ -34,9 +36,9 @@
"react": "^16.3.1",
"react-apollo": "~1.0.1",
"react-mixin": "^3.0.4",
"react-native": "expo/react-native#sdk-29",
"react-native": "*",
"react-native-deprecated-custom-components": "^0.1.0",
"react-native-infinite-scroll-view": "^0.4.2",
"react-native-infinite-scroll-view": "^0.4.5",
"react-navigation": "2.3.1",
"react-navigation-material-bottom-tabs": "^0.3.0",
"react-redux": "^5.0.1",
Expand All @@ -47,6 +49,7 @@
"url": "^0.11.0"
},
"devDependencies": {
"expo-yarn-workspaces": "^1.0.0",
"hashids": "^1.1.1",
"jest-expo": "^27.0.0",
"jsc-android": "^216113.0.0",
Expand Down
3 changes: 1 addition & 2 deletions home/utils/addListenerWithNativeCallback.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { DeviceEventEmitter } from 'react-native';
import { NativeModules } from 'react-native';
import { DeviceEventEmitter, NativeModules } from 'react-native';

const { ExponentKernel } = NativeModules;

Expand Down
16 changes: 15 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,24 @@
"private": true,
"author": "Expo",
"license": "MIT",
"scripts": {
"lint": "eslint ."
},
"exp": {
"sdkVersion": "29.0.0"
},
"workspaces": {
"packages": ["apps/*", "home", "modules/*", "packages/*", "react-native-lab/react-native"]
"packages": [
"apps/*",
"home",
"modules/*",
"packages/*",
"react-native-lab/react-native"
]
},
"devDependencies": {
"eslint": "^5.4.0",
"eslint-config-universe": "^2.0.0-alpha.0",
"prettier": "^1.14.2"
}
}
1 change: 1 addition & 0 deletions react-native-lab/transformer.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* dependencies from react-native-lab's copy of react-native, to simulate
* if we hadn't forked the transformer at all
*/
/*eslint-disable import/order */

const babel = require('./react-native/node_modules/babel-core');
const crypto = require('crypto');
Expand Down

0 comments on commit 7b8f6e6

Please sign in to comment.