| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | 1× 1× 1× 1× 1× 1× 1× 2× 1× 1× 1× 1× | 'use strict';
const LintIssue = require('./../LintIssue');
const isString = require('./../validators/type').isString;
const lintId = 'name-type';
const nodeName = 'name';
const message = 'Type should be a string';
const ruleType = 'type';
const lint = function(packageJsonData, lintType) {
if (!isString(packageJsonData, nodeName)) {
return new LintIssue(lintId, lintType, nodeName, message);
}
return true;
};
module.exports.lint = lint;
module.exports.ruleType = ruleType;
|