Improve linting and cleanup

pull/1/head
Joe Biellik 8 years ago
parent 37a229bb09
commit d1dbd30d6c

@ -3,9 +3,15 @@
"node": true,
"es6": true
},
"extends": ["eslint:recommended"],
"parser": "babel-eslint",
"rules": {
"indent": [2, "tab"],
"quotes": [2, "single", "avoid-escape"]
"indent": ["error", "tab"],
"quotes": ["error", "single", "avoid-escape"],
"linebreak-style": ["error", "unix"],
"semi": ["error", "always"],
"no-trailing-spaces": ["warn"],
"comma-dangle": ["error"],
"no-console": ["warn", { allow: ["warn", "error"] }]
}
}

@ -6,7 +6,7 @@ require('babel-core/register')({
var config = require('config');
var app = require('koa')();
var router = require('./router');
var db = require('./db')();
require('./db')();
app.keys = config.keys;
app.proxy = true;

@ -2,7 +2,7 @@ var config = require('config');
var Paste = require('../models/paste');
module.exports = {
*view(next) {
*view() {
try {
let paste = yield Paste.findById(this.params.id).exec();
let lang = Object.keys(this.query)[0];
@ -23,7 +23,7 @@ module.exports = {
}
},
*create(next) {
*create() {
if (this.request.body.fields) {
if (this.request.body.fields.paste) {
this.request.body.paste = this.request.body.fields.paste;

@ -2,15 +2,15 @@ var config = require('config');
var util = require('util');
var mongoose = require('mongoose');
module.exports = function () {
module.exports = function() {
mongoose.Promise = global.Promise;
mongoose.connect(config.db);
mongoose.connect(config.db);
mongoose.connection.once('open', function () {
mongoose.connection.once('open', function() {
util.log('MongoDB connection open');
});
mongoose.connection.on('error', console.error.bind(console, 'MongoDB connection error:'));
return mongoose.connection;
}
};

@ -1,3 +1,6 @@
/* eslint-env browser */
/* global $ autosize */
$(document).ready(function() {
autosize($('textarea'));
@ -17,7 +20,7 @@ $(document).ready(function() {
window.getSelection().addRange(range);
});
$('select#highlight').change(function(e) {
$('select#highlight').change(function() {
location.hash = $(this).val();
});

Loading…
Cancel
Save