MCPcopy
hub / github.com/csscomb/csscomb.js / lintString

Method lintString

src/core.js:120–130  ·  view source on GitHub ↗

* Lints a string. * * @param {String} text * @param {{context: String, filename: String, syntax: String}} options * @returns {Promise} Resolves with list of found errors.

(text, options)

Source from the content-addressed store, hash-verified

118 * @returns {Promise} Resolves with <Array> list of found errors.
119 */
120 lintString(text, options) {
121 return this._parseString(text, options)
122 .then(this._lintTree.bind(this))
123 .then(errors => {
124 errors.forEach(error => {
125 error.context = this._getContext(text, error.line);
126 });
127
128 return errors;
129 });
130 }
131
132 _getContext(text, currentLineNumber) {
133 var LINES_AROUND = 2;

Callers 3

lintFileMethod · 0.95
getErrorsMethod · 0.80
getErrorsMethod · 0.80

Calls 2

_parseStringMethod · 0.95
_getContextMethod · 0.95

Tested by

no test coverage detected