Skip to content

Commit

Permalink
chore(formatting): Installed prettier/eslint (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackpope authored Jan 24, 2020
1 parent 240b40d commit b353f3b
Show file tree
Hide file tree
Showing 45 changed files with 15,526 additions and 3,222 deletions.
5 changes: 2 additions & 3 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"presets": [
[ "es2015-script" ]
]
"presets": [["es2015-script"]],
"plugins": ["transform-object-rest-spread"]
}
22 changes: 22 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"parser": "babel-eslint",
"extends": ["airbnb-base", "prettier"],
"plugins": ["import", "prettier"],
"env": {
"browser": true
},
"rules": {
"comma-dangle": ["error", "never"],
"no-underscore-dangle": "off",
"no-inner-declarations": "off"
},
"globals": {
"describe": true,
"beforeEach": true,
"beforeAll": true,
"afterEach": true,
"it": true,
"expect": true,
"$": true
}
}
10 changes: 0 additions & 10 deletions .jshintrc

This file was deleted.

4 changes: 4 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"printWidth": 100,
"singleQuote": true
}
65 changes: 28 additions & 37 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,42 +1,38 @@
const gulp = require("gulp"),
sourcemaps = require("gulp-sourcemaps"),
source = require("vinyl-source-stream"),
buffer = require("vinyl-buffer"),
browserify = require("browserify"),
watchify = require("watchify"),
insert = require("gulp-insert"),
babelify = require("babelify"),
stripComments = require("gulp-strip-comments"),
rename = require("gulp-rename"),
webserver = require("gulp-webserver"),
uglify = require("gulp-uglify"),
gutil = require("gulp-util"),
sass = require("gulp-sass"),
debug = require("gulp-debug"),
pump = require("pump"),
mocha = require("gulp-mocha"),
jshint = require("gulp-jshint"),
stylish = require("jshint-stylish"),
handlebars = require("gulp-handlebars"),
wrap = require("gulp-wrap"),
concat = require("gulp-concat"),
declare = require("gulp-declare"),
autoprefixer = require("gulp-autoprefixer");
const gulp = require("gulp");
const sourcemaps = require("gulp-sourcemaps");
const source = require("vinyl-source-stream");
const buffer = require("vinyl-buffer");
const browserify = require("browserify");
const watchify = require("watchify");
const babelify = require("babelify");
const stripComments = require("gulp-strip-comments");
const rename = require("gulp-rename");
const webserver = require("gulp-webserver");
const uglify = require("gulp-uglify");
const gutil = require("gulp-util");
const sass = require("gulp-sass");
const pump = require("pump");
const mocha = require("gulp-mocha");
const handlebars = require("gulp-handlebars");
const wrap = require("gulp-wrap");
const concat = require("gulp-concat");
const declare = require("gulp-declare");
const autoprefixer = require("gulp-autoprefixer");

const FILENAME = "videojs-annotation-comments.js";
const CJSFILENAME = "videojs-annotation-comments.cjs.js";
const PACKAGE = require("./package.json");

//compilation function for browserify/bundler/transpilation
// compilation function for browserify/bundler/transpilation
function compile(watch, cb) {
var bundlerDefault = {
const bundlerDefault = {
entry: "./src/js/index.js",
browserifyOptions: { debug: true },
transformOptions: {},
filename: FILENAME
};

var bundlerCjs = {
const bundlerCjs = {
entry: "./src/js/annotation_comments.js",
browserifyOptions: {
debug: true,
Expand All @@ -57,8 +53,10 @@ function compile(watch, cb) {
}

function rebundle(bundlers, watch) {
for (b of bundlers) {
var browserifyStream = watch ? watchify(buildStream(b)) : buildStream(b);
bundlers.forEach(b => {
const browserifyStream = watch
? watchify(buildStream(b))
: buildStream(b);

browserifyStream
.bundle()
Expand All @@ -70,7 +68,7 @@ function compile(watch, cb) {
.pipe(sourcemaps.init({ loadMaps: true }))
.pipe(sourcemaps.write("./"))
.pipe(gulp.dest("./build"));
}
});
}

if (watch) {
Expand Down Expand Up @@ -182,13 +180,6 @@ gulp.task("tdd", function() {
);
});

gulp.task("lint", function() {
return gulp
.src("./src/*/*.js")
.pipe(jshint(".jshintrc"))
.pipe(jshint.reporter(stylish));
});

gulp.task("transpile", cb => compile(false, cb));
gulp.task("bundle_watch", cb => compile(true, cb));
gulp.task("watch", [
Expand Down
15 changes: 11 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@
],
"scripts": {
"test": "gulp test",
"integration": "echo open in chrome: http://localhost:3004/mocha/features/index.html",
"watch": "gulp watch",
"build": "gulp build"
"build": "gulp build",
"lint": "eslint ./src"
},
"author": "Evan Carothers (@ecaroth) & Jack Pope (@jackpope)",
"copyright": "Copyright Contently, Inc. <https://www.contently.com/>",
Expand All @@ -20,13 +22,20 @@
"@semantic-release/changelog": "^3.0.5",
"@semantic-release/git": "^7.0.18",
"babel-core": "^6.26.3",
"babel-eslint": "^10.0.3",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-plugin-transform-es2015-modules-simple-commonjs": "^0.3.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-es2015-script": "^1.1.0",
"babelify": "^7.3.0",
"browserify": "^16.5.0",
"chai": "^4.2.0",
"es6-object-assign": "^1.1.0",
"eslint": "^6.8.0",
"eslint-config-airbnb-base": "^14.0.0",
"eslint-config-prettier": "^6.9.0",
"eslint-plugin-import": "^2.19.1",
"eslint-plugin-prettier": "^3.1.2",
"gulp": "^3.9.1",
"gulp-autoprefixer": "^4.1.0",
"gulp-babel": "^6.1.3",
Expand All @@ -37,7 +46,6 @@
"gulp-delete-lines": "0.0.7",
"gulp-handlebars": "^4.0.0",
"gulp-insert": "^0.5.0",
"gulp-jshint": "^2.1.0",
"gulp-mocha": "^4.3.1",
"gulp-rename": "^1.4.0",
"gulp-replace": "^0.5.4",
Expand All @@ -50,10 +58,9 @@
"gulp-wrap": "^0.13.0",
"handlebars": "^4.0.11",
"ie-array-find-polyfill": "^1.1.0",
"jshint": "^2.9.6",
"jshint-stylish": "~2.0.1",
"mocha": "^6.2.0",
"moment": "^2.24.0",
"prettier": "^1.19.1",
"pump": "^1.0.3",
"semantic-release": "^15.13.21",
"underscore": "^1.9.1",
Expand Down
Loading

0 comments on commit b353f3b

Please sign in to comment.