src/jshint-solid.js
function settingsPercentage(projectJshintSettings) {
  verify.object(projectJshintSettings, 'expected jshint object');

  //console.log('looking at jshint settings\n' +
  //  JSON.stringify(projectJshintSettings, null, 2));

  var allSettings = getAllSettings();
  verify.object(allSettings, 'could not get all jshint settings');
  var totalSettings = Object.keys(allSettings).length;
  verify.positiveNumber(totalSettings, 'epected all settings to have properties');

  Object.keys(projectJshintSettings).forEach(function (key) {
    if (key === 'predef') { return; }

    if (typeof allSettings[key] === 'undefined') {
      console.error('unknown setting', key, projectJshintSettings[key]);
    }
  });

  var specifiedSettings = Object.keys(projectJshintSettings).length;

  return +(specifiedSettings / totalSettings * 100).toPrecision(2);
}
function settingsPercentage(projectJshintSettings) {
  verify.object(projectJshintSettings, 'expected jshint object');

  //console.log('looking at jshint settings\n' +
  //  JSON.stringify(projectJshintSettings, null, 2));

  var allSettings = getAllSettings();
  verify.object(allSettings, 'could not get all jshint settings');
  var totalSettings = Object.keys(allSettings).length;
  verify.positiveNumber(totalSettings, 'epected all settings to have properties');

  Object.keys(projectJshintSettings).forEach(function (key) {
    if (key === 'predef') { return; }

    if (typeof allSettings[key] === 'undefined') {
      console.error('unknown setting', key, projectJshintSettings[key]);
    }
  });

  var specifiedSettings = Object.keys(projectJshintSettings).length;

  return +(specifiedSettings / totalSettings * 100).toPrecision(2);
}
function settingsPercentage ( projectJshintSettings ) { verify . object ( projectJshintSettings , 'expected jshint object' ) ; //console.log('looking at jshint settings\n' + //  JSON.stringify(projectJshintSettings, null, 2)); var allSettings = getAllSettings ( ) ; verify . object ( allSettings , 'could not get all jshint settings' ) ; var totalSettings = Object . keys ( allSettings ) . length ; verify . positiveNumber ( totalSettings , 'epected all settings to have properties' ) ; Object . keys ( projectJshintSettings ) . forEach ( function ( key ) { if ( key === 'predef' ) { return ; } if ( typeof allSettings [ key ] === 'undefined' ) { console . error ( 'unknown setting' , key , projectJshintSettings [ key ] ) ; } } ) ; var specifiedSettings = Object . keys ( projectJshintSettings ) . length ; return + ( specifiedSettings / totalSettings * 100 ) . toPrecision ( 2 ) ; }
returns percent 0 - no valid settings, 100 - all settings specified
returns percent 0 - no valid settings 100 - all settings specified