diff --git a/addon/lint/coffeescript-lint.js b/addon/lint/coffeescript-lint.js index 7e39428f7a6640ce26d9839febd24c14b356d932..70621a1bddf1f7df62f66c276d47d5873ab2ef51 100644 --- a/addon/lint/coffeescript-lint.js +++ b/addon/lint/coffeescript-lint.js @@ -17,6 +17,12 @@ CodeMirror.registerHelper("lint", "coffeescript", function(text) { var found = []; + if (!window.coffeelint) { + if (window.console) { + window.console.error("Error: window.coffeelint not defined, CodeMirror CoffeeScript linting cannot run."); + } + return found; + } var parseError = function(err) { var loc = err.lineNumber; found.push({from: CodeMirror.Pos(loc-1, 0), diff --git a/addon/lint/css-lint.js b/addon/lint/css-lint.js index 1f61b479b2afd95483d5a8b66b6a393f79128933..b7e1a4fe5de2405d15e9aadb477c659d1e59ebe7 100644 --- a/addon/lint/css-lint.js +++ b/addon/lint/css-lint.js @@ -17,7 +17,12 @@ CodeMirror.registerHelper("lint", "css", function(text) { var found = []; - if (!window.CSSLint) return found; + if (!window.CSSLint) { + if (window.console) { + window.console.error("Error: window.CSSLint not defined, CodeMirror CSS linting cannot run."); + } + return found; + } var results = CSSLint.verify(text), messages = results.messages, message = null; for ( var i = 0; i < messages.length; i++) { message = messages[i]; diff --git a/addon/lint/html-lint.js b/addon/lint/html-lint.js index 1e8417098d0c234444096ca4d8fbd9b931a87948..98c36b0b642e26abe19db8f30672117c0d6fb77c 100644 --- a/addon/lint/html-lint.js +++ b/addon/lint/html-lint.js @@ -29,7 +29,12 @@ CodeMirror.registerHelper("lint", "html", function(text, options) { var found = []; - if (!window.HTMLHint) return found; + if (!window.HTMLHint) { + if (window.console) { + window.console.error("Error: window.HTMLHint not defined, CodeMirror HTML linting cannot run."); + } + return found; + } var messages = HTMLHint.verify(text, options && options.rules || defaultRules); for (var i = 0; i < messages.length; i++) { var message = messages[i]; diff --git a/addon/lint/javascript-lint.js b/addon/lint/javascript-lint.js index d4f2ae9a1faac1925f9efc5fad34d61c20ea2e53..c58f785025872cdc568c0c2b7704abf24df152f2 100644 --- a/addon/lint/javascript-lint.js +++ b/addon/lint/javascript-lint.js @@ -22,7 +22,12 @@ "Unclosed string", "Stopping, unable to continue" ]; function validator(text, options) { - if (!window.JSHINT) return []; + if (!window.JSHINT) { + if (window.console) { + window.console.error("Error: window.JSHINT not defined, CodeMirror JavaScript linting cannot run."); + } + return []; + } JSHINT(text, options, options.globals); var errors = JSHINT.data().errors, result = []; if (errors) parseErrors(errors, result); diff --git a/addon/lint/json-lint.js b/addon/lint/json-lint.js index 9dbb616b3b440ef1bc9f8193e2dd7f4801845e2e..849641ee5e1c9f50d64373386815e59d6b2d429d 100644 --- a/addon/lint/json-lint.js +++ b/addon/lint/json-lint.js @@ -17,6 +17,12 @@ CodeMirror.registerHelper("lint", "json", function(text) { var found = []; + if (!window.jsonlint) { + if (window.console) { + window.console.error("Error: window.jsonlint not defined, CodeMirror JSON linting cannot run."); + } + return found; + } jsonlint.parseError = function(str, hash) { var loc = hash.loc; found.push({from: CodeMirror.Pos(loc.first_line - 1, loc.first_column), diff --git a/addon/lint/yaml-lint.js b/addon/lint/yaml-lint.js index 90b0eaab5796402a9103f199732b4c6963d9685e..3954ed38ebf4267658c135aa679336feee303c90 100644 --- a/addon/lint/yaml-lint.js +++ b/addon/lint/yaml-lint.js @@ -17,6 +17,12 @@ CodeMirror.registerHelper("lint", "yaml", function(text) { var found = []; + if (!window.jsyaml) { + if (window.console) { + window.console.error("Error: window.jsyaml not defined, CodeMirror YAML linting cannot run."); + } + return found; + } try { jsyaml.load(text); } catch(e) { var loc = e.mark,