Skip to content

Commit

Permalink
added airbnb linting for all js. Added linting to test pipeline in tr…
Browse files Browse the repository at this point in the history
…avis.
  • Loading branch information
madison.grubb committed Nov 26, 2017
1 parent 52e608c commit 814f03e
Show file tree
Hide file tree
Showing 5 changed files with 3,713 additions and 63 deletions.
15 changes: 15 additions & 0 deletions .eslintrc.js
@@ -0,0 +1,15 @@
module.exports = {
'env': {
'browser': true,
'es6': true,
'node': true,
},
'extends': 'airbnb-base',
'parserOptions': {
'sourceType': 'module',
},
'rules': {
// This is a cli tool. Therefore, we don't really care about console logs.
'no-console': 'off',
}
};
5 changes: 4 additions & 1 deletion .travis.yml
@@ -1,10 +1,13 @@
git:
depth: 4
depth: 1
language: node_js
node_js:
- '6'
- '8'
sudo: false
script:
- npm install
- npm test
- npm run compile
- npm run release
deploy:
Expand Down
72 changes: 36 additions & 36 deletions gulpfile.js
@@ -1,48 +1,48 @@
var gulp = require('gulp'),
markdownpdf = require('gulp-markdown-pdf'),
zip = require('gulp-zip'),
changed = require('gulp-changed'),
fs = require('fs'),
pjson = require('./package.json');
const gulp = require('gulp');
const markdownpdf = require('gulp-markdown-pdf');
const zip = require('gulp-zip');
const changed = require('gulp-changed');
const fs = require('fs');
const pjson = require('./package.json');

var config = {
mdPath: 'src/markdown/*.md',
cssPath: 'src/styles/main.css',
out: 'documents',
readme: 'README.md',
const config = {
mdPath: 'src/markdown/*.md',
cssPath: 'src/styles/main.css',
out: 'documents',
readme: 'README.md',
};

// compile all the documents
gulp.task('compile', function() {
var cwd = process.cwd();
return gulp.src(config.mdPath)
.pipe(changed(config.out, {extension: '.pdf'}))
.pipe(markdownpdf({
cwd: cwd,
cssPath: config.cssPath
}))
.pipe(gulp.dest(config.out));
gulp.task('compile', () => {
const cwd = process.cwd();
return gulp.src(config.mdPath)
.pipe(changed(config.out, { extension: '.pdf' }))
.pipe(markdownpdf({
cwd,
cssPath: config.cssPath,
}))
.pipe(gulp.dest(config.out));
});

// create release zip from documents
gulp.task('release', function() {
fs.stat('documents', function(err, stat) {
if (err) {
return console.log(err);
}
var release = 'microluxe20_' + pjson.version + '.zip';
return gulp.src(['documents/*', 'character-sheets/*', 'map/*.png', 'LICENSE'])
.pipe(zip(release))
.pipe(gulp.dest('./release'));
});
gulp.task('release', () => {
fs.stat('documents', (err) => {
if (err) {
return console.log(err);
}
const release = `microluxe20_${pjson.version}.zip`;
return gulp.src(['documents/*', 'character-sheets/*', 'map/*.png', 'LICENSE'])
.pipe(zip(release))
.pipe(gulp.dest('./release'));
});
});

gulp.task('watch', function() {
gulp.watch([config.mdPath, config.cssPath], ['compile']);
gulp.task('watch', () => {
gulp.watch([config.mdPath, config.cssPath], ['compile']);
});

gulp.task('default', function() {
console.log(fs.readFileSync(config.readme, {
encoding: 'UTF8'
}));
gulp.task('default', () => {
console.log(fs.readFileSync(config.readme, {
encoding: 'UTF8',
}));
});

0 comments on commit 814f03e

Please sign in to comment.