Skip to content

Commit

Permalink
Set up linting
Browse files Browse the repository at this point in the history
  • Loading branch information
jakiestfu committed Aug 1, 2016
1 parent bba07e5 commit 65e7782
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 11 deletions.
7 changes: 7 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": [
"airbnb/base"
],
"globals": {
}
}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
dist
build
*.log
22 changes: 15 additions & 7 deletions Gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@

var babel = require('rollup-plugin-babel');
var gulp = require('gulp');
var minify = require('uglify-js').minify;
var rollup = require('rollup-stream');
var source = require('vinyl-source-stream');
var uglify = require('rollup-plugin-uglify');
const babel = require('rollup-plugin-babel');
const eslint = require('gulp-eslint');
const gulp = require('gulp');
const minify = require('uglify-js').minify;
const rollup = require('rollup-stream');
const source = require('vinyl-source-stream');
const uglify = require('rollup-plugin-uglify');

gulp.task('build', () => rollup({
entry: './lib/postmate.js',
Expand All @@ -18,5 +19,12 @@ gulp.task('build', () => rollup({
]
})
.pipe(source('postmate.min.js'))
.pipe(gulp.dest('./dist'))
.pipe(gulp.dest('./build'))
);

gulp.task('lint', () => {
return gulp.src(['**/*.js','!node_modules/**', '!build/**'])
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError());
});
2 changes: 1 addition & 1 deletion client.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<div id="target"></div>

<script type="text/javascript" src="postmate.js"></script>
<script type="text/javascript" src="./build/postmate.min.js"></script>
<script type="text/javascript">
var container = document.getElementById('target');
var url = 'http://localhost:4000/host.html';
Expand Down
2 changes: 1 addition & 1 deletion host.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</head>
<body>

<script type="text/javascript" src="postmate.js"></script>
<script type="text/javascript" src="./build/postmate.min.js"></script>
<script type="text/javascript">
let height = function () { return document.height || document.body.offsetHeight; };
new Postmate({height}).then(client => {
Expand Down
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"serve": "python -m SimpleHTTPServer 4000",
"build": "gulp build"
"build": "gulp build",
"lint": "gulp lint"
},
"author": "",
"license": "ISC",
"devDependencies": {
"babel-preset-es2015-rollup": "^1.1.1",
"eslint-config-airbnb": "^9.0.1",
"eslint-plugin-import": "^1.12.0",
"gulp": "^3.9.1",
"gulp-eslint": "^3.0.1",
"rollup-plugin-babel": "^2.6.1",
"rollup-plugin-uglify": "^1.0.1",
"rollup-stream": "^1.11.0",
Expand Down

0 comments on commit 65e7782

Please sign in to comment.