Skip to content

Commit

Permalink
feat(boilerplate): add eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
nothaldir committed Jul 13, 2017
1 parent debde8e commit 78ad2b2
Show file tree
Hide file tree
Showing 9 changed files with 82 additions and 39 deletions.
14 changes: 14 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"presets": [
"flow",
["env", {
"targets": {
"browsers": [
"last 2 versions",
"not ie <= 11",
"not ie_mob < 20"
]
}
}]
]
}
8 changes: 8 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Ignore config files
node_modules/*

# Ignore built files
build/*

# Ignore config files
bs-config.js
33 changes: 33 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"env": {
"browser": true,
"es6": true
},
"extends": [
"eslint-config-airbnb-base"
],
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"rules": {
"strict": 0,
"semi": 0,
"no-console": 1,
"indent": [
"error",
2
],
"linebreak-style": [
"error",
"unix"
],
"quotes": [
1,
"single"
],
}
}
15 changes: 15 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Set the default behavior, in case people don't have core.autocrlf set.
* text eol=lf

# Explicitly declare text files you want to always be normalized and converted
# to native line endings on checkout.
*.c text
*.h text

# Declare files that will always have CRLF line endings on checkout.
*.sln text eol=crlf

# Denote all files that are truly binary and should not be modified.
*.png binary
*.jpg binary
*.gif binary
7 changes: 7 additions & 0 deletions app/scripts/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const App = 'App';

console.log(App);

console.log('This is my awesome log');

console.log('hello');
5 changes: 0 additions & 5 deletions app/scripts/components/App.js

This file was deleted.

3 changes: 0 additions & 3 deletions app/scripts/index.js

This file was deleted.

9 changes: 0 additions & 9 deletions app/styles/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,3 @@ $primary-color : #45C8DC;
* {
color: red !important;
}

header {
h1 {
color: green;
}
input::placeholder {
color: red;
}
}
27 changes: 5 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,15 @@
"scripts": {
"clean-build": "npm run remove-build && mkdir build && mkdir build/scripts",
"remove-build": "rimraf ./build",

"build": "npm-run-all clean-build babel pug node-sass postcss",
"start": "npm run clean-build && npm-run-all --parallel clean-build babel:watch pug:watch styles:watch browser-sync",

"babel": "babel app/scripts --out-file build/scripts/app.js",
"babel": "babel app/scripts/*.js --out-file build/scripts/app.js -s",
"babel:watch": "npm run babel -- -w",

"pug": "pug app/views/*.pug --out build",
"pug:watch": "npm run pug -- -w",

"node-sass": "node-sass app/styles/main.scss build/styles/app.css",
"postcss": "postcss build/styles/app.css --use postcss-cssnext -r",
"styles:watch": "npm-run-all node-sass -- -w && npm run postcss -- -w",

"browser-sync": "browser-sync start --config bs-config.js"
},
"repository": {
Expand All @@ -39,8 +34,12 @@
"devDependencies": {
"babel-cli": "^6.24.1",
"babel-preset-env": "^1.6.0",
"babel-preset-flow": "^6.23.0",
"browser-sync": "^2.18.12",
"cz-conventional-changelog": "^2.0.0",
"eslint": "^3.19.0",
"eslint-config-airbnb-base": "^11.2.0",
"eslint-plugin-import": "^2.7.0",
"node-sass": "^4.5.3",
"npm-run-all": "^4.0.2",
"postcss-cli": "^4.1.0",
Expand All @@ -51,21 +50,5 @@
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
},
"babel": {
"presets": [
[
"env",
{
"targets": {
"browsers": [
"last 2 versions",
"not ie <= 10",
"not ie_mob <= 10"
]
}
}
]
]
}
}

0 comments on commit 78ad2b2

Please sign in to comment.