diff --git a/core/client/app.js b/core/client/app.js index bd8a3e397e..c34986087e 100755 --- a/core/client/app.js +++ b/core/client/app.js @@ -8,7 +8,7 @@ Ember.MODEL_FACTORY_INJECTIONS = true; var App = Ember.Application.extend({ modulePrefix: 'ghost', - Resolver: Resolver['default'] + Resolver: Resolver.default }); // Runtime configuration of Ember.Application diff --git a/core/client/controllers/post-tags-input.js b/core/client/controllers/post-tags-input.js index eed7d4fccf..91191b1292 100644 --- a/core/client/controllers/post-tags-input.js +++ b/core/client/controllers/post-tags-input.js @@ -227,9 +227,7 @@ var PostTagsInputController = Ember.Controller.extend({ makeSuggestionObject: function (matchingTag, _searchTerm) { var searchTerm = Ember.Handlebars.Utils.escapeExpression(_searchTerm), - // jscs:disable regexEscapedSearchTerm = searchTerm.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&'), - // jscs:enable tagName = Ember.Handlebars.Utils.escapeExpression(matchingTag.get('name')), regex = new RegExp('(' + regexEscapedSearchTerm + ')', 'gi'), highlightedName, diff --git a/core/client/helpers/gh-format-html.js b/core/client/helpers/gh-format-html.js index a1a6039ece..eb48e119b1 100644 --- a/core/client/helpers/gh-format-html.js +++ b/core/client/helpers/gh-format-html.js @@ -5,12 +5,10 @@ var formatHTML = Ember.Handlebars.makeBoundHelper(function (html) { var escapedhtml = html || ''; // replace script and iFrame - // jscs:disable escapedhtml = escapedhtml.replace(/)<[^<]*)*<\/script>/gi, '
Embedded JavaScript
'); escapedhtml = escapedhtml.replace(/)<[^<]*)*<\/iframe>/gi, '
Embedded iFrame
'); - // jscs:enable // sanitize HTML // jscs:disable requireCamelCaseOrUpperCaseIdentifiers diff --git a/core/client/helpers/gh-format-markdown.js b/core/client/helpers/gh-format-markdown.js index 03dabc2f8d..7284885671 100644 --- a/core/client/helpers/gh-format-markdown.js +++ b/core/client/helpers/gh-format-markdown.js @@ -13,12 +13,10 @@ formatMarkdown = Ember.Handlebars.makeBoundHelper(function (markdown) { escapedhtml = showdown.makeHtml(markdown || ''); // replace script and iFrame - // jscs:disable escapedhtml = escapedhtml.replace(/)<[^<]*)*<\/script>/gi, '
Embedded JavaScript
'); escapedhtml = escapedhtml.replace(/)<[^<]*)*<\/iframe>/gi, '
Embedded iFrame
'); - // jscs:enable // sanitize html // jscs:disable requireCamelCaseOrUpperCaseIdentifiers diff --git a/core/client/loader.js b/core/client/loader.js index b8581aa964..5d7357c3ec 100644 --- a/core/client/loader.js +++ b/core/client/loader.js @@ -2,5 +2,5 @@ /*global require */ if (!window.disableBoot) { - window.App = require('ghost/app')['default'].create(); + window.App = require('ghost/app').default.create(); } diff --git a/core/client/mixins/editor-base-controller.js b/core/client/mixins/editor-base-controller.js index 6297e414bf..c6f90d2c7d 100644 --- a/core/client/mixins/editor-base-controller.js +++ b/core/client/mixins/editor-base-controller.js @@ -320,9 +320,7 @@ EditorControllerMixin = Ember.Mixin.create(MarkerManager, { var editor = this.get('codemirror'), line = this.findLine(Ember.$(e.currentTarget).attr('id')), lineNumber = editor.getLineNumber(line), - // jscs:disable match = line.text.match(/\([^\n]*\)?/), - // jscs:enable replacement = '(http://)'; if (match) { @@ -332,9 +330,7 @@ EditorControllerMixin = Ember.Mixin.create(MarkerManager, { {line: lineNumber, ch: match.index + match[0].length - 1} ); } else { - // jscs:disable match = line.text.match(/\]/); - // jscs:enable if (match) { editor.replaceRange( replacement, diff --git a/core/client/mixins/marker-manager.js b/core/client/mixins/marker-manager.js index ee8acc7a39..c8a1dd4f1f 100644 --- a/core/client/mixins/marker-manager.js +++ b/core/client/mixins/marker-manager.js @@ -1,8 +1,6 @@ var MarkerManager = Ember.Mixin.create({ - // jscs:disable imageMarkdownRegex: /^(?:\{<(.*?)>\})?!(?:\[([^\n\]]*)\])(?:\(([^\n\]]*)\))?$/gim, markerRegex: /\{<([\w\W]*?)>\}/, - // jscs:enable uploadId: 1, @@ -164,9 +162,7 @@ var MarkerManager = Ember.Mixin.create({ var editor = this.get('codemirror'), ln = editor.getLineNumber(line), - // jscs:disable markerRegex = /\{<([\w\W]*?)>\}/, - // jscs:enable markerText = line.text.match(markerRegex); diff --git a/core/client/utils/caja-sanitizers.js b/core/client/utils/caja-sanitizers.js index 2efe4a9b88..db8538b229 100644 --- a/core/client/utils/caja-sanitizers.js +++ b/core/client/utils/caja-sanitizers.js @@ -9,12 +9,10 @@ var url, * URLs are allowed if they start with http://, https://, or /. */ url = function (url) { - // jscs:disable url = url.toString().replace(/['"]+/g, ''); if (/^https?:\/\//.test(url) || /^\//.test(url)) { return url; } - // jscs:enable }; /** diff --git a/core/client/utils/codemirror-shortcuts.js b/core/client/utils/codemirror-shortcuts.js index 9ee73a5934..c6262e4ce7 100644 --- a/core/client/utils/codemirror-shortcuts.js +++ b/core/client/utils/codemirror-shortcuts.js @@ -49,9 +49,7 @@ function init() { hashPrefix = new Array(currentHeaderLevel + 2).join('#'); - // jscs:disable replacementLine = hashPrefix + ' ' + line.replace(/^#* /, ''); - // jscs:enable this.replaceRange(replacementLine, fromLineStart, toLineEnd); this.setCursor(cursor.line, cursor.ch + replacementLine.length); @@ -86,9 +84,7 @@ function init() { return; case 'list': - // jscs:disable md = text.replace(/^(\s*)(\w\W*)/gm, '$1* $2'); - // jscs:enable this.replaceSelection(md, 'end'); return; diff --git a/core/server/api/utils.js b/core/server/api/utils.js index 39414ae2f9..b8624021d0 100644 --- a/core/server/api/utils.js +++ b/core/server/api/utils.js @@ -30,7 +30,7 @@ utils = { } return Promise.resolve(object); }, - checkFileExists: function (options, filename) { + checkFileExists: function (options, filename) { return options[filename] && options[filename].type && options[filename].path; }, checkFileIsValid: function (file, types, extensions) { diff --git a/core/test/integration/import_spec.js b/core/test/integration/import_spec.js index 86d7c3620a..8fc1d9d112 100644 --- a/core/test/integration/import_spec.js +++ b/core/test/integration/import_spec.js @@ -58,7 +58,7 @@ describe('Import', function () { }); describe('Sanitizes', function () { - before(function () { + before(function () { knex = config.database.knex; }); beforeEach(testUtils.setup('roles', 'owner', 'settings')); @@ -122,7 +122,7 @@ describe('Import', function () { }); describe('DataImporter', function () { - before(function () { + before(function () { knex = config.database.knex; }); beforeEach(testUtils.setup('roles', 'owner', 'settings')); @@ -337,7 +337,7 @@ describe('Import', function () { }); describe('002', function () { - before(function () { + before(function () { knex = config.database.knex; }); beforeEach(testUtils.setup('roles', 'owner', 'settings')); @@ -507,7 +507,7 @@ describe('Import', function () { }); describe('003', function () { - before(function () { + before(function () { knex = config.database.knex; }); beforeEach(testUtils.setup('roles', 'owner', 'settings')); diff --git a/package.json b/package.json index ee9b23411a..93cbcdc3fd 100644 --- a/package.json +++ b/package.json @@ -88,7 +88,7 @@ "grunt-ember-templates": "~0.5.0-alpha", "grunt-es6-module-transpiler": "~0.6.0", "grunt-express-server": "~0.4.19", - "grunt-jscs": "~1.1.0", + "grunt-jscs": "~1.2.0", "grunt-mocha-cli": "~1.11.0", "grunt-sass": "~0.16.1", "grunt-shell": "~1.1.1",