diff --git a/src/extensions/default/JSLint/main.js b/src/extensions/default/JSLint/main.js index 4fbeb8e7361..90c4f24c3cd 100644 --- a/src/extensions/default/JSLint/main.js +++ b/src/extensions/default/JSLint/main.js @@ -60,6 +60,14 @@ define(function (require, exports, module) { // Predefined environments understood by JSLint. var ENVIRONMENTS = ["browser", "node", "couch", "rhino"]; + // gets indentation size depending whether the tabs or spaces are used + function _getIndentSize(fullPath) { + return PreferencesManager.get( + PreferencesManager.get("useTabChar", fullPath) ? "tabSize" : "spaceUnits", + fullPath + ); + } + /** * Run JSLint on the current document. Reports results to the main UI. Displays * a gold star when no errors are found. @@ -88,7 +96,7 @@ define(function (require, exports, module) { if (!options.indent) { // default to using the same indentation value that the editor is using - options.indent = PreferencesManager.get("spaceUnits"); + options.indent = _getIndentSize(fullPath); } // If the user has not defined the environment, we use browser by default.