npm-package-json-lint
Version:
Configurable linter for package.json files.
2 lines (1 loc) • 1.36 kB
JavaScript
var d=Object.create;var s=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var h=Object.getPrototypeOf,O=Object.prototype.hasOwnProperty;var P=(r,t)=>{for(var n in t)s(r,n,{get:t[n],enumerable:!0})},c=(r,t,n,e)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of u(t))!O.call(r,o)&&o!==n&&s(r,o,{get:()=>t[o],enumerable:!(e=b(t,o))||e.enumerable});return r};var l=(r,t,n)=>(n=r!=null?d(h(r)):{},c(t||!r||!r.__esModule?s(n,"default",{value:r,enumerable:!0}):n,r)),x=r=>c(s({},"__esModule",{value:!0}),r);var I={};P(I,{lint:()=>v,ruleType:()=>w});module.exports=x(I);var y=l(require("is-plain-obj"));var f=(r,t)=>r.hasOwnProperty(t)?(0,y.default)(r[t]):!0,p=(r,t)=>r.hasOwnProperty(t)?typeof r[t]=="string":!0;var i=l(require("chalk")),g=l(require("log-symbols"));var a=class{constructor(t,n,e,o){this.lintId=t,this.severity=n,this.node=e,this.lintMessage=o}toString(){let t=this.severity==="error"?g.default.error:g.default.warning,n=i.default.cyan.bold(this.lintId),e=i.default.magenta.bold(this.node),o=this.severity==="error"?i.default.red.bold(this.lintMessage):i.default.yellow(this.lintMessage);return`${t} ${n} - node: ${e} - ${o}`}};var S="bin-type",m="bin",j="Type should be either a string or an Object",w="standard",v=(r,t)=>!p(r,m)&&!f(r,m)?new a(S,t,m,j):null;0&&(module.exports={lint,ruleType});