Skip to content

Instantly share code, notes, and snippets.

@horacioh
Last active November 18, 2017 19:11
Show Gist options
  • Save horacioh/48a1983be4974ce34d722cc4929934b4 to your computer and use it in GitHub Desktop.
Save horacioh/48a1983be4974ce34d722cc4929934b4 to your computer and use it in GitHub Desktop.
ReactNative-Starter Steps
{
"extends": [
"airbnb",
"prettier",
"prettier/flowtype",
"prettier/react"
],
}
module.name_mapper='^components/\(.*\)'->'<PROJECT_ROOT>/src/components/\1'
module.name_mapper='^containers/\(.*\)'->'<PROJECT_ROOT>/src/containers/\1'
module.name_mapper='^stores/\(.*\)'->'<PROJECT_ROOT>/src/stores/\1'
module.name_mapper='^routes'->'<PROJECT_ROOT>/src/routes.js'
# shell commands

react-native init <APP-NAME>
cd <APP-NAME>
npm info "eslint-config-airbnb@latest" peerDependencies

# replace versions with the result of the above command

yarn add haul  flow-bin prettier eslint-config-prettier eslint-config-airbnb eslint@^#.#.# eslint-plugin-jsx-a11y@^#.#.# eslint-plugin-import@^#.#.# eslint-plugin-react@^#.#.# 
--dev
yarn add path
yarn haul init
{
...,
"scripts": {
...,
"prettier": "prettier — single-quote — trailing-comma all — write \"src/**/*.js\"",
"flow": "flow",
},
...
}
const path = require('path');
module.exports = ({ platform, root }, defaults) => ({
entry: `./src/index.js`,
resolve: {
...defaults.resolve,
alias: {
...defaults.resolve.alias,
components: path.join(root, 'src/components'),
containers: path.join(root, 'src/containers'),
stores: path.join(root, 'src/stores'),
routes: path.join(root, 'src/routes.js'),
}
}});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment