Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eslint-release

Package Overview
Dependencies
Maintainers
1
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-release - npm Package Compare versions

Comparing version 0.3.0-alpha.2 to 0.3.0-beta.0

101

lib/release-ops.js

@@ -18,3 +18,3 @@ /**

semver = require("semver"),
checker = require("npm-license"),
// checker = require("npm-license"),
dateformat = require("dateformat"),

@@ -27,5 +27,5 @@ ShellOps = require("./shell-ops");

var OPEN_SOURCE_LICENSES = [
/MIT/, /BSD/, /Apache/, /ISC/, /WTF/, /Public Domain/
];
// var OPEN_SOURCE_LICENSES = [
// /MIT/, /BSD/, /Apache/, /ISC/, /WTF/, /Public Domain/
// ];

@@ -95,2 +95,3 @@ /**

// TODO: Make this async
/**

@@ -101,52 +102,52 @@ * Validates the licenses of all dependencies are valid open source licenses.

*/
function checkLicenses() {
// function checkLicenses() {
/**
* Check if a dependency is eligible to be used by us
* @param {object} dependency dependency to check
* @returns {boolean} true if we have permission
* @private
*/
function isPermissible(dependency) {
var licenses = dependency.licenses;
// /**
// * Check if a dependency is eligible to be used by us
// * @param {object} dependency dependency to check
// * @returns {boolean} true if we have permission
// * @private
// */
// function isPermissible(dependency) {
// var licenses = dependency.licenses;
if (Array.isArray(licenses)) {
return licenses.some(function(license) {
return isPermissible({
name: dependency.name,
licenses: license
});
});
}
// if (Array.isArray(licenses)) {
// return licenses.some(function(license) {
// return isPermissible({
// name: dependency.name,
// licenses: license
// });
// });
// }
return OPEN_SOURCE_LICENSES.some(function(license) {
return license.test(licenses);
});
}
// return OPEN_SOURCE_LICENSES.some(function(license) {
// return license.test(licenses);
// });
// }
console.log("Validating licenses");
// console.log("Validating licenses");
checker.init({
start: process.cwd()
}, function(deps) {
var impermissible = Object.keys(deps).map(function(dependency) {
return {
name: dependency,
licenses: deps[dependency].licenses
};
}).filter(function(dependency) {
return !isPermissible(dependency);
});
// checker.init({
// start: process.cwd()
// }, function(deps) {
// var impermissible = Object.keys(deps).map(function(dependency) {
// return {
// name: dependency,
// licenses: deps[dependency].licenses
// };
// }).filter(function(dependency) {
// return !isPermissible(dependency);
// });
if (impermissible.length) {
impermissible.forEach(function(dependency) {
console.error("%s license for %s is impermissible.",
dependency.licenses,
dependency.name
);
});
ShellOps.exit(1);
}
});
}
// if (impermissible.length) {
// impermissible.forEach(function(dependency) {
// console.error("%s license for %s is impermissible.",
// dependency.licenses,
// dependency.name
// );
// });
// ShellOps.exit(1);
// }
// });
// }

@@ -266,4 +267,4 @@ /**

console.log("Checking licenses");
checkLicenses();
// console.log("Checking licenses");
// checkLicenses();

@@ -270,0 +271,0 @@ console.log("Running tests");

{
"name": "eslint-release",
"version": "0.3.0-alpha.2",
"version": "0.3.0-beta.0",
"description": "ESLint Release Tools",

@@ -5,0 +5,0 @@ "main": "./lib/release-ops",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc