lint-filter
Version:
Lint touched code stricter
23 lines (18 loc) • 720 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getRulesFromCheckstyle = getRulesFromCheckstyle;
exports.setErrorToWarning = setErrorToWarning;
var _lodash = require('lodash');
var _lodash2 = _interopRequireDefault(_lodash);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function getRulesFromCheckstyle(checkstyle) {
return _lodash2.default.uniq(_lodash2.default.map(checkstyle, function (error) {
var parts = error.source.split('.');
return parts[parts.length - 1];
}));
}
function setErrorToWarning(item) {
return _lodash2.default.assign({}, item, item.severity === 'error' ? { severity: 'warning' } : null);
}