Skip to content

Instantly share code, notes, and snippets.

@pcarion
Last active September 9, 2017 18:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pcarion/3f372efdee4f52584a14cd31af366051 to your computer and use it in GitHub Desktop.
Save pcarion/3f372efdee4f52584a14cd31af366051 to your computer and use it in GitHub Desktop.
setup a node app git repo
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