From 7be078eb50fc3c01abe30068bae1de60a6f987b4 Mon Sep 17 00:00:00 2001 From: J M Rossy Date: Mon, 30 May 2022 17:17:52 -0400 Subject: [PATCH] [Chore] Setup eslint for typescript assets (#505) - Setup shared eslint config for whole monorepo - Create lint-ts job for linting typescript files - Run lint-ts in CI --- typescript/sdk/.eslintignore => .eslintignore | 0 .eslintrc | 33 ++ .github/workflows/node.yml | 3 + .yarn/plugins/@yarnpkg/plugin-outdated.cjs | 33 ++ .yarnrc.yml | 2 + package.json | 15 +- solidity/app/.eslintrc.json | 15 - solidity/app/test/router.test.ts | 1 + solidity/app/tsconfig.json | 13 +- solidity/core/.eslintrc.json | 15 - solidity/core/package.json | 1 - solidity/core/test/.eslintrc | 6 + solidity/core/test/inbox.test.ts | 7 +- solidity/core/test/lib/upgrade.ts | 6 +- solidity/core/test/merkle.test.ts | 6 +- solidity/core/test/outbox.test.ts | 4 +- .../multisigValidatorManager.test.ts | 4 +- solidity/core/tsconfig.json | 13 +- solidity/tsconfig.json | 3 + tsconfig.package.json => tsconfig.json | 0 typescript/deploy/.eslintrc | 5 + typescript/deploy/src/deploy.ts | 4 +- typescript/deploy/tsconfig.json | 2 +- typescript/hardhat/src/TestCoreApp.ts | 6 +- typescript/hardhat/tsconfig.json | 7 +- typescript/infra/.eslintrc | 5 + typescript/infra/scripts/get-key-addresses.ts | 4 +- typescript/infra/src/agents/aws/key.ts | 12 +- typescript/infra/src/agents/gcp.ts | 1 + typescript/infra/src/agents/index.ts | 2 +- typescript/infra/src/utils/gcloud.ts | 5 +- typescript/infra/src/utils/utils.ts | 4 +- typescript/infra/tsconfig.json | 2 +- typescript/sdk/.eslintrc.json | 20 - typescript/sdk/package.json | 3 - typescript/sdk/src/.eslintrc | 5 + typescript/sdk/src/app.ts | 2 +- typescript/sdk/src/chains.ts | 1 + typescript/sdk/src/contracts.ts | 4 +- typescript/sdk/src/core/app.ts | 6 +- typescript/sdk/src/core/contracts.ts | 12 +- typescript/sdk/src/core/message.ts | 4 +- typescript/sdk/src/gas/calculator.ts | 4 +- typescript/sdk/src/gas/token-prices.ts | 1 + typescript/sdk/src/gas/utils.ts | 7 +- typescript/sdk/src/provider.ts | 7 +- typescript/sdk/src/utils.ts | 3 +- typescript/sdk/tsconfig.json | 7 +- typescript/tsconfig.json | 3 + typescript/utils/src/utils.ts | 2 +- typescript/utils/src/validator.ts | 6 +- typescript/utils/tsconfig.json | 7 +- yarn.lock | 491 +++++++++--------- 53 files changed, 430 insertions(+), 404 deletions(-) rename typescript/sdk/.eslintignore => .eslintignore (100%) create mode 100644 .eslintrc create mode 100644 .yarn/plugins/@yarnpkg/plugin-outdated.cjs delete mode 100644 solidity/app/.eslintrc.json delete mode 100644 solidity/core/.eslintrc.json create mode 100644 solidity/core/test/.eslintrc create mode 100644 solidity/tsconfig.json rename tsconfig.package.json => tsconfig.json (100%) create mode 100644 typescript/deploy/.eslintrc create mode 100644 typescript/infra/.eslintrc delete mode 100644 typescript/sdk/.eslintrc.json create mode 100644 typescript/sdk/src/.eslintrc create mode 100644 typescript/tsconfig.json diff --git a/typescript/sdk/.eslintignore b/.eslintignore similarity index 100% rename from typescript/sdk/.eslintignore rename to .eslintignore diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 000000000..9796ac511 --- /dev/null +++ b/.eslintrc @@ -0,0 +1,33 @@ +{ + "env": { + "node": true, + "browser": true, + "es2021": true + }, + "root": true, + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaVersion": 12, + "sourceType": "module", + "project": "./tsconfig.json" + }, + "plugins": ["@typescript-eslint"], + "extends": [ + "eslint:recommended", + "plugin:@typescript-eslint/recommended", + "prettier" + ], + "rules": { + "no-console": ["error"], + "no-eval": ["error"], + "no-extra-boolean-cast": ["error"], + "no-ex-assign": ["error"], + "no-constant-condition": ["off"], + "@typescript-eslint/ban-ts-comment": ["off"], + "@typescript-eslint/explicit-module-boundary-types": ["off"], + "@typescript-eslint/no-explicit-any": ["off"], + "@typescript-eslint/no-floating-promises": ["error"], + "@typescript-eslint/no-non-null-assertion": ["off"], + "@typescript-eslint/no-require-imports": ["warn"], + } +} diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index cc397ea17..e8b2f4c4d 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -64,6 +64,9 @@ jobs: path: '**/node_modules' key: ${{ runner.os }}-yarn-cache4-${{ hashFiles('./yarn.lock') }} + - name: lint-ts + run: yarn lint-ts + - name: prettier run: | yarn prettier diff --git a/.yarn/plugins/@yarnpkg/plugin-outdated.cjs b/.yarn/plugins/@yarnpkg/plugin-outdated.cjs new file mode 100644 index 000000000..33213dbc0 --- /dev/null +++ b/.yarn/plugins/@yarnpkg/plugin-outdated.cjs @@ -0,0 +1,33 @@ +/* eslint-disable */ +//prettier-ignore +module.exports = { +name: "@yarnpkg/plugin-outdated", +factory: function (require) { +var plugin=(()=>{var _r=Object.create,ye=Object.defineProperty,xr=Object.defineProperties,br=Object.getOwnPropertyDescriptor,Sr=Object.getOwnPropertyDescriptors,vr=Object.getOwnPropertyNames,tt=Object.getOwnPropertySymbols,Hr=Object.getPrototypeOf,rt=Object.prototype.hasOwnProperty,wr=Object.prototype.propertyIsEnumerable;var nt=(e,t,r)=>t in e?ye(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,w=(e,t)=>{for(var r in t||(t={}))rt.call(t,r)&&nt(e,r,t[r]);if(tt)for(var r of tt(t))wr.call(t,r)&&nt(e,r,t[r]);return e},B=(e,t)=>xr(e,Sr(t)),Tr=e=>ye(e,"__esModule",{value:!0});var W=e=>{if(typeof require!="undefined")return require(e);throw new Error('Dynamic require of "'+e+'" is not supported')};var G=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),$r=(e,t)=>{for(var r in t)ye(e,r,{get:t[r],enumerable:!0})},Lr=(e,t,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of vr(t))!rt.call(e,n)&&n!=="default"&&ye(e,n,{get:()=>t[n],enumerable:!(r=br(t,n))||r.enumerable});return e},J=e=>Lr(Tr(ye(e!=null?_r(Hr(e)):{},"default",e&&e.__esModule&&"default"in e?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e);var He=G(Y=>{"use strict";Y.isInteger=e=>typeof e=="number"?Number.isInteger(e):typeof e=="string"&&e.trim()!==""?Number.isInteger(Number(e)):!1;Y.find=(e,t)=>e.nodes.find(r=>r.type===t);Y.exceedsLimit=(e,t,r=1,n)=>n===!1||!Y.isInteger(e)||!Y.isInteger(t)?!1:(Number(t)-Number(e))/Number(r)>=n;Y.escapeNode=(e,t=0,r)=>{let n=e.nodes[t];!n||(r&&n.type===r||n.type==="open"||n.type==="close")&&n.escaped!==!0&&(n.value="\\"+n.value,n.escaped=!0)};Y.encloseBrace=e=>e.type!=="brace"?!1:e.commas>>0+e.ranges>>0==0?(e.invalid=!0,!0):!1;Y.isInvalidBrace=e=>e.type!=="brace"?!1:e.invalid===!0||e.dollar?!0:e.commas>>0+e.ranges>>0==0||e.open!==!0||e.close!==!0?(e.invalid=!0,!0):!1;Y.isOpenOrClose=e=>e.type==="open"||e.type==="close"?!0:e.open===!0||e.close===!0;Y.reduce=e=>e.reduce((t,r)=>(r.type==="text"&&t.push(r.value),r.type==="range"&&(r.type="text"),t),[]);Y.flatten=(...e)=>{let t=[],r=n=>{for(let s=0;s{"use strict";var st=He();at.exports=(e,t={})=>{let r=(n,s={})=>{let a=t.escapeInvalid&&st.isInvalidBrace(s),i=n.invalid===!0&&t.escapeInvalid===!0,o="";if(n.value)return(a||i)&&st.isOpenOrClose(n)?"\\"+n.value:n.value;if(n.value)return n.value;if(n.nodes)for(let h of n.nodes)o+=r(h);return o};return r(e)}});var ot=G((ts,it)=>{"use strict";it.exports=function(e){return typeof e=="number"?e-e==0:typeof e=="string"&&e.trim()!==""?Number.isFinite?Number.isFinite(+e):isFinite(+e):!1}});var yt=G((rs,dt)=>{"use strict";var ut=ot(),ce=(e,t,r)=>{if(ut(e)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(t===void 0||e===t)return String(e);if(ut(t)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let n=w({relaxZeros:!0},r);typeof n.strictZeros=="boolean"&&(n.relaxZeros=n.strictZeros===!1);let s=String(n.relaxZeros),a=String(n.shorthand),i=String(n.capture),o=String(n.wrap),h=e+":"+t+"="+s+a+i+o;if(ce.cache.hasOwnProperty(h))return ce.cache[h].result;let d=Math.min(e,t),f=Math.max(e,t);if(Math.abs(d-f)===1){let A=e+"|"+t;return n.capture?`(${A})`:n.wrap===!1?A:`(?:${A})`}let R=gt(e)||gt(t),p={min:e,max:t,a:d,b:f},v=[],m=[];if(R&&(p.isPadded=R,p.maxLen=String(p.max).length),d<0){let A=f<0?Math.abs(f):1;m=ct(A,Math.abs(d),p,n),d=p.a=0}return f>=0&&(v=ct(d,f,p,n)),p.negatives=m,p.positives=v,p.result=Or(m,v,n),n.capture===!0?p.result=`(${p.result})`:n.wrap!==!1&&v.length+m.length>1&&(p.result=`(?:${p.result})`),ce.cache[h]=p,p.result};function Or(e,t,r){let n=Ie(e,t,"-",!1,r)||[],s=Ie(t,e,"",!1,r)||[],a=Ie(e,t,"-?",!0,r)||[];return n.concat(a).concat(s).join("|")}function kr(e,t){let r=1,n=1,s=pt(e,r),a=new Set([t]);for(;e<=s&&s<=t;)a.add(s),r+=1,s=pt(e,r);for(s=ft(t+1,n)-1;e1&&o.count.pop(),o.count.push(f.count[0]),o.string=o.pattern+ht(o.count),i=d+1;continue}r.isPadded&&(R=Mr(d,r,n)),f.string=R+f.pattern+ht(f.count),a.push(f),i=d+1,o=f}return a}function Ie(e,t,r,n,s){let a=[];for(let i of e){let{string:o}=i;!n&&!lt(t,"string",o)&&a.push(r+o),n&<(t,"string",o)&&a.push(r+o)}return a}function Ir(e,t){let r=[];for(let n=0;nt?1:t>e?-1:0}function lt(e,t,r){return e.some(n=>n[t]===r)}function pt(e,t){return Number(String(e).slice(0,-t)+"9".repeat(t))}function ft(e,t){return e-e%Math.pow(10,t)}function ht(e){let[t=0,r=""]=e;return r||t>1?`{${t+(r?","+r:"")}}`:""}function Pr(e,t,r){return`[${e}${t-e==1?"":"-"}${t}]`}function gt(e){return/^-?(0+)\d/.test(e)}function Mr(e,t,r){if(!t.isPadded)return e;let n=Math.abs(t.maxLen-String(e).length),s=r.relaxZeros!==!1;switch(n){case 0:return"";case 1:return s?"0?":"0";case 2:return s?"0{0,2}":"00";default:return s?`0{0,${n}}`:`0{${n}}`}}ce.cache={};ce.clearCache=()=>ce.cache={};dt.exports=ce});var Me=G((ns,bt)=>{"use strict";var Br=W("util"),Rt=yt(),At=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),Ur=e=>t=>e===!0?Number(t):String(t),De=e=>typeof e=="number"||typeof e=="string"&&e!=="",Re=e=>Number.isInteger(+e),Pe=e=>{let t=`${e}`,r=-1;if(t[0]==="-"&&(t=t.slice(1)),t==="0")return!1;for(;t[++r]==="0";);return r>0},Gr=(e,t,r)=>typeof e=="string"||typeof t=="string"?!0:r.stringify===!0,Fr=(e,t,r)=>{if(t>0){let n=e[0]==="-"?"-":"";n&&(e=e.slice(1)),e=n+e.padStart(n?t-1:t,"0")}return r===!1?String(e):e},mt=(e,t)=>{let r=e[0]==="-"?"-":"";for(r&&(e=e.slice(1),t--);e.length{e.negatives.sort((i,o)=>io?1:0),e.positives.sort((i,o)=>io?1:0);let r=t.capture?"":"?:",n="",s="",a;return e.positives.length&&(n=e.positives.join("|")),e.negatives.length&&(s=`-(${r}${e.negatives.join("|")})`),n&&s?a=`${n}|${s}`:a=n||s,t.wrap?`(${r}${a})`:a},Ct=(e,t,r,n)=>{if(r)return Rt(e,t,w({wrap:!1},n));let s=String.fromCharCode(e);if(e===t)return s;let a=String.fromCharCode(t);return`[${s}-${a}]`},Et=(e,t,r)=>{if(Array.isArray(e)){let n=r.wrap===!0,s=r.capture?"":"?:";return n?`(${s}${e.join("|")})`:e.join("|")}return Rt(e,t,r)},_t=(...e)=>new RangeError("Invalid range arguments: "+Br.inspect(...e)),xt=(e,t,r)=>{if(r.strictRanges===!0)throw _t([e,t]);return[]},Kr=(e,t)=>{if(t.strictRanges===!0)throw new TypeError(`Expected step "${e}" to be a number`);return[]},qr=(e,t,r=1,n={})=>{let s=Number(e),a=Number(t);if(!Number.isInteger(s)||!Number.isInteger(a)){if(n.strictRanges===!0)throw _t([e,t]);return[]}s===0&&(s=0),a===0&&(a=0);let i=s>a,o=String(e),h=String(t),d=String(r);r=Math.max(Math.abs(r),1);let f=Pe(o)||Pe(h)||Pe(d),R=f?Math.max(o.length,h.length,d.length):0,p=f===!1&&Gr(e,t,n)===!1,v=n.transform||Ur(p);if(n.toRegex&&r===1)return Ct(mt(e,R),mt(t,R),!0,n);let m={negatives:[],positives:[]},A=k=>m[k<0?"negatives":"positives"].push(Math.abs(k)),E=[],b=0;for(;i?s>=a:s<=a;)n.toRegex===!0&&r>1?A(s):E.push(Fr(v(s,b),R,p)),s=i?s-r:s+r,b++;return n.toRegex===!0?r>1?jr(m,n):Et(E,null,w({wrap:!1},n)):E},Wr=(e,t,r=1,n={})=>{if(!Re(e)&&e.length>1||!Re(t)&&t.length>1)return xt(e,t,n);let s=n.transform||(p=>String.fromCharCode(p)),a=`${e}`.charCodeAt(0),i=`${t}`.charCodeAt(0),o=a>i,h=Math.min(a,i),d=Math.max(a,i);if(n.toRegex&&r===1)return Ct(h,d,!1,n);let f=[],R=0;for(;o?a>=i:a<=i;)f.push(s(a,R)),a=o?a-r:a+r,R++;return n.toRegex===!0?Et(f,null,{wrap:!1,options:n}):f},Te=(e,t,r,n={})=>{if(t==null&&De(e))return[e];if(!De(e)||!De(t))return xt(e,t,n);if(typeof r=="function")return Te(e,t,1,{transform:r});if(At(r))return Te(e,t,0,r);let s=w({},n);return s.capture===!0&&(s.wrap=!0),r=r||s.step||1,Re(r)?Re(e)&&Re(t)?qr(e,t,r,s):Wr(e,t,Math.max(Math.abs(r),1),s):r!=null&&!At(r)?Kr(r,s):Te(e,t,1,r)};bt.exports=Te});var Ht=G((ss,vt)=>{"use strict";var Qr=Me(),St=He(),Xr=(e,t={})=>{let r=(n,s={})=>{let a=St.isInvalidBrace(s),i=n.invalid===!0&&t.escapeInvalid===!0,o=a===!0||i===!0,h=t.escapeInvalid===!0?"\\":"",d="";if(n.isOpen===!0||n.isClose===!0)return h+n.value;if(n.type==="open")return o?h+n.value:"(";if(n.type==="close")return o?h+n.value:")";if(n.type==="comma")return n.prev.type==="comma"?"":o?n.value:"|";if(n.value)return n.value;if(n.nodes&&n.ranges>0){let f=St.reduce(n.nodes),R=Qr(...f,B(w({},t),{wrap:!1,toRegex:!0}));if(R.length!==0)return f.length>1&&R.length>1?`(${R})`:R}if(n.nodes)for(let f of n.nodes)d+=r(f,n);return d};return r(e)};vt.exports=Xr});var $t=G((as,Tt)=>{"use strict";var zr=Me(),wt=we(),pe=He(),le=(e="",t="",r=!1)=>{let n=[];if(e=[].concat(e),t=[].concat(t),!t.length)return e;if(!e.length)return r?pe.flatten(t).map(s=>`{${s}}`):t;for(let s of e)if(Array.isArray(s))for(let a of s)n.push(le(a,t,r));else for(let a of t)r===!0&&typeof a=="string"&&(a=`{${a}}`),n.push(Array.isArray(a)?le(s,a,r):s+a);return pe.flatten(n)},Zr=(e,t={})=>{let r=t.rangeLimit===void 0?1e3:t.rangeLimit,n=(s,a={})=>{s.queue=[];let i=a,o=a.queue;for(;i.type!=="brace"&&i.type!=="root"&&i.parent;)i=i.parent,o=i.queue;if(s.invalid||s.dollar){o.push(le(o.pop(),wt(s,t)));return}if(s.type==="brace"&&s.invalid!==!0&&s.nodes.length===2){o.push(le(o.pop(),["{}"]));return}if(s.nodes&&s.ranges>0){let R=pe.reduce(s.nodes);if(pe.exceedsLimit(...R,t.step,r))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let p=zr(...R,t);p.length===0&&(p=wt(s,t)),o.push(le(o.pop(),p)),s.nodes=[];return}let h=pe.encloseBrace(s),d=s.queue,f=s;for(;f.type!=="brace"&&f.type!=="root"&&f.parent;)f=f.parent,d=f.queue;for(let R=0;R{"use strict";Lt.exports={MAX_LENGTH:1024*64,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:` +`,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var Pt=G((os,Dt)=>{"use strict";var Vr=we(),{MAX_LENGTH:kt,CHAR_BACKSLASH:Be,CHAR_BACKTICK:Yr,CHAR_COMMA:Jr,CHAR_DOT:en,CHAR_LEFT_PARENTHESES:tn,CHAR_RIGHT_PARENTHESES:rn,CHAR_LEFT_CURLY_BRACE:nn,CHAR_RIGHT_CURLY_BRACE:sn,CHAR_LEFT_SQUARE_BRACKET:Nt,CHAR_RIGHT_SQUARE_BRACKET:It,CHAR_DOUBLE_QUOTE:an,CHAR_SINGLE_QUOTE:on,CHAR_NO_BREAK_SPACE:un,CHAR_ZERO_WIDTH_NOBREAK_SPACE:cn}=Ot(),ln=(e,t={})=>{if(typeof e!="string")throw new TypeError("Expected a string");let r=t||{},n=typeof r.maxLength=="number"?Math.min(kt,r.maxLength):kt;if(e.length>n)throw new SyntaxError(`Input length (${e.length}), exceeds max characters (${n})`);let s={type:"root",input:e,nodes:[]},a=[s],i=s,o=s,h=0,d=e.length,f=0,R=0,p,v={},m=()=>e[f++],A=E=>{if(E.type==="text"&&o.type==="dot"&&(o.type="text"),o&&o.type==="text"&&E.type==="text"){o.value+=E.value;return}return i.nodes.push(E),E.parent=i,E.prev=o,o=E,E};for(A({type:"bos"});f0){if(i.ranges>0){i.ranges=0;let E=i.nodes.shift();i.nodes=[E,{type:"text",value:Vr(i)}]}A({type:"comma",value:p}),i.commas++;continue}if(p===en&&R>0&&i.commas===0){let E=i.nodes;if(R===0||E.length===0){A({type:"text",value:p});continue}if(o.type==="dot"){if(i.range=[],o.value+=p,o.type="range",i.nodes.length!==3&&i.nodes.length!==5){i.invalid=!0,i.ranges=0,o.type="text";continue}i.ranges++,i.args=[];continue}if(o.type==="range"){E.pop();let b=E[E.length-1];b.value+=o.value+p,o=b,i.ranges--;continue}A({type:"dot",value:p});continue}A({type:"text",value:p})}do if(i=a.pop(),i.type!=="root"){i.nodes.forEach(k=>{k.nodes||(k.type==="open"&&(k.isOpen=!0),k.type==="close"&&(k.isClose=!0),k.nodes||(k.type="text"),k.invalid=!0)});let E=a[a.length-1],b=E.nodes.indexOf(i);E.nodes.splice(b,1,...i.nodes)}while(a.length>0);return A({type:"eos"}),s};Dt.exports=ln});var Ut=G((us,Bt)=>{"use strict";var Mt=we(),pn=Ht(),fn=$t(),hn=Pt(),z=(e,t={})=>{let r=[];if(Array.isArray(e))for(let n of e){let s=z.create(n,t);Array.isArray(s)?r.push(...s):r.push(s)}else r=[].concat(z.create(e,t));return t&&t.expand===!0&&t.nodupes===!0&&(r=[...new Set(r)]),r};z.parse=(e,t={})=>hn(e,t);z.stringify=(e,t={})=>typeof e=="string"?Mt(z.parse(e,t),t):Mt(e,t);z.compile=(e,t={})=>(typeof e=="string"&&(e=z.parse(e,t)),pn(e,t));z.expand=(e,t={})=>{typeof e=="string"&&(e=z.parse(e,t));let r=fn(e,t);return t.noempty===!0&&(r=r.filter(Boolean)),t.nodupes===!0&&(r=[...new Set(r)]),r};z.create=(e,t={})=>e===""||e.length<3?[e]:t.expand!==!0?z.compile(e,t):z.expand(e,t);Bt.exports=z});var Ae=G((cs,qt)=>{"use strict";var gn=W("path"),ne="\\\\/",Gt=`[^${ne}]`,ae="\\.",dn="\\+",yn="\\?",$e="\\/",Rn="(?=.)",Ft="[^/]",Ue=`(?:${$e}|$)`,jt=`(?:^|${$e})`,Ge=`${ae}{1,2}${Ue}`,An=`(?!${ae})`,mn=`(?!${jt}${Ge})`,Cn=`(?!${ae}{0,1}${Ue})`,En=`(?!${Ge})`,_n=`[^.${$e}]`,xn=`${Ft}*?`,Kt={DOT_LITERAL:ae,PLUS_LITERAL:dn,QMARK_LITERAL:yn,SLASH_LITERAL:$e,ONE_CHAR:Rn,QMARK:Ft,END_ANCHOR:Ue,DOTS_SLASH:Ge,NO_DOT:An,NO_DOTS:mn,NO_DOT_SLASH:Cn,NO_DOTS_SLASH:En,QMARK_NO_DOT:_n,STAR:xn,START_ANCHOR:jt},bn=B(w({},Kt),{SLASH_LITERAL:`[${ne}]`,QMARK:Gt,STAR:`${Gt}*?`,DOTS_SLASH:`${ae}{1,2}(?:[${ne}]|$)`,NO_DOT:`(?!${ae})`,NO_DOTS:`(?!(?:^|[${ne}])${ae}{1,2}(?:[${ne}]|$))`,NO_DOT_SLASH:`(?!${ae}{0,1}(?:[${ne}]|$))`,NO_DOTS_SLASH:`(?!${ae}{1,2}(?:[${ne}]|$))`,QMARK_NO_DOT:`[^.${ne}]`,START_ANCHOR:`(?:^|[${ne}])`,END_ANCHOR:`(?:[${ne}]|$)`}),Sn={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};qt.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:Sn,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:gn.sep,extglobChars(e){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(e){return e===!0?bn:Kt}}});var me=G(Q=>{"use strict";var vn=W("path"),Hn=process.platform==="win32",{REGEX_BACKSLASH:wn,REGEX_REMOVE_BACKSLASH:Tn,REGEX_SPECIAL_CHARS:$n,REGEX_SPECIAL_CHARS_GLOBAL:Ln}=Ae();Q.isObject=e=>e!==null&&typeof e=="object"&&!Array.isArray(e);Q.hasRegexChars=e=>$n.test(e);Q.isRegexChar=e=>e.length===1&&Q.hasRegexChars(e);Q.escapeRegex=e=>e.replace(Ln,"\\$1");Q.toPosixSlashes=e=>e.replace(wn,"/");Q.removeBackslashes=e=>e.replace(Tn,t=>t==="\\"?"":t);Q.supportsLookbehinds=()=>{let e=process.version.slice(1).split(".").map(Number);return e.length===3&&e[0]>=9||e[0]===8&&e[1]>=10};Q.isWindows=e=>e&&typeof e.windows=="boolean"?e.windows:Hn===!0||vn.sep==="\\";Q.escapeLast=(e,t,r)=>{let n=e.lastIndexOf(t,r);return n===-1?e:e[n-1]==="\\"?Q.escapeLast(e,t,n-1):`${e.slice(0,n)}\\${e.slice(n)}`};Q.removePrefix=(e,t={})=>{let r=e;return r.startsWith("./")&&(r=r.slice(2),t.prefix="./"),r};Q.wrapOutput=(e,t={},r={})=>{let n=r.contains?"":"^",s=r.contains?"":"$",a=`${n}(?:${e})${s}`;return t.negated===!0&&(a=`(?:^(?!${a}).*$)`),a}});var Jt=G((ps,Yt)=>{"use strict";var Wt=me(),{CHAR_ASTERISK:Fe,CHAR_AT:On,CHAR_BACKWARD_SLASH:Ce,CHAR_COMMA:kn,CHAR_DOT:je,CHAR_EXCLAMATION_MARK:Ke,CHAR_FORWARD_SLASH:Qt,CHAR_LEFT_CURLY_BRACE:qe,CHAR_LEFT_PARENTHESES:We,CHAR_LEFT_SQUARE_BRACKET:Nn,CHAR_PLUS:In,CHAR_QUESTION_MARK:Xt,CHAR_RIGHT_CURLY_BRACE:Dn,CHAR_RIGHT_PARENTHESES:zt,CHAR_RIGHT_SQUARE_BRACKET:Pn}=Ae(),Zt=e=>e===Qt||e===Ce,Vt=e=>{e.isPrefix!==!0&&(e.depth=e.isGlobstar?Infinity:1)},Mn=(e,t)=>{let r=t||{},n=e.length-1,s=r.parts===!0||r.scanToEnd===!0,a=[],i=[],o=[],h=e,d=-1,f=0,R=0,p=!1,v=!1,m=!1,A=!1,E=!1,b=!1,k=!1,N=!1,ee=!1,F=!1,ie=0,j,C,H={value:"",depth:0,isGlob:!1},U=()=>d>=n,l=()=>h.charCodeAt(d+1),L=()=>(j=C,h.charCodeAt(++d));for(;d0&&(oe=h.slice(0,f),h=h.slice(f),R-=f),T&&m===!0&&R>0?(T=h.slice(0,R),u=h.slice(R)):m===!0?(T="",u=h):T=h,T&&T!==""&&T!=="/"&&T!==h&&Zt(T.charCodeAt(T.length-1))&&(T=T.slice(0,-1)),r.unescape===!0&&(u&&(u=Wt.removeBackslashes(u)),T&&k===!0&&(T=Wt.removeBackslashes(T)));let c={prefix:oe,input:e,start:f,base:T,glob:u,isBrace:p,isBracket:v,isGlob:m,isExtglob:A,isGlobstar:E,negated:N,negatedExtglob:ee};if(r.tokens===!0&&(c.maxDepth=0,Zt(C)||i.push(H),c.tokens=i),r.parts===!0||r.tokens===!0){let K;for(let S=0;S{"use strict";var Le=Ae(),Z=me(),{MAX_LENGTH:Oe,POSIX_REGEX_SOURCE:Bn,REGEX_NON_SPECIAL_CHARS:Un,REGEX_SPECIAL_CHARS_BACKREF:Gn,REPLACEMENTS:er}=Le,Fn=(e,t)=>{if(typeof t.expandRange=="function")return t.expandRange(...e,t);e.sort();let r=`[${e.join("-")}]`;try{new RegExp(r)}catch(n){return e.map(s=>Z.escapeRegex(s)).join("..")}return r},fe=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,tr=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");e=er[e]||e;let r=w({},t),n=typeof r.maxLength=="number"?Math.min(Oe,r.maxLength):Oe,s=e.length;if(s>n)throw new SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${n}`);let a={type:"bos",value:"",output:r.prepend||""},i=[a],o=r.capture?"":"?:",h=Z.isWindows(t),d=Le.globChars(h),f=Le.extglobChars(d),{DOT_LITERAL:R,PLUS_LITERAL:p,SLASH_LITERAL:v,ONE_CHAR:m,DOTS_SLASH:A,NO_DOT:E,NO_DOT_SLASH:b,NO_DOTS_SLASH:k,QMARK:N,QMARK_NO_DOT:ee,STAR:F,START_ANCHOR:ie}=d,j=y=>`(${o}(?:(?!${ie}${y.dot?A:R}).)*?)`,C=r.dot?"":E,H=r.dot?N:ee,U=r.bash===!0?j(r):F;r.capture&&(U=`(${U})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let l={input:e,index:-1,start:0,dot:r.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:i};e=Z.removePrefix(e,l),s=e.length;let L=[],T=[],oe=[],u=a,c,K=()=>l.index===s-1,S=l.peek=(y=1)=>e[l.index+y],te=l.advance=()=>e[++l.index]||"",re=()=>e.slice(l.index+1),X=(y="",$=0)=>{l.consumed+=y,l.index+=$},xe=y=>{l.output+=y.output!=null?y.output:y.value,X(y.value)},Cr=()=>{let y=1;for(;S()==="!"&&(S(2)!=="("||S(3)==="?");)te(),l.start++,y++;return y%2==0?!1:(l.negated=!0,l.start++,!0)},be=y=>{l[y]++,oe.push(y)},ue=y=>{l[y]--,oe.pop()},x=y=>{if(u.type==="globstar"){let $=l.braces>0&&(y.type==="comma"||y.type==="brace"),g=y.extglob===!0||L.length&&(y.type==="pipe"||y.type==="paren");y.type!=="slash"&&y.type!=="paren"&&!$&&!g&&(l.output=l.output.slice(0,-u.output.length),u.type="star",u.value="*",u.output=U,l.output+=u.output)}if(L.length&&y.type!=="paren"&&(L[L.length-1].inner+=y.value),(y.value||y.output)&&xe(y),u&&u.type==="text"&&y.type==="text"){u.value+=y.value,u.output=(u.output||"")+y.value;return}y.prev=u,i.push(y),u=y},Se=(y,$)=>{let g=B(w({},f[$]),{conditions:1,inner:""});g.prev=u,g.parens=l.parens,g.output=l.output;let _=(r.capture?"(":"")+g.open;be("parens"),x({type:y,value:$,output:l.output?"":m}),x({type:"paren",extglob:!0,value:te(),output:_}),L.push(g)},Er=y=>{let $=y.close+(r.capture?")":""),g;if(y.type==="negate"){let _=U;y.inner&&y.inner.length>1&&y.inner.includes("/")&&(_=j(r)),(_!==U||K()||/^\)+$/.test(re()))&&($=y.close=`)$))${_}`),y.inner.includes("*")&&(g=re())&&/^\.[^\\/.]+$/.test(g)&&($=y.close=`)${g})${_})`),y.prev.type==="bos"&&(l.negatedExtglob=!0)}x({type:"paren",extglob:!0,value:c,output:$}),ue("parens")};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(e)){let y=!1,$=e.replace(Gn,(g,_,I,q,M,Ne)=>q==="\\"?(y=!0,g):q==="?"?_?_+q+(M?N.repeat(M.length):""):Ne===0?H+(M?N.repeat(M.length):""):N.repeat(I.length):q==="."?R.repeat(I.length):q==="*"?_?_+q+(M?U:""):U:_?g:`\\${g}`);return y===!0&&(r.unescape===!0?$=$.replace(/\\/g,""):$=$.replace(/\\+/g,g=>g.length%2==0?"\\\\":g?"\\":"")),$===e&&r.contains===!0?(l.output=e,l):(l.output=Z.wrapOutput($,l,t),l)}for(;!K();){if(c=te(),c==="\0")continue;if(c==="\\"){let g=S();if(g==="/"&&r.bash!==!0||g==="."||g===";")continue;if(!g){c+="\\",x({type:"text",value:c});continue}let _=/^\\+/.exec(re()),I=0;if(_&&_[0].length>2&&(I=_[0].length,l.index+=I,I%2!=0&&(c+="\\")),r.unescape===!0?c=te():c+=te(),l.brackets===0){x({type:"text",value:c});continue}}if(l.brackets>0&&(c!=="]"||u.value==="["||u.value==="[^")){if(r.posix!==!1&&c===":"){let g=u.value.slice(1);if(g.includes("[")&&(u.posix=!0,g.includes(":"))){let _=u.value.lastIndexOf("["),I=u.value.slice(0,_),q=u.value.slice(_+2),M=Bn[q];if(M){u.value=I+M,l.backtrack=!0,te(),!a.output&&i.indexOf(u)===1&&(a.output=m);continue}}}(c==="["&&S()!==":"||c==="-"&&S()==="]")&&(c=`\\${c}`),c==="]"&&(u.value==="["||u.value==="[^")&&(c=`\\${c}`),r.posix===!0&&c==="!"&&u.value==="["&&(c="^"),u.value+=c,xe({value:c});continue}if(l.quotes===1&&c!=='"'){c=Z.escapeRegex(c),u.value+=c,xe({value:c});continue}if(c==='"'){l.quotes=l.quotes===1?0:1,r.keepQuotes===!0&&x({type:"text",value:c});continue}if(c==="("){be("parens"),x({type:"paren",value:c});continue}if(c===")"){if(l.parens===0&&r.strictBrackets===!0)throw new SyntaxError(fe("opening","("));let g=L[L.length-1];if(g&&l.parens===g.parens+1){Er(L.pop());continue}x({type:"paren",value:c,output:l.parens?")":"\\)"}),ue("parens");continue}if(c==="["){if(r.nobracket===!0||!re().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(fe("closing","]"));c=`\\${c}`}else be("brackets");x({type:"bracket",value:c});continue}if(c==="]"){if(r.nobracket===!0||u&&u.type==="bracket"&&u.value.length===1){x({type:"text",value:c,output:`\\${c}`});continue}if(l.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(fe("opening","["));x({type:"text",value:c,output:`\\${c}`});continue}ue("brackets");let g=u.value.slice(1);if(u.posix!==!0&&g[0]==="^"&&!g.includes("/")&&(c=`/${c}`),u.value+=c,xe({value:c}),r.literalBrackets===!1||Z.hasRegexChars(g))continue;let _=Z.escapeRegex(u.value);if(l.output=l.output.slice(0,-u.value.length),r.literalBrackets===!0){l.output+=_,u.value=_;continue}u.value=`(${o}${_}|${u.value})`,l.output+=u.value;continue}if(c==="{"&&r.nobrace!==!0){be("braces");let g={type:"brace",value:c,output:"(",outputIndex:l.output.length,tokensIndex:l.tokens.length};T.push(g),x(g);continue}if(c==="}"){let g=T[T.length-1];if(r.nobrace===!0||!g){x({type:"text",value:c,output:c});continue}let _=")";if(g.dots===!0){let I=i.slice(),q=[];for(let M=I.length-1;M>=0&&(i.pop(),I[M].type!=="brace");M--)I[M].type!=="dots"&&q.unshift(I[M].value);_=Fn(q,r),l.backtrack=!0}if(g.comma!==!0&&g.dots!==!0){let I=l.output.slice(0,g.outputIndex),q=l.tokens.slice(g.tokensIndex);g.value=g.output="\\{",c=_="\\}",l.output=I;for(let M of q)l.output+=M.output||M.value}x({type:"brace",value:c,output:_}),ue("braces"),T.pop();continue}if(c==="|"){L.length>0&&L[L.length-1].conditions++,x({type:"text",value:c});continue}if(c===","){let g=c,_=T[T.length-1];_&&oe[oe.length-1]==="braces"&&(_.comma=!0,g="|"),x({type:"comma",value:c,output:g});continue}if(c==="/"){if(u.type==="dot"&&l.index===l.start+1){l.start=l.index+1,l.consumed="",l.output="",i.pop(),u=a;continue}x({type:"slash",value:c,output:v});continue}if(c==="."){if(l.braces>0&&u.type==="dot"){u.value==="."&&(u.output=R);let g=T[T.length-1];u.type="dots",u.output+=c,u.value+=c,g.dots=!0;continue}if(l.braces+l.parens===0&&u.type!=="bos"&&u.type!=="slash"){x({type:"text",value:c,output:R});continue}x({type:"dot",value:c,output:R});continue}if(c==="?"){if(!(u&&u.value==="(")&&r.noextglob!==!0&&S()==="("&&S(2)!=="?"){Se("qmark",c);continue}if(u&&u.type==="paren"){let _=S(),I=c;if(_==="<"&&!Z.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(u.value==="("&&!/[!=<:]/.test(_)||_==="<"&&!/<([!=]|\w+>)/.test(re()))&&(I=`\\${c}`),x({type:"text",value:c,output:I});continue}if(r.dot!==!0&&(u.type==="slash"||u.type==="bos")){x({type:"qmark",value:c,output:ee});continue}x({type:"qmark",value:c,output:N});continue}if(c==="!"){if(r.noextglob!==!0&&S()==="("&&(S(2)!=="?"||!/[!=<:]/.test(S(3)))){Se("negate",c);continue}if(r.nonegate!==!0&&l.index===0){Cr();continue}}if(c==="+"){if(r.noextglob!==!0&&S()==="("&&S(2)!=="?"){Se("plus",c);continue}if(u&&u.value==="("||r.regex===!1){x({type:"plus",value:c,output:p});continue}if(u&&(u.type==="bracket"||u.type==="paren"||u.type==="brace")||l.parens>0){x({type:"plus",value:c});continue}x({type:"plus",value:p});continue}if(c==="@"){if(r.noextglob!==!0&&S()==="("&&S(2)!=="?"){x({type:"at",extglob:!0,value:c,output:""});continue}x({type:"text",value:c});continue}if(c!=="*"){(c==="$"||c==="^")&&(c=`\\${c}`);let g=Un.exec(re());g&&(c+=g[0],l.index+=g[0].length),x({type:"text",value:c});continue}if(u&&(u.type==="globstar"||u.star===!0)){u.type="star",u.star=!0,u.value+=c,u.output=U,l.backtrack=!0,l.globstar=!0,X(c);continue}let y=re();if(r.noextglob!==!0&&/^\([^?]/.test(y)){Se("star",c);continue}if(u.type==="star"){if(r.noglobstar===!0){X(c);continue}let g=u.prev,_=g.prev,I=g.type==="slash"||g.type==="bos",q=_&&(_.type==="star"||_.type==="globstar");if(r.bash===!0&&(!I||y[0]&&y[0]!=="/")){x({type:"star",value:c,output:""});continue}let M=l.braces>0&&(g.type==="comma"||g.type==="brace"),Ne=L.length&&(g.type==="pipe"||g.type==="paren");if(!I&&g.type!=="paren"&&!M&&!Ne){x({type:"star",value:c,output:""});continue}for(;y.slice(0,3)==="/**";){let ve=e[l.index+4];if(ve&&ve!=="/")break;y=y.slice(3),X("/**",3)}if(g.type==="bos"&&K()){u.type="globstar",u.value+=c,u.output=j(r),l.output=u.output,l.globstar=!0,X(c);continue}if(g.type==="slash"&&g.prev.type!=="bos"&&!q&&K()){l.output=l.output.slice(0,-(g.output+u.output).length),g.output=`(?:${g.output}`,u.type="globstar",u.output=j(r)+(r.strictSlashes?")":"|$)"),u.value+=c,l.globstar=!0,l.output+=g.output+u.output,X(c);continue}if(g.type==="slash"&&g.prev.type!=="bos"&&y[0]==="/"){let ve=y[1]!==void 0?"|$":"";l.output=l.output.slice(0,-(g.output+u.output).length),g.output=`(?:${g.output}`,u.type="globstar",u.output=`${j(r)}${v}|${v}${ve})`,u.value+=c,l.output+=g.output+u.output,l.globstar=!0,X(c+te()),x({type:"slash",value:"/",output:""});continue}if(g.type==="bos"&&y[0]==="/"){u.type="globstar",u.value+=c,u.output=`(?:^|${v}|${j(r)}${v})`,l.output=u.output,l.globstar=!0,X(c+te()),x({type:"slash",value:"/",output:""});continue}l.output=l.output.slice(0,-u.output.length),u.type="globstar",u.output=j(r),u.value+=c,l.output+=u.output,l.globstar=!0,X(c);continue}let $={type:"star",value:c,output:U};if(r.bash===!0){$.output=".*?",(u.type==="bos"||u.type==="slash")&&($.output=C+$.output),x($);continue}if(u&&(u.type==="bracket"||u.type==="paren")&&r.regex===!0){$.output=c,x($);continue}(l.index===l.start||u.type==="slash"||u.type==="dot")&&(u.type==="dot"?(l.output+=b,u.output+=b):r.dot===!0?(l.output+=k,u.output+=k):(l.output+=C,u.output+=C),S()!=="*"&&(l.output+=m,u.output+=m)),x($)}for(;l.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(fe("closing","]"));l.output=Z.escapeLast(l.output,"["),ue("brackets")}for(;l.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(fe("closing",")"));l.output=Z.escapeLast(l.output,"("),ue("parens")}for(;l.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(fe("closing","}"));l.output=Z.escapeLast(l.output,"{"),ue("braces")}if(r.strictSlashes!==!0&&(u.type==="star"||u.type==="bracket")&&x({type:"maybe_slash",value:"",output:`${v}?`}),l.backtrack===!0){l.output="";for(let y of l.tokens)l.output+=y.output!=null?y.output:y.value,y.suffix&&(l.output+=y.suffix)}return l};tr.fastpaths=(e,t)=>{let r=w({},t),n=typeof r.maxLength=="number"?Math.min(Oe,r.maxLength):Oe,s=e.length;if(s>n)throw new SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${n}`);e=er[e]||e;let a=Z.isWindows(t),{DOT_LITERAL:i,SLASH_LITERAL:o,ONE_CHAR:h,DOTS_SLASH:d,NO_DOT:f,NO_DOTS:R,NO_DOTS_SLASH:p,STAR:v,START_ANCHOR:m}=Le.globChars(a),A=r.dot?R:f,E=r.dot?p:f,b=r.capture?"":"?:",k={negated:!1,prefix:""},N=r.bash===!0?".*?":v;r.capture&&(N=`(${N})`);let ee=C=>C.noglobstar===!0?N:`(${b}(?:(?!${m}${C.dot?d:i}).)*?)`,F=C=>{switch(C){case"*":return`${A}${h}${N}`;case".*":return`${i}${h}${N}`;case"*.*":return`${A}${N}${i}${h}${N}`;case"*/*":return`${A}${N}${o}${h}${E}${N}`;case"**":return A+ee(r);case"**/*":return`(?:${A}${ee(r)}${o})?${E}${h}${N}`;case"**/*.*":return`(?:${A}${ee(r)}${o})?${E}${N}${i}${h}${N}`;case"**/.*":return`(?:${A}${ee(r)}${o})?${i}${h}${N}`;default:{let H=/^(.*?)\.(\w+)$/.exec(C);if(!H)return;let U=F(H[1]);return U?U+i+H[2]:void 0}}},ie=Z.removePrefix(e,k),j=F(ie);return j&&r.strictSlashes!==!0&&(j+=`${o}?`),j};rr.exports=tr});var ar=G((hs,sr)=>{"use strict";var jn=W("path"),Kn=Jt(),Qe=nr(),Xe=me(),qn=Ae(),Wn=e=>e&&typeof e=="object"&&!Array.isArray(e),D=(e,t,r=!1)=>{if(Array.isArray(e)){let f=e.map(p=>D(p,t,r));return p=>{for(let v of f){let m=v(p);if(m)return m}return!1}}let n=Wn(e)&&e.tokens&&e.input;if(e===""||typeof e!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let s=t||{},a=Xe.isWindows(t),i=n?D.compileRe(e,t):D.makeRe(e,t,!1,!0),o=i.state;delete i.state;let h=()=>!1;if(s.ignore){let f=B(w({},t),{ignore:null,onMatch:null,onResult:null});h=D(s.ignore,f,r)}let d=(f,R=!1)=>{let{isMatch:p,match:v,output:m}=D.test(f,i,t,{glob:e,posix:a}),A={glob:e,state:o,regex:i,posix:a,input:f,output:m,match:v,isMatch:p};return typeof s.onResult=="function"&&s.onResult(A),p===!1?(A.isMatch=!1,R?A:!1):h(f)?(typeof s.onIgnore=="function"&&s.onIgnore(A),A.isMatch=!1,R?A:!1):(typeof s.onMatch=="function"&&s.onMatch(A),R?A:!0)};return r&&(d.state=o),d};D.test=(e,t,r,{glob:n,posix:s}={})=>{if(typeof e!="string")throw new TypeError("Expected input to be a string");if(e==="")return{isMatch:!1,output:""};let a=r||{},i=a.format||(s?Xe.toPosixSlashes:null),o=e===n,h=o&&i?i(e):e;return o===!1&&(h=i?i(e):e,o=h===n),(o===!1||a.capture===!0)&&(a.matchBase===!0||a.basename===!0?o=D.matchBase(e,t,r,s):o=t.exec(h)),{isMatch:Boolean(o),match:o,output:h}};D.matchBase=(e,t,r,n=Xe.isWindows(r))=>(t instanceof RegExp?t:D.makeRe(t,r)).test(jn.basename(e));D.isMatch=(e,t,r)=>D(t,r)(e);D.parse=(e,t)=>Array.isArray(e)?e.map(r=>D.parse(r,t)):Qe(e,B(w({},t),{fastpaths:!1}));D.scan=(e,t)=>Kn(e,t);D.compileRe=(e,t,r=!1,n=!1)=>{if(r===!0)return e.output;let s=t||{},a=s.contains?"":"^",i=s.contains?"":"$",o=`${a}(?:${e.output})${i}`;e&&e.negated===!0&&(o=`^(?!${o}).*$`);let h=D.toRegex(o,t);return n===!0&&(h.state=e),h};D.makeRe=(e,t={},r=!1,n=!1)=>{if(!e||typeof e!="string")throw new TypeError("Expected a non-empty string");let s={negated:!1,fastpaths:!0};return t.fastpaths!==!1&&(e[0]==="."||e[0]==="*")&&(s.output=Qe.fastpaths(e,t)),s.output||(s=Qe(e,t)),D.compileRe(s,t,r,n)};D.toRegex=(e,t)=>{try{let r=t||{};return new RegExp(e,r.flags||(r.nocase?"i":""))}catch(r){if(t&&t.debug===!0)throw r;return/$^/}};D.constants=qn;sr.exports=D});var or=G((gs,ir)=>{"use strict";ir.exports=ar()});var fr=G((ds,pr)=>{"use strict";var ur=W("util"),cr=Ut(),se=or(),ze=me(),lr=e=>e===""||e==="./",O=(e,t,r)=>{t=[].concat(t),e=[].concat(e);let n=new Set,s=new Set,a=new Set,i=0,o=f=>{a.add(f.output),r&&r.onResult&&r.onResult(f)};for(let f=0;f!n.has(f));if(r&&d.length===0){if(r.failglob===!0)throw new Error(`No matches found for "${t.join(", ")}"`);if(r.nonull===!0||r.nullglob===!0)return r.unescape?t.map(f=>f.replace(/\\/g,"")):t}return d};O.match=O;O.matcher=(e,t)=>se(e,t);O.isMatch=(e,t,r)=>se(t,r)(e);O.any=O.isMatch;O.not=(e,t,r={})=>{t=[].concat(t).map(String);let n=new Set,s=[],a=o=>{r.onResult&&r.onResult(o),s.push(o.output)},i=O(e,t,B(w({},r),{onResult:a}));for(let o of s)i.includes(o)||n.add(o);return[...n]};O.contains=(e,t,r)=>{if(typeof e!="string")throw new TypeError(`Expected a string: "${ur.inspect(e)}"`);if(Array.isArray(t))return t.some(n=>O.contains(e,n,r));if(typeof t=="string"){if(lr(e)||lr(t))return!1;if(e.includes(t)||e.startsWith("./")&&e.slice(2).includes(t))return!0}return O.isMatch(e,t,B(w({},r),{contains:!0}))};O.matchKeys=(e,t,r)=>{if(!ze.isObject(e))throw new TypeError("Expected the first argument to be an object");let n=O(Object.keys(e),t,r),s={};for(let a of n)s[a]=e[a];return s};O.some=(e,t,r)=>{let n=[].concat(e);for(let s of[].concat(t)){let a=se(String(s),r);if(n.some(i=>a(i)))return!0}return!1};O.every=(e,t,r)=>{let n=[].concat(e);for(let s of[].concat(t)){let a=se(String(s),r);if(!n.every(i=>a(i)))return!1}return!0};O.all=(e,t,r)=>{if(typeof e!="string")throw new TypeError(`Expected a string: "${ur.inspect(e)}"`);return[].concat(t).every(n=>se(n,r)(e))};O.capture=(e,t,r)=>{let n=ze.isWindows(r),a=se.makeRe(String(e),B(w({},r),{capture:!0})).exec(n?ze.toPosixSlashes(t):t);if(a)return a.slice(1).map(i=>i===void 0?"":i)};O.makeRe=(...e)=>se.makeRe(...e);O.scan=(...e)=>se.scan(...e);O.parse=(e,t)=>{let r=[];for(let n of[].concat(e||[]))for(let s of cr(String(n),t))r.push(se.parse(s,t));return r};O.braces=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");return t&&t.nobrace===!0||!/\{.*\}/.test(e)?[e]:cr(e,t)};O.braceExpand=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");return O.braces(e,B(w({},t),{expand:!0}))};pr.exports=O});var Vn={};$r(Vn,{default:()=>Zn});var ke=J(W("@yarnpkg/cli")),P=J(W("@yarnpkg/core")),V=J(W("clipanion")),Je=J(fr()),mr=J(W("path")),et=J(W("semver")),de=J(W("typanion"));var he=J(W("@yarnpkg/core")),yr=J(W("@yarnpkg/plugin-essentials"));var Ee=J(W("semver")),hr=Boolean;function Qn(e){var s;let[t,r,n]=(s=e.match(/(github|bitbucket|gitlab):(.+)/))!=null?s:[];return r?`https://${r}.${r==="bitbucket"?"org":"com"}/${n}`:`https://github.com/${e}`}function gr(e){let{homepage:t,repository:r}=e.raw;return t||(typeof r=="string"?Qn(r):r==null?void 0:r.url)}function dr(e,t){return Ee.default.parse(t).prerelease.length?Ee.default.lt(e,t):Ee.default.lt(Ee.default.coerce(e),t)}var Ze=class{constructor(t,r,n,s){this.configuration=t;this.project=r;this.workspace=n;this.cache=s}async fetch({descriptor:t,includeRange:r,includeURL:n,pkg:s}){let[a,i,o]=await Promise.all([this.suggest(s,"latest"),r?this.suggest(s,t.range):Promise.resolve(),n?this.fetchURL(s):Promise.resolve()]);if(!a){let h=he.structUtils.prettyIdent(this.configuration,s);throw new Error(`Could not fetch candidate for ${h}.`)}return{latest:a.range,range:i==null?void 0:i.range,url:o}}suggest(t,r){return yr.suggestUtils.fetchDescriptorFrom(t,r,{cache:this.cache,preserveModifier:!1,project:this.project,workspace:this.workspace})}async fetchURL(t){var a;let r=this.configuration.makeFetcher(),n=await r.fetch(t,{cache:this.cache,checksums:this.project.storedChecksums,fetcher:r,project:this.project,report:new he.ThrowReport,skipIntegrityCheck:!0}),s;try{s=await he.Manifest.find(n.prefixPath,{baseFs:n.packageFs})}finally{(a=n.releaseFs)==null||a.call(n)}return gr(s)}};var ge=J(W("@yarnpkg/core")),Xn=/^([0-9]+\.)([0-9]+\.)(.+)$/,Rr=["name","current","range","latest","workspace","type","url"],Ve=class{constructor(t,r,n,s){this.report=t;this.configuration=r;this.dependencies=n;this.extraColumns=s;this.sizes=null;this.headers={current:"Current",latest:"Latest",name:"Package",range:"Range",type:"Package Type",url:"URL",workspace:"Workspace"}}print(){this.sizes=this.getColumnSizes(),this.printHeader(),this.dependencies.forEach(t=>{var s,a;let r=this.getDiffColor(t.severity.latest),n=this.getDiffColor(t.severity.range);this.printRow({current:t.current.padEnd(this.sizes.current),latest:this.formatVersion(t,"latest",r),name:this.applyColor(t.name.padEnd(this.sizes.name),r),range:this.formatVersion(t,"range",n),type:t.type.padEnd(this.sizes.type),url:(s=t.url)==null?void 0:s.padEnd(this.sizes.url),workspace:(a=t.workspace)==null?void 0:a.padEnd(this.sizes.workspace)})})}applyColor(t,r){return ge.formatUtils.pretty(this.configuration,t,r)}formatVersion(t,r,n){var d;let s=(d=t[r])==null?void 0:d.padEnd(this.sizes[r]);if(!s)return;let a=s.match(Xn);if(!a)return s;let i=["red","yellow","green"].indexOf(n)+1,o=a.slice(1,i).join(""),h=a.slice(i).join("");return o+ge.formatUtils.pretty(this.configuration,this.applyColor(h,n),"bold")}getDiffColor(t="patch"){return{major:"red",minor:"yellow",patch:"green"}[t]}getColumnSizes(){let t=Rr.reduce((r,n)=>B(w({},r),{[n]:this.headers[n].length}),{});for(let r of this.dependencies)for(let[n,s]of Object.entries(r)){let a=t[n],i=(s||"").length;t[n]=a>i?a:i}return t}formatColumnHeader(t){return ge.formatUtils.pretty(this.configuration,this.headers[t].padEnd(this.sizes[t]),"bold")}printHeader(){this.printRow({current:this.formatColumnHeader("current"),latest:this.formatColumnHeader("latest"),name:this.formatColumnHeader("name"),range:this.formatColumnHeader("range"),type:this.formatColumnHeader("type"),url:this.formatColumnHeader("url"),workspace:this.formatColumnHeader("workspace")})}printRow(t){let r=Rr.filter(n=>{var s;return(s=this.extraColumns[n])!=null?s:!0}).map(n=>t[n]).join(" ").trim();this.report.reportInfo(ge.MessageName.UNNAMED,r)}};var Ye=["dependencies","devDependencies"],Ar=["major","minor","patch"];var _e=class extends ke.BaseCommand{constructor(){super(...arguments);this.patterns=V.Option.Rest();this.workspace=V.Option.Array("-w,--workspace",{description:"Only search for dependencies in the specified workspaces. If no workspaces are specified, only searches for outdated dependencies in the current workspace.",validator:de.default.isArray(de.default.isString())});this.check=V.Option.Boolean("-c,--check",!1,{description:"Exit with exit code 1 when outdated dependencies are found"});this.json=V.Option.Boolean("--json",!1,{description:"Format the output as JSON"});this.severity=V.Option.Array("-s,--severity",{description:"Filter results based on the severity of the update",validator:de.default.isArray(de.default.isEnum(Ar))});this.type=V.Option.String("-t,--type",{description:"Filter results based on the dependency type",validator:de.default.isEnum(Ye)});this.includeURL=V.Option.Boolean("--url",!1,{description:"Include the homepage URL of each package in the output"});this.includeRange=V.Option.Boolean("--range",!1,{description:"Include the latest version of the package which satisfies the current range specified in the manifest."})}async execute(){let{cache:t,configuration:r,project:n,workspace:s}=await this.loadProject(),a=new Ze(r,n,s,t),i=this.getWorkspaces(n),o=this.getDependencies(r,i);if(this.json){let f=(await this.getOutdatedDependencies(n,a,o)).map(R=>B(w({},R),{severity:R.severity.latest}));this.context.stdout.write(JSON.stringify(f)+` +`);return}return(await P.StreamReport.start({configuration:r,stdout:this.context.stdout},async d=>{await this.checkOutdatedDependencies(r,n,o,a,d)})).exitCode()}async checkOutdatedDependencies(t,r,n,s,a){let i=null;await a.startTimerPromise("Checking for outdated dependencies",async()=>{let o=n.length,h=P.StreamReport.progressViaCounter(o);a.reportProgress(h),i=await this.getOutdatedDependencies(r,s,n,h)}),a.reportSeparator(),i.length?(new Ve(a,t,i,{range:this.includeRange,url:this.includeURL,workspace:this.includeWorkspace(r)}).print(),a.reportSeparator(),this.printOutdatedCount(a,i.length)):this.printUpToDate(t,a)}async loadProject(){let t=await P.Configuration.find(this.context.cwd,this.context.plugins),[r,{project:n,workspace:s}]=await Promise.all([P.Cache.find(t),P.Project.find(t,this.context.cwd)]);if(await n.restoreInstallState(),!s)throw new ke.WorkspaceRequiredError(n.cwd,this.context.cwd);return{cache:r,configuration:t,project:n,workspace:s}}getWorkspaces(t){let r=this.workspace;return r?r[0]==="."?t.workspaces.filter(n=>n.cwd===this.context.cwd):t.workspaces.filter(n=>{let s=[...r,...r.map(a=>mr.default.join(this.context.cwd,a))];return Je.default.some([this.getWorkspaceName(n),n.cwd],s)}):t.workspaces}includeWorkspace(t){return t.workspaces.length>1}get dependencyTypes(){return this.type?[this.type]:Ye}getDependencies(t,r){let n=[];for(let a of r){let{anchoredLocator:i,project:o}=a,h=o.storedPackages.get(i.locatorHash);h||this.throw(t,i);for(let d of this.dependencyTypes)for(let f of a.manifest[d].values()){let{range:R}=f;if(R.includes(":")&&!/(npm|patch):/.test(R))continue;let p=h.dependencies.get(f.identHash);p||this.throw(t,f);let v=o.storedResolutions.get(p.descriptorHash);v||this.throw(t,p);let m=o.storedPackages.get(v);m||this.throw(t,p),n.push({dependencyType:d,descriptor:f,name:P.structUtils.stringifyIdent(f),pkg:m,workspace:a})}}if(!this.patterns.length)return n;let s=n.filter(({name:a})=>Je.default.isMatch(a,this.patterns));if(!s.length)throw new V.UsageError(`Pattern ${P.formatUtils.prettyList(t,this.patterns,P.FormatType.CODE)} doesn't match any packages referenced by any workspace`);return s}throw(t,r){let n=P.structUtils.prettyIdent(t,r);throw new Error(`Package for ${n} not found in the project`)}getSeverity(t,r){let n=et.default.coerce(t),s=et.default.coerce(r);return n.major===0||s.major>n.major?"major":s.minor>n.minor?"minor":"patch"}async getOutdatedDependencies(t,r,n,s){let a=n.map(async({dependencyType:i,descriptor:o,name:h,pkg:d,workspace:f})=>{if(f.project.tryWorkspaceByLocator(d))return;let{latest:R,range:p,url:v}=await r.fetch({descriptor:o,includeRange:this.includeRange,includeURL:this.includeURL,pkg:d});if(s==null||s.tick(),dr(d.version,R))return{current:d.version,latest:R,name:h,range:p,severity:{latest:this.getSeverity(d.version,R),range:p?this.getSeverity(d.version,p):void 0},type:i,url:v,workspace:this.includeWorkspace(t)?this.getWorkspaceName(f):void 0}});return(await Promise.all(a)).filter(hr).filter(i=>{var o,h;return(h=(o=this.severity)==null?void 0:o.includes(i.severity.latest))!=null?h:!0}).sort((i,o)=>i.name.localeCompare(o.name))}getWorkspaceName(t){return t.manifest.name?P.structUtils.stringifyIdent(t.manifest.name):t.computeCandidateName()}printOutdatedCount(t,r){let n=[P.MessageName.UNNAMED,r===1?"1 dependency is out of date":`${r} dependencies are out of date`];this.check?t.reportError(...n):t.reportWarning(...n)}printUpToDate(t,r){let n="\u2728 All your dependencies are up to date!";r.reportInfo(P.MessageName.UNNAMED,P.formatUtils.pretty(t,n,"green"))}};_e.paths=[["outdated"]],_e.usage=V.Command.Usage({description:"view outdated dependencies",details:` + This command finds outdated dependencies in a project and prints the result in a table or JSON format. + + This command accepts glob patterns as arguments to filter the output. Make sure to escape the patterns, to prevent your own shell from trying to expand them. + `,examples:[["View outdated dependencies","yarn outdated"],["View outdated dependencies with the `@babel` scope","yarn outdated '@babel/*'"],["Filter results to only include devDependencies","yarn outdated --type devDependencies"],["Filter results to only include major version updates","yarn outdated --severity major"]]});var zn={commands:[_e]},Zn=zn;return Vn;})(); +/*! + * fill-range + * + * Copyright (c) 2014-present, Jon Schlinkert. + * Licensed under the MIT License. + */ +/*! + * is-number + * + * Copyright (c) 2014-present, Jon Schlinkert. + * Released under the MIT License. + */ +/*! + * to-regex-range + * + * Copyright (c) 2015-present, Jon Schlinkert. + * Released under the MIT License. + */ +return plugin; +} +}; diff --git a/.yarnrc.yml b/.yarnrc.yml index f71089c56..3ebf55616 100644 --- a/.yarnrc.yml +++ b/.yarnrc.yml @@ -3,5 +3,7 @@ nodeLinker: node-modules plugins: - path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs spec: "@yarnpkg/plugin-workspace-tools" + - path: .yarn/plugins/@yarnpkg/plugin-outdated.cjs + spec: "https://mskelton.dev/yarn-outdated/v3" yarnPath: .yarn/releases/yarn-3.2.0.cjs diff --git a/package.json b/package.json index b95b47b36..688b721f9 100644 --- a/package.json +++ b/package.json @@ -4,21 +4,24 @@ "version": "0.0.0", "devDependencies": { "@trivago/prettier-plugin-sort-imports": "^3.2.0", - "eslint": "^7.32.0", - "eslint-config-prettier": "^8.3.0", + "@typescript-eslint/eslint-plugin": "^5.27.0", + "@typescript-eslint/parser": "^5.27.0", + "eslint": "^8.16.0", + "eslint-config-prettier": "^8.5.0", "husky": "^8.0.0", - "lint-staged": "^12.4.2", + "lint-staged": "^12.4.3", "prettier": "^2.4.1", "prettier-plugin-solidity": "^1.0.0-beta.5", - "ts-node": "^10.1.0", - "typescript": "^4.3.5" + "ts-node": "^10.8.0", + "typescript": "^4.7.2" }, "packageManager": "yarn@3.2.0", "private": true, "scripts": { "build": "yarn workspaces foreach --parallel --topological run build", "postinstall": "husky install", - "prettier": "yarn workspaces foreach --parallel run prettier" + "prettier": "yarn workspaces foreach --parallel run prettier", + "lint-ts": "eslint . --ext .ts" }, "workspaces": [ "solidity/*", diff --git a/solidity/app/.eslintrc.json b/solidity/app/.eslintrc.json deleted file mode 100644 index f05ee8f8f..000000000 --- a/solidity/app/.eslintrc.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "env": { - "browser": true, - "node": true, - "es2021": true - }, - "extends": "eslint:recommended", - "parserOptions": { - "ecmaVersion": 12, - "sourceType": "module" - }, - "rules": { - "no-undef": "off" - } -} diff --git a/solidity/app/test/router.test.ts b/solidity/app/test/router.test.ts index 302d46c23..832f91cf0 100644 --- a/solidity/app/test/router.test.ts +++ b/solidity/app/test/router.test.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-floating-promises */ import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; import { expect } from 'chai'; import { ContractTransaction } from 'ethers'; diff --git a/solidity/app/tsconfig.json b/solidity/app/tsconfig.json index 724b6bd93..907c01499 100644 --- a/solidity/app/tsconfig.json +++ b/solidity/app/tsconfig.json @@ -3,14 +3,7 @@ "outDir": "./dist/", "rootDir": "./types/" }, - "exclude": [ - "./node_modules/", - "./dist/", - "./types/hardhat.d.ts" - ], - "extends": "../../tsconfig.package.json", - "include": [ - "./types/*.ts", - "./types/factories/*.ts" - ] + "exclude": ["./node_modules/", "./dist/", "./types/hardhat.d.ts"], + "extends": "../../tsconfig.json", + "include": ["./types/*.ts", "./types/factories/*.ts"] } diff --git a/solidity/core/.eslintrc.json b/solidity/core/.eslintrc.json deleted file mode 100644 index f05ee8f8f..000000000 --- a/solidity/core/.eslintrc.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "env": { - "browser": true, - "node": true, - "es2021": true - }, - "extends": "eslint:recommended", - "parserOptions": { - "ecmaVersion": 12, - "sourceType": "module" - }, - "rules": { - "no-undef": "off" - } -} diff --git a/solidity/core/package.json b/solidity/core/package.json index b0e6de6eb..b09a673e2 100644 --- a/solidity/core/package.json +++ b/solidity/core/package.json @@ -22,7 +22,6 @@ "solhint-plugin-prettier": "^0.0.5", "solidity-coverage": "^0.7.14", "ts-generator": "^0.1.1", - "ts-node": "^10.1.0", "typechain": "^5.0.0" }, "directories": { diff --git a/solidity/core/test/.eslintrc b/solidity/core/test/.eslintrc new file mode 100644 index 000000000..8e15c17e7 --- /dev/null +++ b/solidity/core/test/.eslintrc @@ -0,0 +1,6 @@ +{ + "rules": { + "@typescript-eslint/no-require-imports": ["off"], + "@typescript-eslint/no-var-requires": ["off"] + } +} diff --git a/solidity/core/test/inbox.test.ts b/solidity/core/test/inbox.test.ts index 5d6bc6c2d..e8c756cb7 100644 --- a/solidity/core/test/inbox.test.ts +++ b/solidity/core/test/inbox.test.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-floating-promises */ import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; import { expect } from 'chai'; import { ethers } from 'hardhat'; @@ -108,7 +109,7 @@ describe('Inbox', async () => { const recipient = await recipientF.deploy(); await recipient.deployTransaction.wait(); - let { index, proof, root, message } = messageWithProof; + const { index, proof, root, message } = messageWithProof; await inbox.setCheckpoint(root, 1); await inbox.process(message, proof, index, '0x'); @@ -117,7 +118,7 @@ describe('Inbox', async () => { }); it('Rejects an already-processed message', async () => { - let { leaf, index, proof, root, message } = messageWithProof; + const { leaf, index, proof, root, message } = messageWithProof; await inbox.setCheckpoint(root, 1); // Set message status as MessageStatus.Processed @@ -130,7 +131,7 @@ describe('Inbox', async () => { }); it('Rejects invalid message proof', async () => { - let { leaf, index, proof, root, message } = messageWithProof; + const { leaf, index, proof, root, message } = messageWithProof; // Switch ordering of proof hashes // NB: We copy 'path' here to avoid mutating the test cases for diff --git a/solidity/core/test/lib/upgrade.ts b/solidity/core/test/lib/upgrade.ts index d34d13e9e..de4fdb26a 100644 --- a/solidity/core/test/lib/upgrade.ts +++ b/solidity/core/test/lib/upgrade.ts @@ -18,9 +18,9 @@ export type MysteryMathUpgrade = { }; export class UpgradeTestHelpers { - a: number = 5; - b: number = 10; - stateVar: number = 17; + a = 5; + b = 10; + stateVar = 17; async deployMysteryMathUpgradeSetup( signer: SignerWithAddress, diff --git a/solidity/core/test/merkle.test.ts b/solidity/core/test/merkle.test.ts index 54fb1330e..48fc183ba 100644 --- a/solidity/core/test/merkle.test.ts +++ b/solidity/core/test/merkle.test.ts @@ -8,7 +8,7 @@ import { TestMerkle, TestMerkle__factory } from '../types'; const merkleTestCases = require('../../../vectors/merkle.json'); describe('Merkle', async () => { - for (let testCase of merkleTestCases) { + for (const testCase of merkleTestCases) { const { testName, leaves, expectedRoot, proofs } = testCase; describe(testName, async () => { @@ -21,7 +21,7 @@ describe('Merkle', async () => { merkle = await merkleFactory.deploy(); //insert the leaves - for (let leaf of leaves) { + for (const leaf of leaves) { const leafHash = ethers.utils.hashMessage(leaf); await merkle.insert(leafHash); } @@ -37,7 +37,7 @@ describe('Merkle', async () => { }); it("can verify the leaves' proofs", async () => { - for (let proof of proofs) { + for (const proof of proofs) { const { leaf, path, index } = proof; const proofRoot = await merkle.branchRoot( diff --git a/solidity/core/test/outbox.test.ts b/solidity/core/test/outbox.test.ts index 40fc0b1bd..e1f1361c7 100644 --- a/solidity/core/test/outbox.test.ts +++ b/solidity/core/test/outbox.test.ts @@ -152,8 +152,8 @@ describe('Outbox', async () => { }); it('Correctly calculates destinationAndNonce', async () => { - for (let testCase of destinationNonceTestCases) { - let { destination, nonce, expectedDestinationAndNonce } = testCase; + for (const testCase of destinationNonceTestCases) { + const { destination, nonce, expectedDestinationAndNonce } = testCase; const solidityDestinationAndNonce = await outbox.destinationAndNonce( destination, nonce, diff --git a/solidity/core/test/validator-manager/multisigValidatorManager.test.ts b/solidity/core/test/validator-manager/multisigValidatorManager.test.ts index 109c4062a..893ea006b 100644 --- a/solidity/core/test/validator-manager/multisigValidatorManager.test.ts +++ b/solidity/core/test/validator-manager/multisigValidatorManager.test.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-floating-promises */ import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; import { expect } from 'chai'; import { ethers } from 'hardhat'; @@ -14,6 +15,7 @@ import { signCheckpoint } from './utils'; const OUTBOX_DOMAIN = 1234; const QUORUM_THRESHOLD = 1; +// eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires const domainHashTestCases = require('../../../../vectors/domainHash.json'); describe('MultisigValidatorManager', async () => { @@ -257,7 +259,7 @@ describe('MultisigValidatorManager', async () => { it('matches Rust-produced domain hashes', async () => { // Compare Rust output in json file to solidity output (json file matches // hash for local domain of 1000) - for (let testCase of domainHashTestCases) { + for (const testCase of domainHashTestCases) { const { expectedDomainHash } = testCase; // This public function on TestMultisigValidatorManager exposes // the internal _domainHash on MultisigValidatorManager. diff --git a/solidity/core/tsconfig.json b/solidity/core/tsconfig.json index 724b6bd93..907c01499 100644 --- a/solidity/core/tsconfig.json +++ b/solidity/core/tsconfig.json @@ -3,14 +3,7 @@ "outDir": "./dist/", "rootDir": "./types/" }, - "exclude": [ - "./node_modules/", - "./dist/", - "./types/hardhat.d.ts" - ], - "extends": "../../tsconfig.package.json", - "include": [ - "./types/*.ts", - "./types/factories/*.ts" - ] + "exclude": ["./node_modules/", "./dist/", "./types/hardhat.d.ts"], + "extends": "../../tsconfig.json", + "include": ["./types/*.ts", "./types/factories/*.ts"] } diff --git a/solidity/tsconfig.json b/solidity/tsconfig.json new file mode 100644 index 000000000..3c43903cf --- /dev/null +++ b/solidity/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "../tsconfig.json" +} diff --git a/tsconfig.package.json b/tsconfig.json similarity index 100% rename from tsconfig.package.json rename to tsconfig.json diff --git a/typescript/deploy/.eslintrc b/typescript/deploy/.eslintrc new file mode 100644 index 000000000..e3f712414 --- /dev/null +++ b/typescript/deploy/.eslintrc @@ -0,0 +1,5 @@ +{ + "rules": { + "no-console": ["off"] + } +} diff --git a/typescript/deploy/src/deploy.ts b/typescript/deploy/src/deploy.ts index d24cad4a3..849fecc12 100644 --- a/typescript/deploy/src/deploy.ts +++ b/typescript/deploy/src/deploy.ts @@ -172,7 +172,7 @@ export abstract class AbacusAppDeployer { }); } - static stringify(obj: Object) { + static stringify(obj: any) { return JSON.stringify(obj, null, 2); } @@ -182,7 +182,7 @@ export abstract class AbacusAppDeployer { fs.writeFileSync(filepath, contents); } - static writeJson(filepath: string, obj: Object) { + static writeJson(filepath: string, obj: any) { AbacusAppDeployer.write(filepath, AbacusAppDeployer.stringify(obj)); } } diff --git a/typescript/deploy/tsconfig.json b/typescript/deploy/tsconfig.json index bd5960865..4f2e2f5a5 100644 --- a/typescript/deploy/tsconfig.json +++ b/typescript/deploy/tsconfig.json @@ -4,7 +4,7 @@ "rootDir": "./" }, "exclude": ["./node_modules/", "./dist/", "./tmp.ts"], - "extends": "../../tsconfig.package.json", + "extends": "../../tsconfig.json", "include": [ "./*.ts", "./config/**/*.ts", diff --git a/typescript/hardhat/src/TestCoreApp.ts b/typescript/hardhat/src/TestCoreApp.ts index d326f8907..a47dce99b 100644 --- a/typescript/hardhat/src/TestCoreApp.ts +++ b/typescript/hardhat/src/TestCoreApp.ts @@ -5,10 +5,10 @@ import { } from '@abacus-network/core'; import { AbacusCore, - chainMetadata, DomainIdToChainName, - objMap, TestChainNames, + chainMetadata, + objMap, } from '@abacus-network/sdk'; import { types } from '@abacus-network/utils'; import { ethers } from 'ethers'; @@ -80,7 +80,7 @@ export class TestCoreApp extends AbacusCore { dispatch.args.message, dispatch.args.leafIndex.toNumber(), ); - let destinationResponses = responses.get(destinationChain) || []; + const destinationResponses = responses.get(destinationChain) || []; destinationResponses.push(response); responses.set(destinationChain, destinationResponses); } diff --git a/typescript/hardhat/tsconfig.json b/typescript/hardhat/tsconfig.json index 02a6d71dd..821816744 100644 --- a/typescript/hardhat/tsconfig.json +++ b/typescript/hardhat/tsconfig.json @@ -4,9 +4,6 @@ "rootDir": "./" }, "exclude": ["./node_modules/", "./dist/", "./tmp.ts"], - "extends": "../../tsconfig.package.json", - "include": [ - "./index.ts", - "./src/*.ts" - ] + "extends": "../../tsconfig.json", + "include": ["./index.ts", "./src/*.ts"] } diff --git a/typescript/infra/.eslintrc b/typescript/infra/.eslintrc new file mode 100644 index 000000000..e3f712414 --- /dev/null +++ b/typescript/infra/.eslintrc @@ -0,0 +1,5 @@ +{ + "rules": { + "no-console": ["off"] + } +} diff --git a/typescript/infra/scripts/get-key-addresses.ts b/typescript/infra/scripts/get-key-addresses.ts index 82f54a523..c7f4c1c27 100644 --- a/typescript/infra/scripts/get-key-addresses.ts +++ b/typescript/infra/scripts/get-key-addresses.ts @@ -12,7 +12,9 @@ async function main() { try { await key.fetch(); address = key.address; - } catch (e) {} + } catch (e) { + // Swallow error + } return { identifier: key.identifier, address, diff --git a/typescript/infra/src/agents/aws/key.ts b/typescript/infra/src/agents/aws/key.ts index 313fc88fe..d02851d1d 100644 --- a/typescript/infra/src/agents/aws/key.ts +++ b/typescript/infra/src/agents/aws/key.ts @@ -92,9 +92,11 @@ export class AgentAwsKey extends AgentKey { } async createIfNotExists() { - let keyId = await this.getId(); + const keyId = await this.getId(); // If it doesn't exist, create it if (!keyId) { + // TODO should this be awaited? create is async + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.create(); // It can take a moment for the change to propagate await sleep(1000); @@ -148,15 +150,15 @@ export class AgentAwsKey extends AgentKey { return match?.TargetKeyId; } - async create() { - this._create(false); + create() { + return this._create(false); } /** * Creates the new key but doesn't actually rotate it * @returns The address of the new key */ - async update() { + update() { return this._create(true); } @@ -208,6 +210,8 @@ export class AgentAwsKey extends AgentKey { await client.send(new DeleteAliasCommand({ AliasName: newAlias })); // Address should have changed now + // TODO should this be awaited? fetch is async + // eslint-disable-next-line @typescript-eslint/no-floating-promises this.fetch(); } diff --git a/typescript/infra/src/agents/gcp.ts b/typescript/infra/src/agents/gcp.ts index 75c409dc4..e126ac8a6 100644 --- a/typescript/infra/src/agents/gcp.ts +++ b/typescript/infra/src/agents/gcp.ts @@ -114,6 +114,7 @@ export class AgentGCPKey extends AgentKey { } } + // eslint-disable-next-line @typescript-eslint/no-unused-vars private async _create(rotate: boolean) { const wallet = Wallet.createRandom(); const address = await wallet.getAddress(); diff --git a/typescript/infra/src/agents/index.ts b/typescript/infra/src/agents/index.ts index b343f459f..a1a05c8ee 100644 --- a/typescript/infra/src/agents/index.ts +++ b/typescript/infra/src/agents/index.ts @@ -225,7 +225,7 @@ export async function getAgentEnvVars( function configEnvVars( config: Record, role: string, - key_name_prefix: string = '', + key_name_prefix = '', ) { let envVars: string[] = []; for (const key of Object.keys(config)) { diff --git a/typescript/infra/src/utils/gcloud.ts b/typescript/infra/src/utils/gcloud.ts index 297ed94e9..8beaa6e0d 100644 --- a/typescript/infra/src/utils/gcloud.ts +++ b/typescript/infra/src/utils/gcloud.ts @@ -9,10 +9,7 @@ interface IamCondition { expression: string; } -export async function fetchGCPSecret( - secretName: string, - parseJson: boolean = true, -) { +export async function fetchGCPSecret(secretName: string, parseJson = true) { const [output] = await execCmd( `gcloud secrets versions access latest --secret ${secretName}`, ); diff --git a/typescript/infra/src/utils/utils.ts b/typescript/infra/src/utils/utils.ts index 183d64fbc..7956bdcfc 100644 --- a/typescript/infra/src/utils/utils.ts +++ b/typescript/infra/src/utils/utils.ts @@ -136,7 +136,7 @@ export function log(isTest: boolean, str: string) { } } -export function warn(text: string, padded: boolean = false) { +export function warn(text: string, padded = false) { if (padded) { const padding = '*'.repeat(text.length + 8); console.log( @@ -161,7 +161,7 @@ export function writeJSON(directory: string, filename: string, obj: any) { // Returns a \ b // Taken from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set#implementing_basic_set_operations export function setDifference(a: Set, b: Set) { - let diff = new Set(a); + const diff = new Set(a); for (const element of b) { diff.delete(element); } diff --git a/typescript/infra/tsconfig.json b/typescript/infra/tsconfig.json index bd5960865..4f2e2f5a5 100644 --- a/typescript/infra/tsconfig.json +++ b/typescript/infra/tsconfig.json @@ -4,7 +4,7 @@ "rootDir": "./" }, "exclude": ["./node_modules/", "./dist/", "./tmp.ts"], - "extends": "../../tsconfig.package.json", + "extends": "../../tsconfig.json", "include": [ "./*.ts", "./config/**/*.ts", diff --git a/typescript/sdk/.eslintrc.json b/typescript/sdk/.eslintrc.json deleted file mode 100644 index 94b97befc..000000000 --- a/typescript/sdk/.eslintrc.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "env": { - "node": true - }, - "root": true, - "parser": "@typescript-eslint/parser", - "plugins": ["@typescript-eslint"], - "extends": [ - "eslint:recommended", - "plugin:@typescript-eslint/recommended", - "prettier" - ], - "rules": { - "comma-dangle": ["error", "always-multiline"], - "semi": ["error", "always"], - "@typescript-eslint/explicit-module-boundary-types": ["error"], - "@typescript-eslint/no-non-null-assertion": ["error"], - "@typescript-eslint/no-explicit-any": ["error", { "ignoreRestArgs": true }] - } -} diff --git a/typescript/sdk/package.json b/typescript/sdk/package.json index 6af5fb118..a87ac3575 100644 --- a/typescript/sdk/package.json +++ b/typescript/sdk/package.json @@ -12,11 +12,8 @@ }, "devDependencies": { "@types/node": "^16.9.1", - "@typescript-eslint/eslint-plugin": "^4.33.0", - "@typescript-eslint/parser": "^4.33.0", "chai": "^4.3.6", "dotenv": "^10.0.0", - "eslint": "^7.32.0", "fs": "0.0.1-security", "mocha": "^9.2.2", "sinon": "^13.0.2" diff --git a/typescript/sdk/src/.eslintrc b/typescript/sdk/src/.eslintrc new file mode 100644 index 000000000..eb1e08414 --- /dev/null +++ b/typescript/sdk/src/.eslintrc @@ -0,0 +1,5 @@ +{ + "rules": { + "@typescript-eslint/explicit-module-boundary-types": ["error"] + } +} diff --git a/typescript/sdk/src/app.ts b/typescript/sdk/src/app.ts index eb58e24da..1a1ca22c1 100644 --- a/typescript/sdk/src/app.ts +++ b/typescript/sdk/src/app.ts @@ -38,7 +38,7 @@ export class AbacusApp< return this.get(chain).addresses; } - reconnect(chain: Chain, connection: Connection) { + reconnect(chain: Chain, connection: Connection): void { this.get(chain).reconnect(connection); } } diff --git a/typescript/sdk/src/chains.ts b/typescript/sdk/src/chains.ts index 5934d9477..cd8ba7acc 100644 --- a/typescript/sdk/src/chains.ts +++ b/typescript/sdk/src/chains.ts @@ -132,6 +132,7 @@ const _configs = { export const addSignerToConnection = (signer: ethers.Signer) => + // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types (_chain: Chain, connection: IChainConnection) => ({ ...connection, signer, diff --git a/typescript/sdk/src/contracts.ts b/typescript/sdk/src/contracts.ts index 9f8fd581f..1555c9da4 100644 --- a/typescript/sdk/src/contracts.ts +++ b/typescript/sdk/src/contracts.ts @@ -55,13 +55,13 @@ export abstract class AbacusContracts< this.contracts = Object.fromEntries(contractEntries); } - reconnect(connection: Connection) { + reconnect(connection: Connection): void { Object.values(this.contracts).forEach((contract: Contract) => contract.connect(connection), ); } - protected onlySigner(actual: types.Address, expected: types.Address) { + protected onlySigner(actual: types.Address, expected: types.Address): void { if (actual !== expected) { throw new Error(`Signer ${actual} must be ${expected} for this method`); } diff --git a/typescript/sdk/src/core/app.ts b/typescript/sdk/src/core/app.ts index 9e104be50..dd2ab8fb6 100644 --- a/typescript/sdk/src/core/app.ts +++ b/typescript/sdk/src/core/app.ts @@ -1,3 +1,5 @@ +import { Inbox, Outbox } from '@abacus-network/core'; + import { AbacusApp } from '../app'; import { MultiProvider } from '../provider'; import { ChainMap, ChainName, Remotes } from '../types'; @@ -33,7 +35,7 @@ export class AbacusCore extends AbacusApp< static fromEnvironment( name: E, multiProvider: MultiProvider, // TODO: fix networks - ) { + ): AbacusCore { return new AbacusCore(environments[name], multiProvider); } @@ -64,7 +66,7 @@ export class AbacusCore extends AbacusApp< getMailboxPair( origin: Remotes, destination: Local, - ) { + ): { outbox: Outbox; inbox: Inbox } { const outbox = this.getContracts(origin).outbox.outbox; const inbox = this.getContracts(destination).inboxes[origin].inbox; return { outbox, inbox }; diff --git a/typescript/sdk/src/core/contracts.ts b/typescript/sdk/src/core/contracts.ts index e8d67b64e..10d1e2a00 100644 --- a/typescript/sdk/src/core/contracts.ts +++ b/typescript/sdk/src/core/contracts.ts @@ -111,7 +111,7 @@ export class CoreContracts }; } - reconnect(connection: Connection) { + reconnect(connection: Connection): void { this.contracts.outbox.outbox.connect(connection); this.contracts.outbox.validatorManager.connect(connection); this.contracts.interchainGasPaymaster.connect(connection); @@ -123,12 +123,14 @@ export class CoreContracts }); } - getOutbox = () => this.contracts.outbox.outbox; + getOutbox = (): Outbox => this.contracts.outbox.outbox; - getOutboxValidatorManager = () => this.contracts.outbox.validatorManager; + getOutboxValidatorManager = (): OutboxValidatorManager => + this.contracts.outbox.validatorManager; - getInbox = (chain: Remotes) => this.contracts.inboxes[chain].inbox; + getInbox = (chain: Remotes): Inbox => + this.contracts.inboxes[chain].inbox; - getInboxValidatorManager = (chain: Remotes) => + getInboxValidatorManager = (chain: Remotes): InboxValidatorManager => this.contracts.inboxes[chain].validatorManager; } diff --git a/typescript/sdk/src/core/message.ts b/typescript/sdk/src/core/message.ts index 275677853..55d712697 100644 --- a/typescript/sdk/src/core/message.ts +++ b/typescript/sdk/src/core/message.ts @@ -48,7 +48,9 @@ export const resolveId = (nameOrDomain: NameOrDomain): number => ? ChainNameToDomainId[nameOrDomain] : nameOrDomain; -export const resolveNetworks = (message: ParsedMessage) => { +export const resolveNetworks = ( + message: ParsedMessage, +): { origin: ChainName; destination: ChainName } => { return { origin: resolveDomain(message.origin), destination: resolveDomain(message.destination), diff --git a/typescript/sdk/src/gas/calculator.ts b/typescript/sdk/src/gas/calculator.ts index d7ea7346c..7e3c46d90 100644 --- a/typescript/sdk/src/gas/calculator.ts +++ b/typescript/sdk/src/gas/calculator.ts @@ -173,7 +173,7 @@ export class InterchainGasCalculator { */ async estimatePaymentForMessage( message: ParsedMessage, - ) { + ): Promise { const destinationGas = await this.estimateHandleGasForMessage(message); return this.estimatePaymentForHandleGasAmount( message.origin, @@ -261,7 +261,7 @@ export class InterchainGasCalculator { * @param chain The chain. * @returns The number of decimals of `chain`'s native token. */ - nativeTokenDecimals(chain: Chain) { + nativeTokenDecimals(chain: Chain): number { return chainMetadata[chain].nativeTokenDecimals ?? DEFAULT_TOKEN_DECIMALS; } diff --git a/typescript/sdk/src/gas/token-prices.ts b/typescript/sdk/src/gas/token-prices.ts index b764e9f44..71ca95243 100644 --- a/typescript/sdk/src/gas/token-prices.ts +++ b/typescript/sdk/src/gas/token-prices.ts @@ -8,6 +8,7 @@ export interface TokenPriceGetter { // TODO implement in following PR export class DefaultTokenPriceGetter implements TokenPriceGetter { + // eslint-disable-next-line @typescript-eslint/no-unused-vars getNativeTokenUsdPrice(_chain: NameOrDomain): Promise { return Promise.resolve(FixedNumber.from('12.34')); } diff --git a/typescript/sdk/src/gas/utils.ts b/typescript/sdk/src/gas/utils.ts index b8a6ea2a6..803d41f82 100644 --- a/typescript/sdk/src/gas/utils.ts +++ b/typescript/sdk/src/gas/utils.ts @@ -15,10 +15,7 @@ export function bigToFixed(big: BigNumber): FixedNumber { * @param ceil If true, the ceiling of fixed is used. Otherwise, the floor is used. * @returns A BigNumber representation of a FixedNumber. */ -export function fixedToBig( - fixed: FixedNumber, - ceil: boolean = false, -): BigNumber { +export function fixedToBig(fixed: FixedNumber, ceil = false): BigNumber { const fixedAsInteger = ceil ? fixed.ceiling() : fixed.floor(); return BigNumber.from(fixedAsInteger.toFormat('fixed256x0').toString()); } @@ -33,7 +30,7 @@ export function fixedToBig( export function mulBigAndFixed( big: BigNumber, fixed: FixedNumber, - ceil: boolean = false, + ceil = false, ): BigNumber { // Converts big to a FixedNumber, multiplies it by fixed, and converts the product back // to a BigNumber. diff --git a/typescript/sdk/src/provider.ts b/typescript/sdk/src/provider.ts index 00bc0b59d..5dbf7e9ee 100644 --- a/typescript/sdk/src/provider.ts +++ b/typescript/sdk/src/provider.ts @@ -23,9 +23,10 @@ export class ChainConnection { this.confirmations = dc.confirmations ?? 0; } - getConnection = () => this.signer ?? this.provider; + getConnection = (): ethers.providers.Provider | ethers.Signer => + this.signer ?? this.provider; - getAddress = () => this.signer?.getAddress(); + getAddress = (): Promise | undefined => this.signer?.getAddress(); } export class MultiProvider< @@ -39,7 +40,7 @@ export class MultiProvider< ), ); } - getChainConnection(chain: Chain) { + getChainConnection(chain: Chain): ChainMap[Chain] { return this.get(chain); } // This doesn't work on hardhat providers so we skip for now diff --git a/typescript/sdk/src/utils.ts b/typescript/sdk/src/utils.ts index 5557e942d..26310d428 100644 --- a/typescript/sdk/src/utils.ts +++ b/typescript/sdk/src/utils.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ import { BytesLike, arrayify, hexlify } from '@ethersproject/bytes'; import { ethers } from 'ethers'; @@ -69,7 +70,7 @@ export class MultiGeneric { } map(fn: (n: Chain, dc: Value) => Output) { - let entries: [Chain, Output][] = []; + const entries: [Chain, Output][] = []; const chains = this.chains(); for (const chain of chains) { entries.push([chain, fn(chain, this.chainMap[chain])]); diff --git a/typescript/sdk/tsconfig.json b/typescript/sdk/tsconfig.json index 21c127ea1..119d63d25 100644 --- a/typescript/sdk/tsconfig.json +++ b/typescript/sdk/tsconfig.json @@ -1,12 +1,9 @@ { - "extends": "../../tsconfig.package.json", + "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "./dist/", "rootDir": "./src/" }, "exclude": ["./node_modules/", "./dist/", "./test/"], - "include": [ - "./src/*.ts", - "./src/**/*.ts" - ] + "include": ["./src/*.ts", "./src/**/*.ts"] } diff --git a/typescript/tsconfig.json b/typescript/tsconfig.json new file mode 100644 index 000000000..3c43903cf --- /dev/null +++ b/typescript/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "../tsconfig.json" +} diff --git a/typescript/utils/src/utils.ts b/typescript/utils/src/utils.ts index 856e16b65..e2d9cc68a 100644 --- a/typescript/utils/src/utils.ts +++ b/typescript/utils/src/utils.ts @@ -84,7 +84,7 @@ export function destinationAndNonce( .add(ethers.BigNumber.from(sequence)); } -export function domainHash(domain: Number): string { +export function domainHash(domain: number): string { return ethers.utils.solidityKeccak256( ['uint32', 'string'], [domain, 'ABACUS'], diff --git a/typescript/utils/src/validator.ts b/typescript/utils/src/validator.ts index cdbcb3bc2..d00522cdb 100644 --- a/typescript/utils/src/validator.ts +++ b/typescript/utils/src/validator.ts @@ -37,9 +37,9 @@ export class Validator { } async signCheckpoint(root: types.HexString, index: number) { - let message = this.message(root, index); - let msgHash = ethers.utils.arrayify(ethers.utils.keccak256(message)); - let signature = await this.signer.signMessage(msgHash); + const message = this.message(root, index); + const msgHash = ethers.utils.arrayify(ethers.utils.keccak256(message)); + const signature = await this.signer.signMessage(msgHash); return { origin: this.localDomain, root, diff --git a/typescript/utils/tsconfig.json b/typescript/utils/tsconfig.json index 02a6d71dd..821816744 100644 --- a/typescript/utils/tsconfig.json +++ b/typescript/utils/tsconfig.json @@ -4,9 +4,6 @@ "rootDir": "./" }, "exclude": ["./node_modules/", "./dist/", "./tmp.ts"], - "extends": "../../tsconfig.package.json", - "include": [ - "./index.ts", - "./src/*.ts" - ] + "extends": "../../tsconfig.json", + "include": ["./index.ts", "./src/*.ts"] } diff --git a/yarn.lock b/yarn.lock index c6e7931f7..2a53bb7c7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -50,7 +50,6 @@ __metadata: solhint-plugin-prettier: ^0.0.5 solidity-coverage: ^0.7.14 ts-generator: ^0.1.1 - ts-node: ^10.1.0 typechain: ^5.0.0 languageName: unknown linkType: soft @@ -127,14 +126,16 @@ __metadata: resolution: "@abacus-network/monorepo@workspace:." dependencies: "@trivago/prettier-plugin-sort-imports": ^3.2.0 - eslint: ^7.32.0 - eslint-config-prettier: ^8.3.0 + "@typescript-eslint/eslint-plugin": ^5.27.0 + "@typescript-eslint/parser": ^5.27.0 + eslint: ^8.16.0 + eslint-config-prettier: ^8.5.0 husky: ^8.0.0 - lint-staged: ^12.4.2 + lint-staged: ^12.4.3 prettier: ^2.4.1 prettier-plugin-solidity: ^1.0.0-beta.5 - ts-node: ^10.1.0 - typescript: ^4.3.5 + ts-node: ^10.8.0 + typescript: ^4.7.2 languageName: unknown linkType: soft @@ -147,12 +148,9 @@ __metadata: "@ethersproject/bignumber": ^5.5.0 "@ethersproject/bytes": ^5.5.0 "@types/node": ^16.9.1 - "@typescript-eslint/eslint-plugin": ^4.33.0 - "@typescript-eslint/parser": ^4.33.0 celo-ethers-provider: ^0.0.0 chai: ^4.3.6 dotenv: ^10.0.0 - eslint: ^7.32.0 ethers: ^5.4.7 fs: 0.0.1-security mocha: ^9.2.2 @@ -1926,15 +1924,6 @@ __metadata: languageName: node linkType: hard -"@babel/code-frame@npm:7.12.11": - version: 7.12.11 - resolution: "@babel/code-frame@npm:7.12.11" - dependencies: - "@babel/highlight": ^7.10.4 - checksum: 3963eff3ebfb0e091c7e6f99596ef4b258683e4ba8a134e4e95f77afe85be5c931e184fff6435fb4885d12eba04a5e25532f7fbc292ca13b48e7da943474e2f3 - languageName: node - linkType: hard - "@babel/code-frame@npm:^7.0.0, @babel/code-frame@npm:^7.12.13, @babel/code-frame@npm:^7.16.7": version: 7.16.7 resolution: "@babel/code-frame@npm:7.16.7" @@ -2107,7 +2096,7 @@ __metadata: languageName: node linkType: hard -"@babel/highlight@npm:^7.10.4, @babel/highlight@npm:^7.16.7": +"@babel/highlight@npm:^7.16.7": version: 7.17.9 resolution: "@babel/highlight@npm:7.17.9" dependencies: @@ -2203,19 +2192,12 @@ __metadata: languageName: node linkType: hard -"@cspotcode/source-map-consumer@npm:0.8.0": - version: 0.8.0 - resolution: "@cspotcode/source-map-consumer@npm:0.8.0" - checksum: c0c16ca3d2f58898f1bd74c4f41a189dbcc202e642e60e489cbcc2e52419c4e89bdead02c886a12fb13ea37798ede9e562b2321df997ebc210ae9bd881561b4e - languageName: node - linkType: hard - -"@cspotcode/source-map-support@npm:0.7.0": - version: 0.7.0 - resolution: "@cspotcode/source-map-support@npm:0.7.0" +"@cspotcode/source-map-support@npm:^0.8.0": + version: 0.8.1 + resolution: "@cspotcode/source-map-support@npm:0.8.1" dependencies: - "@cspotcode/source-map-consumer": 0.8.0 - checksum: 9faddda7757cd778b5fd6812137b2cc265810043680d6399acc20441668fafcdc874053be9dccd0d9110087287bfad27eb3bf342f72bceca9aa9059f5d0c4be8 + "@jridgewell/trace-mapping": 0.3.9 + checksum: 5718f267085ed8edb3e7ef210137241775e607ee18b77d95aa5bd7514f47f5019aa2d82d96b3bf342ef7aa890a346fa1044532ff7cc3009e7d24fce3ce6200fa languageName: node linkType: hard @@ -2239,20 +2221,20 @@ __metadata: languageName: node linkType: hard -"@eslint/eslintrc@npm:^0.4.3": - version: 0.4.3 - resolution: "@eslint/eslintrc@npm:0.4.3" +"@eslint/eslintrc@npm:^1.3.0": + version: 1.3.0 + resolution: "@eslint/eslintrc@npm:1.3.0" dependencies: ajv: ^6.12.4 - debug: ^4.1.1 - espree: ^7.3.0 - globals: ^13.9.0 - ignore: ^4.0.6 + debug: ^4.3.2 + espree: ^9.3.2 + globals: ^13.15.0 + ignore: ^5.2.0 import-fresh: ^3.2.1 - js-yaml: ^3.13.1 - minimatch: ^3.0.4 + js-yaml: ^4.1.0 + minimatch: ^3.1.2 strip-json-comments: ^3.1.1 - checksum: 03a7704150b868c318aab6a94d87a33d30dc2ec579d27374575014f06237ba1370ae11178db772f985ef680d469dc237e7b16a1c5d8edaaeb8c3733e7a95a6d3 + checksum: a1e734ad31a8b5328dce9f479f185fd4fc83dd7f06c538e1fa457fd8226b89602a55cc6458cd52b29573b01cdfaf42331be8cfc1fec732570086b591f4ed6515 languageName: node linkType: hard @@ -2852,18 +2834,18 @@ __metadata: languageName: node linkType: hard -"@humanwhocodes/config-array@npm:^0.5.0": - version: 0.5.0 - resolution: "@humanwhocodes/config-array@npm:0.5.0" +"@humanwhocodes/config-array@npm:^0.9.2": + version: 0.9.5 + resolution: "@humanwhocodes/config-array@npm:0.9.5" dependencies: - "@humanwhocodes/object-schema": ^1.2.0 + "@humanwhocodes/object-schema": ^1.2.1 debug: ^4.1.1 minimatch: ^3.0.4 - checksum: 44ee6a9f05d93dd9d5935a006b17572328ba9caff8002442f601736cbda79c580cc0f5a49ce9eb88fbacc5c3a6b62098357c2e95326cd17bb9f1a6c61d6e95e7 + checksum: 8ba6281bc0590f6c6eadeefc14244b5a3e3f5903445aadd1a32099ed80e753037674026ce1b3c945ab93561bea5eb29e3c5bff67060e230c295595ba517a3492 languageName: node linkType: hard -"@humanwhocodes/object-schema@npm:^1.2.0": +"@humanwhocodes/object-schema@npm:^1.2.1": version: 1.2.1 resolution: "@humanwhocodes/object-schema@npm:1.2.1" checksum: a824a1ec31591231e4bad5787641f59e9633827d0a2eaae131a288d33c9ef0290bd16fda8da6f7c0fcb014147865d12118df10db57f27f41e20da92369fcb3f1 @@ -2880,6 +2862,13 @@ __metadata: languageName: node linkType: hard +"@jridgewell/resolve-uri@npm:^3.0.3": + version: 3.0.7 + resolution: "@jridgewell/resolve-uri@npm:3.0.7" + checksum: 94f454f4cef8f0acaad85745fd3ca6cd0d62ef731cf9f952ecb89b8b2ce5e20998cd52be31311cedc5fa5b28b1708a15f3ad9df0fe1447ee4f42959b036c4b5b + languageName: node + linkType: hard + "@jridgewell/set-array@npm:^1.0.0": version: 1.1.0 resolution: "@jridgewell/set-array@npm:1.1.0" @@ -2894,6 +2883,16 @@ __metadata: languageName: node linkType: hard +"@jridgewell/trace-mapping@npm:0.3.9": + version: 0.3.9 + resolution: "@jridgewell/trace-mapping@npm:0.3.9" + dependencies: + "@jridgewell/resolve-uri": ^3.0.3 + "@jridgewell/sourcemap-codec": ^1.4.10 + checksum: d89597752fd88d3f3480845691a05a44bd21faac18e2185b6f436c3b0fd0c5a859fbbd9aaa92050c4052caf325ad3e10e2e1d1b64327517471b7d51babc0ddef + languageName: node + linkType: hard + "@metamask/eth-sig-util@npm:^4.0.0": version: 4.0.1 resolution: "@metamask/eth-sig-util@npm:4.0.1" @@ -3443,7 +3442,7 @@ __metadata: languageName: node linkType: hard -"@types/json-schema@npm:^7.0.7": +"@types/json-schema@npm:^7.0.9": version: 7.0.11 resolution: "@types/json-schema@npm:7.0.11" checksum: 527bddfe62db9012fccd7627794bd4c71beb77601861055d87e3ee464f2217c85fca7a4b56ae677478367bbd248dbde13553312b7d4dbc702a2f2bbf60c4018d @@ -3668,103 +3667,120 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/eslint-plugin@npm:^4.33.0": - version: 4.33.0 - resolution: "@typescript-eslint/eslint-plugin@npm:4.33.0" +"@typescript-eslint/eslint-plugin@npm:^5.27.0": + version: 5.27.0 + resolution: "@typescript-eslint/eslint-plugin@npm:5.27.0" dependencies: - "@typescript-eslint/experimental-utils": 4.33.0 - "@typescript-eslint/scope-manager": 4.33.0 - debug: ^4.3.1 + "@typescript-eslint/scope-manager": 5.27.0 + "@typescript-eslint/type-utils": 5.27.0 + "@typescript-eslint/utils": 5.27.0 + debug: ^4.3.4 functional-red-black-tree: ^1.0.1 - ignore: ^5.1.8 - regexpp: ^3.1.0 - semver: ^7.3.5 + ignore: ^5.2.0 + regexpp: ^3.2.0 + semver: ^7.3.7 tsutils: ^3.21.0 peerDependencies: - "@typescript-eslint/parser": ^4.0.0 - eslint: ^5.0.0 || ^6.0.0 || ^7.0.0 + "@typescript-eslint/parser": ^5.0.0 + eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 peerDependenciesMeta: typescript: optional: true - checksum: d74855d0a5ffe0b2f362ec02fcd9301d39a53fb4155b9bd0cb15a0a31d065143129ebf98df9d86af4b6f74de1d423a4c0d8c0095520844068117453afda5bc4f + checksum: af7970f90c511641c332b7abecc53523fbbcb19e59ec52df9679f02047ddd5fd5e9ce3ca9359b17674ac7e20e380995861482fb6e60049fe8facd766c2bd85fe languageName: node linkType: hard -"@typescript-eslint/experimental-utils@npm:4.33.0": - version: 4.33.0 - resolution: "@typescript-eslint/experimental-utils@npm:4.33.0" +"@typescript-eslint/parser@npm:^5.27.0": + version: 5.27.0 + resolution: "@typescript-eslint/parser@npm:5.27.0" dependencies: - "@types/json-schema": ^7.0.7 - "@typescript-eslint/scope-manager": 4.33.0 - "@typescript-eslint/types": 4.33.0 - "@typescript-eslint/typescript-estree": 4.33.0 - eslint-scope: ^5.1.1 - eslint-utils: ^3.0.0 + "@typescript-eslint/scope-manager": 5.27.0 + "@typescript-eslint/types": 5.27.0 + "@typescript-eslint/typescript-estree": 5.27.0 + debug: ^4.3.4 peerDependencies: - eslint: "*" - checksum: f859800ada0884f92db6856f24efcb1d073ac9883ddc2b1aa9339f392215487895bed8447ebce3741e8141bb32e545244abef62b73193ba9a8a0527c523aabae + eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + peerDependenciesMeta: + typescript: + optional: true + checksum: 40ccdc481f871c296ee419e886ffd6f89ec23f6b10dbb2847c7e89bfd2234c6be23c49ab92d2965e16cd4c3cf378010e3dcd72d34f82b1e2ca8b5c812133fb00 languageName: node linkType: hard -"@typescript-eslint/parser@npm:^4.33.0": - version: 4.33.0 - resolution: "@typescript-eslint/parser@npm:4.33.0" +"@typescript-eslint/scope-manager@npm:5.27.0": + version: 5.27.0 + resolution: "@typescript-eslint/scope-manager@npm:5.27.0" dependencies: - "@typescript-eslint/scope-manager": 4.33.0 - "@typescript-eslint/types": 4.33.0 - "@typescript-eslint/typescript-estree": 4.33.0 - debug: ^4.3.1 - peerDependencies: - eslint: ^5.0.0 || ^6.0.0 || ^7.0.0 - peerDependenciesMeta: - typescript: - optional: true - checksum: 102457eae1acd516211098fea081c8a2ed728522bbda7f5a557b6ef23d88970514f9a0f6285d53fca134d3d4d7d17822b5d5e12438d5918df4d1f89cc9e67d57 + "@typescript-eslint/types": 5.27.0 + "@typescript-eslint/visitor-keys": 5.27.0 + checksum: 84eb2d6241a6644c622b473c060bb7a227c2a82e8af8ddcf654fb63716e1b3c6fe1b5d747d032d85594c0ad147d95aabc2b217d4af574b55eab93910e0c292ce languageName: node linkType: hard -"@typescript-eslint/scope-manager@npm:4.33.0": - version: 4.33.0 - resolution: "@typescript-eslint/scope-manager@npm:4.33.0" +"@typescript-eslint/type-utils@npm:5.27.0": + version: 5.27.0 + resolution: "@typescript-eslint/type-utils@npm:5.27.0" dependencies: - "@typescript-eslint/types": 4.33.0 - "@typescript-eslint/visitor-keys": 4.33.0 - checksum: 9a25fb7ba7c725ea7227a24d315b0f6aacbad002e2549a049edf723c1d3615c22f5c301f0d7d615b377f2cdf2f3519d97e79af0c459de6ef8d2aaf0906dff13e + "@typescript-eslint/utils": 5.27.0 + debug: ^4.3.4 + tsutils: ^3.21.0 + peerDependencies: + eslint: "*" + peerDependenciesMeta: + typescript: + optional: true + checksum: 21ef57ecc0dfa085e7ce8f7714d143993f592004086e37582cb6ab5924cb3358267b607e0701ce43737e01f46fb33d66e3f3428fbb7be6e64971d4c26f73c265 languageName: node linkType: hard -"@typescript-eslint/types@npm:4.33.0": - version: 4.33.0 - resolution: "@typescript-eslint/types@npm:4.33.0" - checksum: 3baae1ca35872421b4eb60f5d3f3f32dc1d513f2ae0a67dee28c7d159fd7a43ed0d11a8a5a0f0c2d38507ffa036fc7c511cb0f18a5e8ac524b3ebde77390ec53 +"@typescript-eslint/types@npm:5.27.0": + version: 5.27.0 + resolution: "@typescript-eslint/types@npm:5.27.0" + checksum: d19802bb7bc8202885a47118e196ad9a26b686f00da5aa71a84974c1e838c5e3a36f54116605c46ffe909ccf856a49623f2a095fd05243b4fe4fecfe5cecb89c languageName: node linkType: hard -"@typescript-eslint/typescript-estree@npm:4.33.0": - version: 4.33.0 - resolution: "@typescript-eslint/typescript-estree@npm:4.33.0" +"@typescript-eslint/typescript-estree@npm:5.27.0": + version: 5.27.0 + resolution: "@typescript-eslint/typescript-estree@npm:5.27.0" dependencies: - "@typescript-eslint/types": 4.33.0 - "@typescript-eslint/visitor-keys": 4.33.0 - debug: ^4.3.1 - globby: ^11.0.3 - is-glob: ^4.0.1 - semver: ^7.3.5 + "@typescript-eslint/types": 5.27.0 + "@typescript-eslint/visitor-keys": 5.27.0 + debug: ^4.3.4 + globby: ^11.1.0 + is-glob: ^4.0.3 + semver: ^7.3.7 tsutils: ^3.21.0 peerDependenciesMeta: typescript: optional: true - checksum: 2566984390c76bd95f43240057215c068c69769e406e27aba41e9f21fd300074d6772e4983fa58fe61e80eb5550af1548d2e31e80550d92ba1d051bb00fe6f5c + checksum: a0f14c332cd293a100399172c9ae498c230c8c205ab74565ea2de08a0bd860af829a9c4dde1888df89667fa0bc29048bc33993eb9445d2689fa2dfcec55c4915 languageName: node linkType: hard -"@typescript-eslint/visitor-keys@npm:4.33.0": - version: 4.33.0 - resolution: "@typescript-eslint/visitor-keys@npm:4.33.0" +"@typescript-eslint/utils@npm:5.27.0": + version: 5.27.0 + resolution: "@typescript-eslint/utils@npm:5.27.0" dependencies: - "@typescript-eslint/types": 4.33.0 - eslint-visitor-keys: ^2.0.0 - checksum: 59953e474ad4610c1aa23b2b1a964445e2c6201521da6367752f37939d854352bbfced5c04ea539274065e012b1337ba3ffa49c2647a240a4e87155378ba9873 + "@types/json-schema": ^7.0.9 + "@typescript-eslint/scope-manager": 5.27.0 + "@typescript-eslint/types": 5.27.0 + "@typescript-eslint/typescript-estree": 5.27.0 + eslint-scope: ^5.1.1 + eslint-utils: ^3.0.0 + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + checksum: ed823528c3b7f8c71a44ea0481896c46178e361e89003c63736de6ece45cb771defea13b505f0adb517c59f55a95d0b5f1bb990f7a24d3a2597aa045bba0a7bf + languageName: node + linkType: hard + +"@typescript-eslint/visitor-keys@npm:5.27.0": + version: 5.27.0 + resolution: "@typescript-eslint/visitor-keys@npm:5.27.0" + dependencies: + "@typescript-eslint/types": 5.27.0 + eslint-visitor-keys: ^3.3.0 + checksum: 7781f35e25a09d0986b4ba97c707102394cf94738a92d68eca6382b00ffba1b0fac3e937ca4ee6266295dd40ec837a61889fd715f594549f2c3d837594999c29 languageName: node linkType: hard @@ -3877,7 +3893,7 @@ __metadata: languageName: node linkType: hard -"acorn-jsx@npm:^5.0.0, acorn-jsx@npm:^5.3.1": +"acorn-jsx@npm:^5.0.0, acorn-jsx@npm:^5.3.2": version: 5.3.2 resolution: "acorn-jsx@npm:5.3.2" peerDependencies: @@ -3902,16 +3918,7 @@ __metadata: languageName: node linkType: hard -"acorn@npm:^7.4.0": - version: 7.4.1 - resolution: "acorn@npm:7.4.1" - bin: - acorn: bin/acorn - checksum: 1860f23c2107c910c6177b7b7be71be350db9e1080d814493fae143ae37605189504152d1ba8743ba3178d0b37269ce1ffc42b101547fdc1827078f82671e407 - languageName: node - linkType: hard - -"acorn@npm:^8.4.1": +"acorn@npm:^8.4.1, acorn@npm:^8.7.1": version: 8.7.1 resolution: "acorn@npm:8.7.1" bin: @@ -3990,18 +3997,6 @@ __metadata: languageName: node linkType: hard -"ajv@npm:^8.0.1": - version: 8.11.0 - resolution: "ajv@npm:8.11.0" - dependencies: - fast-deep-equal: ^3.1.1 - json-schema-traverse: ^1.0.0 - require-from-string: ^2.0.2 - uri-js: ^4.2.2 - checksum: 5e0ff226806763be73e93dd7805b634f6f5921e3e90ca04acdf8db81eed9d8d3f0d4c5f1213047f45ebbf8047ffe0c840fa1ef2ec42c3a644899f69aa72b5bef - languageName: node - linkType: hard - "amdefine@npm:>=0.0.4": version: 1.0.1 resolution: "amdefine@npm:1.0.1" @@ -6012,10 +6007,10 @@ __metadata: languageName: node linkType: hard -"commander@npm:^8.3.0": - version: 8.3.0 - resolution: "commander@npm:8.3.0" - checksum: 0f82321821fc27b83bd409510bb9deeebcfa799ff0bf5d102128b500b7af22872c0c92cb6a0ebc5a4cf19c6b550fba9cedfa7329d18c6442a625f851377bacf0 +"commander@npm:^9.3.0": + version: 9.3.0 + resolution: "commander@npm:9.3.0" + checksum: d421ce66fee25792a1470c69aa8d1b86434bf873a96483aa92c8267f81a6f20c6f7c426f5e82f88ac50a8ec4855d3f2787aebcdef8aa559e1080a2337a95a217 languageName: node linkType: hard @@ -6330,7 +6325,7 @@ __metadata: languageName: node linkType: hard -"debug@npm:4, debug@npm:^4.0.1, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.3.1, debug@npm:^4.3.3, debug@npm:^4.3.4": +"debug@npm:4, debug@npm:^4.0.1, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.3.2, debug@npm:^4.3.3, debug@npm:^4.3.4": version: 4.3.4 resolution: "debug@npm:4.3.4" dependencies: @@ -6784,7 +6779,7 @@ __metadata: languageName: node linkType: hard -"enquirer@npm:^2.3.0, enquirer@npm:^2.3.5": +"enquirer@npm:^2.3.0": version: 2.3.6 resolution: "enquirer@npm:2.3.6" dependencies: @@ -6952,7 +6947,7 @@ __metadata: languageName: node linkType: hard -"eslint-config-prettier@npm:^8.3.0": +"eslint-config-prettier@npm:^8.5.0": version: 8.5.0 resolution: "eslint-config-prettier@npm:8.5.0" peerDependencies: @@ -6983,21 +6978,22 @@ __metadata: languageName: node linkType: hard -"eslint-utils@npm:^1.3.1": - version: 1.4.3 - resolution: "eslint-utils@npm:1.4.3" +"eslint-scope@npm:^7.1.1": + version: 7.1.1 + resolution: "eslint-scope@npm:7.1.1" dependencies: - eslint-visitor-keys: ^1.1.0 - checksum: a20630e686034107138272f245c460f6d77705d1f4bb0628c1a1faf59fc800f441188916b3ec3b957394dc405aa200a3017dfa2b0fff0976e307a4e645a18d1e + esrecurse: ^4.3.0 + estraverse: ^5.2.0 + checksum: 9f6e974ab2db641ca8ab13508c405b7b859e72afe9f254e8131ff154d2f40c99ad4545ce326fd9fde3212ff29707102562a4834f1c48617b35d98c71a97fbf3e languageName: node linkType: hard -"eslint-utils@npm:^2.1.0": - version: 2.1.0 - resolution: "eslint-utils@npm:2.1.0" +"eslint-utils@npm:^1.3.1": + version: 1.4.3 + resolution: "eslint-utils@npm:1.4.3" dependencies: eslint-visitor-keys: ^1.1.0 - checksum: 27500938f348da42100d9e6ad03ae29b3de19ba757ae1a7f4a087bdcf83ac60949bbb54286492ca61fac1f5f3ac8692dd21537ce6214240bf95ad0122f24d71d + checksum: a20630e686034107138272f245c460f6d77705d1f4bb0628c1a1faf59fc800f441188916b3ec3b957394dc405aa200a3017dfa2b0fff0976e307a4e645a18d1e languageName: node linkType: hard @@ -7012,7 +7008,7 @@ __metadata: languageName: node linkType: hard -"eslint-visitor-keys@npm:^1.0.0, eslint-visitor-keys@npm:^1.1.0, eslint-visitor-keys@npm:^1.3.0": +"eslint-visitor-keys@npm:^1.0.0, eslint-visitor-keys@npm:^1.1.0": version: 1.3.0 resolution: "eslint-visitor-keys@npm:1.3.0" checksum: 37a19b712f42f4c9027e8ba98c2b06031c17e0c0a4c696cd429bd9ee04eb43889c446f2cd545e1ff51bef9593fcec94ecd2c2ef89129fcbbf3adadbef520376a @@ -7026,6 +7022,13 @@ __metadata: languageName: node linkType: hard +"eslint-visitor-keys@npm:^3.3.0": + version: 3.3.0 + resolution: "eslint-visitor-keys@npm:3.3.0" + checksum: d59e68a7c5a6d0146526b0eec16ce87fbf97fe46b8281e0d41384224375c4e52f5ffb9e16d48f4ea50785cde93f766b0c898e31ab89978d88b0e1720fbfb7808 + languageName: node + linkType: hard + "eslint@npm:^5.6.0": version: 5.16.0 resolution: "eslint@npm:5.16.0" @@ -7072,53 +7075,48 @@ __metadata: languageName: node linkType: hard -"eslint@npm:^7.32.0": - version: 7.32.0 - resolution: "eslint@npm:7.32.0" +"eslint@npm:^8.16.0": + version: 8.16.0 + resolution: "eslint@npm:8.16.0" dependencies: - "@babel/code-frame": 7.12.11 - "@eslint/eslintrc": ^0.4.3 - "@humanwhocodes/config-array": ^0.5.0 + "@eslint/eslintrc": ^1.3.0 + "@humanwhocodes/config-array": ^0.9.2 ajv: ^6.10.0 chalk: ^4.0.0 cross-spawn: ^7.0.2 - debug: ^4.0.1 + debug: ^4.3.2 doctrine: ^3.0.0 - enquirer: ^2.3.5 escape-string-regexp: ^4.0.0 - eslint-scope: ^5.1.1 - eslint-utils: ^2.1.0 - eslint-visitor-keys: ^2.0.0 - espree: ^7.3.1 + eslint-scope: ^7.1.1 + eslint-utils: ^3.0.0 + eslint-visitor-keys: ^3.3.0 + espree: ^9.3.2 esquery: ^1.4.0 esutils: ^2.0.2 fast-deep-equal: ^3.1.3 file-entry-cache: ^6.0.1 functional-red-black-tree: ^1.0.1 - glob-parent: ^5.1.2 - globals: ^13.6.0 - ignore: ^4.0.6 + glob-parent: ^6.0.1 + globals: ^13.15.0 + ignore: ^5.2.0 import-fresh: ^3.0.0 imurmurhash: ^0.1.4 is-glob: ^4.0.0 - js-yaml: ^3.13.1 + js-yaml: ^4.1.0 json-stable-stringify-without-jsonify: ^1.0.1 levn: ^0.4.1 lodash.merge: ^4.6.2 - minimatch: ^3.0.4 + minimatch: ^3.1.2 natural-compare: ^1.4.0 optionator: ^0.9.1 - progress: ^2.0.0 - regexpp: ^3.1.0 - semver: ^7.2.1 - strip-ansi: ^6.0.0 + regexpp: ^3.2.0 + strip-ansi: ^6.0.1 strip-json-comments: ^3.1.0 - table: ^6.0.9 text-table: ^0.2.0 v8-compile-cache: ^2.0.3 bin: eslint: bin/eslint.js - checksum: cc85af9985a3a11085c011f3d27abe8111006d34cc274291b3c4d7bea51a4e2ff6135780249becd919ba7f6d6d1ecc38a6b73dacb6a7be08d38453b344dc8d37 + checksum: 654a0200b49dc07280673fee13cdfb04326466790e031dfa9660b69fba3b1cf766a51504328f9de56bd18e6b5eb7578985cf29dc7f016c5ec851220ff9db95eb languageName: node linkType: hard @@ -7133,14 +7131,14 @@ __metadata: languageName: node linkType: hard -"espree@npm:^7.3.0, espree@npm:^7.3.1": - version: 7.3.1 - resolution: "espree@npm:7.3.1" +"espree@npm:^9.3.2": + version: 9.3.2 + resolution: "espree@npm:9.3.2" dependencies: - acorn: ^7.4.0 - acorn-jsx: ^5.3.1 - eslint-visitor-keys: ^1.3.0 - checksum: aa9b50dcce883449af2e23bc2b8d9abb77118f96f4cb313935d6b220f77137eaef7724a83c3f6243b96bc0e4ab14766198e60818caad99f9519ae5a336a39b45 + acorn: ^8.7.1 + acorn-jsx: ^5.3.2 + eslint-visitor-keys: ^3.3.0 + checksum: 9a790d6779847051e87f70d720a0f6981899a722419e80c92ab6dee01e1ab83b8ce52d11b4dc96c2c490182efb5a4c138b8b0d569205bfe1cd4629e658e58c30 languageName: node linkType: hard @@ -8683,6 +8681,15 @@ __metadata: languageName: node linkType: hard +"glob-parent@npm:^6.0.1": + version: 6.0.2 + resolution: "glob-parent@npm:6.0.2" + dependencies: + is-glob: ^4.0.3 + checksum: c13ee97978bef4f55106b71e66428eb1512e71a7466ba49025fc2aec59a5bfb0954d5abd58fc5ee6c9b076eef4e1f6d3375c2e964b88466ca390da4419a786a8 + languageName: node + linkType: hard + "glob@npm:7.1.3": version: 7.1.3 resolution: "glob@npm:7.1.3" @@ -8775,12 +8782,12 @@ __metadata: languageName: node linkType: hard -"globals@npm:^13.6.0, globals@npm:^13.9.0": - version: 13.13.0 - resolution: "globals@npm:13.13.0" +"globals@npm:^13.15.0": + version: 13.15.0 + resolution: "globals@npm:13.15.0" dependencies: type-fest: ^0.20.2 - checksum: c55ea8fd3afecb72567bac41605577e19e68476993dfb0ca4c49b86075af5f0ae3f0f5502525f69010f7c5ea5db6a1c540a80a4f80ebdfb2f686d87b0f05d7e9 + checksum: 383ade0873b2ab29ce6d143466c203ed960491575bc97406395e5c8434026fb02472ab2dfff5bc16689b8460269b18fda1047975295cd0183904385c51258bae languageName: node linkType: hard @@ -8807,7 +8814,7 @@ __metadata: languageName: node linkType: hard -"globby@npm:^11.0.3": +"globby@npm:^11.1.0": version: 11.1.0 resolution: "globby@npm:11.1.0" dependencies: @@ -9336,7 +9343,7 @@ __metadata: languageName: node linkType: hard -"ignore@npm:^5.1.1, ignore@npm:^5.1.8, ignore@npm:^5.2.0": +"ignore@npm:^5.1.1, ignore@npm:^5.2.0": version: 5.2.0 resolution: "ignore@npm:5.2.0" checksum: 6b1f926792d614f64c6c83da3a1f9c83f6196c2839aa41e1e32dd7b8d174cef2e329d75caabb62cb61ce9dc432f75e67d07d122a037312db7caa73166a1bdb77 @@ -9759,7 +9766,7 @@ __metadata: languageName: node linkType: hard -"is-glob@npm:^4.0.0, is-glob@npm:^4.0.1, is-glob@npm:~4.0.1": +"is-glob@npm:^4.0.0, is-glob@npm:^4.0.1, is-glob@npm:^4.0.3, is-glob@npm:~4.0.1": version: 4.0.3 resolution: "is-glob@npm:4.0.3" dependencies: @@ -10081,7 +10088,7 @@ __metadata: languageName: node linkType: hard -"js-yaml@npm:4.1.0": +"js-yaml@npm:4.1.0, js-yaml@npm:^4.1.0": version: 4.1.0 resolution: "js-yaml@npm:4.1.0" dependencies: @@ -10177,13 +10184,6 @@ __metadata: languageName: node linkType: hard -"json-schema-traverse@npm:^1.0.0": - version: 1.0.0 - resolution: "json-schema-traverse@npm:1.0.0" - checksum: 02f2f466cdb0362558b2f1fd5e15cce82ef55d60cd7f8fa828cf35ba74330f8d767fcae5c5c2adb7851fa811766c694b9405810879bc4e1ddd78a7c0e03658ad - languageName: node - linkType: hard - "json-schema@npm:0.4.0": version: 0.4.0 resolution: "json-schema@npm:0.4.0" @@ -10659,38 +10659,38 @@ __metadata: languageName: node linkType: hard -"lilconfig@npm:2.0.4": - version: 2.0.4 - resolution: "lilconfig@npm:2.0.4" - checksum: 02ae530aa49218d782eb79e92c600ea5220828987f85aa3403fa512cadc7efe38c0ac7d0cd2edf600ad3fae1f6c1752f5b4bb78c0d9950435b044d53d507c9e1 +"lilconfig@npm:2.0.5": + version: 2.0.5 + resolution: "lilconfig@npm:2.0.5" + checksum: f7bb9e42656f06930ad04e583026f087508ae408d3526b8b54895e934eb2a966b7aafae569656f2c79a29fe6d779b3ec44ba577e80814734c8655d6f71cdf2d1 languageName: node linkType: hard -"lint-staged@npm:^12.4.2": - version: 12.4.2 - resolution: "lint-staged@npm:12.4.2" +"lint-staged@npm:^12.4.3": + version: 12.4.3 + resolution: "lint-staged@npm:12.4.3" dependencies: cli-truncate: ^3.1.0 colorette: ^2.0.16 - commander: ^8.3.0 - debug: ^4.3.3 + commander: ^9.3.0 + debug: ^4.3.4 execa: ^5.1.1 - lilconfig: 2.0.4 - listr2: ^4.0.1 - micromatch: ^4.0.4 + lilconfig: 2.0.5 + listr2: ^4.0.5 + micromatch: ^4.0.5 normalize-path: ^3.0.0 - object-inspect: ^1.12.0 + object-inspect: ^1.12.2 pidtree: ^0.5.0 string-argv: ^0.3.1 - supports-color: ^9.2.1 + supports-color: ^9.2.2 yaml: ^1.10.2 bin: lint-staged: bin/lint-staged.js - checksum: cd2c1d5e79ad6cdcfc3f56dad1c7b72fbb6fb566dfeefa83643717236adc8b92f5a9b8356d545a9377f656107aad159b59cec9fd929f605b41408b8937443a9d + checksum: db5dfd14e9e2bf68ec98752021ed1df9572561f3c2adbe52a775d6866e2e6eacb9c50d176c5cb773ebf01fb497b3a644e8ce80154e7fa9546ada23148cac8979 languageName: node linkType: hard -"listr2@npm:^4.0.1": +"listr2@npm:^4.0.5": version: 4.0.5 resolution: "listr2@npm:4.0.5" dependencies: @@ -10774,13 +10774,6 @@ __metadata: languageName: node linkType: hard -"lodash.truncate@npm:^4.4.2": - version: 4.4.2 - resolution: "lodash.truncate@npm:4.4.2" - checksum: b463d8a382cfb5f0e71c504dcb6f807a7bd379ff1ea216669aa42c52fc28c54e404bfbd96791aa09e6df0de2c1d7b8f1b7f4b1a61f324d38fe98bc535aeee4f5 - languageName: node - linkType: hard - "lodash@npm:4.17.20": version: 4.17.20 resolution: "lodash@npm:4.17.20" @@ -11151,7 +11144,7 @@ __metadata: languageName: node linkType: hard -"micromatch@npm:^4.0.2, micromatch@npm:^4.0.4": +"micromatch@npm:^4.0.2, micromatch@npm:^4.0.4, micromatch@npm:^4.0.5": version: 4.0.5 resolution: "micromatch@npm:4.0.5" dependencies: @@ -11242,7 +11235,7 @@ __metadata: languageName: node linkType: hard -"minimatch@npm:2 || 3, minimatch@npm:^3.0.4": +"minimatch@npm:2 || 3, minimatch@npm:^3.0.4, minimatch@npm:^3.1.2": version: 3.1.2 resolution: "minimatch@npm:3.1.2" dependencies: @@ -11893,6 +11886,13 @@ __metadata: languageName: node linkType: hard +"object-inspect@npm:^1.12.2": + version: 1.12.2 + resolution: "object-inspect@npm:1.12.2" + checksum: a534fc1b8534284ed71f25ce3a496013b7ea030f3d1b77118f6b7b1713829262be9e6243acbcb3ef8c626e2b64186112cb7f6db74e37b2789b9c789ca23048b2 + languageName: node + linkType: hard + "object-is@npm:^1.0.1": version: 1.1.5 resolution: "object-is@npm:1.1.5" @@ -13025,7 +13025,7 @@ __metadata: languageName: node linkType: hard -"regexpp@npm:^3.1.0": +"regexpp@npm:^3.2.0": version: 3.2.0 resolution: "regexpp@npm:3.2.0" checksum: a78dc5c7158ad9ddcfe01aa9144f46e192ddbfa7b263895a70a5c6c73edd9ce85faf7c0430e59ac38839e1734e275b9c3de5c57ee3ab6edc0e0b1bdebefccef8 @@ -13168,7 +13168,7 @@ __metadata: languageName: node linkType: hard -"require-from-string@npm:^2.0.0, require-from-string@npm:^2.0.2": +"require-from-string@npm:^2.0.0": version: 2.0.2 resolution: "require-from-string@npm:2.0.2" checksum: a03ef6895445f33a4015300c426699bc66b2b044ba7b670aa238610381b56d3f07c686251740d575e22f4c87531ba662d06937508f0f3c0f1ddc04db3130560b @@ -13566,7 +13566,7 @@ __metadata: languageName: node linkType: hard -"semver@npm:^7.2.1, semver@npm:^7.3.4, semver@npm:^7.3.5": +"semver@npm:^7.3.4, semver@npm:^7.3.5, semver@npm:^7.3.7": version: 7.3.7 resolution: "semver@npm:7.3.7" dependencies: @@ -14515,7 +14515,7 @@ __metadata: languageName: node linkType: hard -"supports-color@npm:^9.2.1": +"supports-color@npm:^9.2.2": version: 9.2.2 resolution: "supports-color@npm:9.2.2" checksum: 976d84877402fc38c1d43b1fde20b0a8dc0283273f21cfebe4ff7507d27543cdfbeec7db108a96b82d694465f06d64e8577562b05d0520b41710088e0a33cc50 @@ -14580,19 +14580,6 @@ __metadata: languageName: node linkType: hard -"table@npm:^6.0.9": - version: 6.8.0 - resolution: "table@npm:6.8.0" - dependencies: - ajv: ^8.0.1 - lodash.truncate: ^4.4.2 - slice-ansi: ^4.0.0 - string-width: ^4.2.3 - strip-ansi: ^6.0.1 - checksum: 5b07fe462ee03d2e1fac02cbb578efd2e0b55ac07e3d3db2e950aa9570ade5a4a2b8d3c15e9f25c89e4e50b646bc4269934601ee1eef4ca7968ad31960977690 - languageName: node - linkType: hard - "tape@npm:^4.6.3": version: 4.15.1 resolution: "tape@npm:4.15.1" @@ -14875,11 +14862,11 @@ __metadata: languageName: node linkType: hard -"ts-node@npm:^10.1.0": - version: 10.7.0 - resolution: "ts-node@npm:10.7.0" +"ts-node@npm:^10.8.0": + version: 10.8.0 + resolution: "ts-node@npm:10.8.0" dependencies: - "@cspotcode/source-map-support": 0.7.0 + "@cspotcode/source-map-support": ^0.8.0 "@tsconfig/node10": ^1.0.7 "@tsconfig/node12": ^1.0.7 "@tsconfig/node14": ^1.0.0 @@ -14890,7 +14877,7 @@ __metadata: create-require: ^1.1.0 diff: ^4.0.1 make-error: ^1.1.1 - v8-compile-cache-lib: ^3.0.0 + v8-compile-cache-lib: ^3.0.1 yn: 3.1.1 peerDependencies: "@swc/core": ">=1.2.50" @@ -14909,7 +14896,7 @@ __metadata: ts-node-script: dist/bin-script.js ts-node-transpile-only: dist/bin-transpile.js ts-script: dist/bin-script-deprecated.js - checksum: 2a379e43f7478d0b79e1e63af91fe222d83857727957df4bd3bdf3c0a884de5097b12feb9bbf530074526b8874c0338b0e6328cf334f3a5e2c49c71e837273f7 + checksum: 1c22dc8dd80d0ba4dd4250b82cc032b63f6fbe8c87f8197cef43e7f9e2d43f5b333b445ed712e3006e24119257b4bff2c46605f7da61ab6f5e9514885d296f0c languageName: node linkType: hard @@ -15100,23 +15087,23 @@ __metadata: languageName: node linkType: hard -"typescript@npm:^4.3.5": - version: 4.6.3 - resolution: "typescript@npm:4.6.3" +"typescript@npm:^4.7.2": + version: 4.7.2 + resolution: "typescript@npm:4.7.2" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 255bb26c8cb846ca689dd1c3a56587af4f69055907aa2c154796ea28ee0dea871535b1c78f85a6212c77f2657843a269c3a742d09d81495b97b914bf7920415b + checksum: 5163585e6b56410f77d5483b698d9489bbee8902c99029eb70cf6d21525a186530ce19a00951af84eefd4a131cc51d0959f5118e25e70ab61f45ac4057dbd1ef languageName: node linkType: hard -"typescript@patch:typescript@^4.3.5#~builtin": - version: 4.6.3 - resolution: "typescript@patch:typescript@npm%3A4.6.3#~builtin::version=4.6.3&hash=bda367" +"typescript@patch:typescript@^4.7.2#~builtin": + version: 4.7.2 + resolution: "typescript@patch:typescript@npm%3A4.7.2#~builtin::version=4.7.2&hash=bda367" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 6bf45caf847062420592e711bc9c28bf5f9a9a7fa8245343b81493e4ededae33f1774009d1234d911422d1646a2c839f44e1a23ecb111b40a60ac2ea4c1482a8 + checksum: 09d93fc0983d38eadd9b0427f790b49b4437f45002a87d447be3fbe53120880e87a91dd03e1d900498f99205d6e0b7c9784fe41fca11d56f4bbce371f74bb160 languageName: node linkType: hard @@ -15417,7 +15404,7 @@ __metadata: languageName: node linkType: hard -"v8-compile-cache-lib@npm:^3.0.0": +"v8-compile-cache-lib@npm:^3.0.1": version: 3.0.1 resolution: "v8-compile-cache-lib@npm:3.0.1" checksum: 78089ad549e21bcdbfca10c08850022b22024cdcc2da9b168bcf5a73a6ed7bf01a9cebb9eac28e03cd23a684d81e0502797e88f3ccd27a32aeab1cfc44c39da0