فهرست منبع

fix lint errors

Yuki Takei 8 سال پیش
والد
کامیت
3d22a381c4

+ 1 - 1
bin/generate-plugin-definitions-source.js

@@ -22,7 +22,7 @@ if (process.env.NODE_ENV === 'development'
     && process.env.PLUGIN_NAMES_TOBE_LOADED !== undefined
     && process.env.PLUGIN_NAMES_TOBE_LOADED.length > 0) {
 
-  pluginNamesDev = process.env.PLUGIN_NAMES_TOBE_LOADED.split(',');
+  const pluginNamesDev = process.env.PLUGIN_NAMES_TOBE_LOADED.split(',');
 
   // merge and remove duplicates
   if (pluginNamesDev.length > 0) {

+ 1 - 1
bin/shrink-emojione-strategy.js

@@ -14,7 +14,7 @@ const markdownItEmojiFull = require('markdown-it-emoji/lib/data/full.json');
 let shrinkedMap = {};
 for (let unicode in emojiStrategy) {
   const data = emojiStrategy[unicode];
-  const shortname = data.shortname.replace(/\:/g, '');
+  const shortname = data.shortname.replace(/:/g, '');
 
   // ignore if it isn't included in markdownItEmojiFull
   if (markdownItEmojiFull[shortname] == null) {

+ 0 - 2
config/helpers.js

@@ -5,8 +5,6 @@
 
 var path = require('path');
 
-const EVENT = process.env.npm_lifecycle_event || '';
-
 // Helper functions
 var ROOT = path.resolve(__dirname, '..');
 

+ 1 - 1
config/webpack.common.js

@@ -82,7 +82,7 @@ module.exports = function(options) {
         /* File loader for supporting fonts, for example, in CSS files.
         */
         {
-          test: /\.(eot|woff2?|svg|ttf)([\?]?.*)$/,
+          test: /\.(eot|woff2?|svg|ttf)([?]?.*)$/,
           use: 'file-loader',
         }
       ]

+ 2 - 5
lib/events/page.js

@@ -10,13 +10,10 @@ function PageEvent(crowi) {
 util.inherits(PageEvent, events.EventEmitter);
 
 PageEvent.prototype.onCreate = function(page, user) {
-  var User = this.crowi.model('User');
-  var Page = this.crowi.model('Page');
-
+  debug('onCreate event fired');
 };
 PageEvent.prototype.onUpdate = function(page, user) {
-  var User = this.crowi.model('User');
-  var Page = this.crowi.model('Page');
+  debug('onUpdate event fired');
 };
 
 module.exports = PageEvent;

+ 4 - 5
lib/models/attachment.js

@@ -3,6 +3,7 @@ module.exports = function(crowi) {
     , mongoose = require('mongoose')
     , ObjectId = mongoose.Schema.Types.ObjectId
     , fileUploader = require('../util/fileUploader')(crowi)
+    , attachmentSchema
   ;
 
   function generateFileHash(fileName) {
@@ -140,7 +141,7 @@ module.exports = function(crowi) {
     return new Promise((resolve, reject) => {
       Attachment.getListByPageId(pageId)
       .then((attachments) => {
-        for (attachment of attachments) {
+        for (let attachment of attachments) {
           Attachment.removeAttachment(attachment).then((res) => {
             // do nothing
           }).catch((err) => {
@@ -157,10 +158,8 @@ module.exports = function(crowi) {
   };
 
   attachmentSchema.statics.findDeliveryFile = function(attachment, forceUpdate) {
-    var Attachment = this;
-
-    // TODO
-    var forceUpdate = forceUpdate || false;
+    // TODO force update
+    // var forceUpdate = forceUpdate || false;
 
     return fileUploader.findDeliveryFile(attachment._id, attachment.filePath);
   };

+ 1 - 0
lib/models/updatePost.js

@@ -5,6 +5,7 @@ module.exports = function(crowi) {
   var debug = require('debug')('growi:models:updatePost')
     , mongoose = require('mongoose')
     , ObjectId = mongoose.Schema.Types.ObjectId
+    , updatePostSchema
   ;
 
   // TODO: slack 以外の対応