-
Notifications
You must be signed in to change notification settings - Fork 1
Setup
Yoann Cribier edited this page May 30, 2018
·
4 revisions
https://www.youtube.com/watch?v=NhTiSfu2LK4&
git clone git@github.com:akabab/todos-client-react.git
cd todos-client-react
git checkout -b react-setup
# uninstall yarn (si yarn fais chier)
brew uninstall --force yarn
# Generate app in current directory
npx create-react-app .
commit
git add . && git commit -m "Init create-react-app"
npx storybook
commit
git add . && git commit -m "add storybook"
npm install --save-dev eslint eslint-config-standard eslint-plugin-import eslint-plugin-node eslint-plugin-promise eslint-plugin-standard stylelint stylelint-config-standard
add lint scripts in package.json
scripts: {
// ...
"lint": "npm run lint:js && npm run lint:css",
"lint:js": "eslint .",
"lint:css": "stylelint 'src/**/*.css'",
"lint:fix": "eslint --fix . && stylelint --fix 'src/**/*.css'"
}
create .stylelintrc config file
{
"extends": "stylelint-config-standard"
}
create .eslintrc config file
{
"extends": [
"react-app",
"standard"
]
}
Fix lint errors
npm run lint:fix
commit
git add . && git commit -m "add lint"
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
# Indentation override for all JS under lib directory
[*.{js,json}]
charset = utf-8
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
max_line_length = 80
commit
git add .editorconfig && git commit -m "add editorconfig"
Si ce n'est pas deja fait, installer le plugin EditorConfig pour votre editeur http://editorconfig.org/#download
.travis.yml
language: node_js
node_js:
- "node"
branches:
only:
- dev
- master
jobs:
include:
- stage: style
script: npm run lint
- stage: test
script: npm run test
commit
git add .travis.yml && git commit -m "add travis"
Faite votre pull request sur github pour merge votre branche init-setup vers master.
π π π π π π π π