Last active
September 9, 2017 18:16
-
-
Save pcarion/3f372efdee4f52584a14cd31af366051 to your computer and use it in GitHub Desktop.
setup a node app git repo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yarn add --dev babel-cli babel-plugin-transform-object-rest-spread babel-preset-es2015 | |
cat > .babelrc << EOF | |
{ | |
"presets": ["es2015"], | |
"plugins": [ | |
"transform-object-rest-spread" | |
] | |
} | |
EOF | |
yarn add --dev babel-eslint | |
(export PKG=eslint-config-airbnb;npm info "$PKG@latest" peerDependencies --json | command sed 's/[\{\},]//g ; s/: /@/g' | xargs npm install --save-dev "$PKG@latest") | |
cat > .eslintrc << EOF | |
{ | |
"env" : { | |
"es6": true | |
}, | |
"extends": "airbnb", | |
"rules": { | |
"import/no-extraneous-dependencies": 0, | |
"arrow-body-style" : 0, | |
"no-unused-vars": [2, { | |
"vars": "all", | |
"args": "after-used", | |
"argsIgnorePattern": "^_", | |
"varsIgnorePattern": "^_" | |
}] | |
} | |
} | |
EOF | |
cat > .editorconfig << EOF | |
root = true | |
[*] | |
indent_style = space | |
indent_size = 2 | |
end_of_line = lf | |
insert_final_newline = true | |
EOF | |
yarn add --dev rimraf | |
cat > package_scripts.txt << EOF | |
"scripts": { | |
"clean": "rimraf ./lib && mkdir lib", | |
"prebuild": "npm run clean", | |
"build": "babel -d lib/ src/", | |
"lint": "eslint src; exit 0", | |
"prestart": "npm run build", | |
"start": "node lib/main.js", | |
}, | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment