eslint-plugin-qwik 0.20.1 → 0.22.0-dev20230314171944
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +16 -8
- package/package.json +5 -2
package/index.js
CHANGED
|
@@ -1,16 +1,24 @@
|
|
|
1
|
-
"use strict";var j=Object.create;var I=Object.defineProperty;var J=Object.getOwnPropertyDescriptor;var V=Object.getOwnPropertyNames;var W=Object.getPrototypeOf,Q=Object.prototype.hasOwnProperty;var X=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),H=(e,t)=>{for(var n in t)I(e,n,{get:t[n],enumerable:!0})},R=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of V(t))!Q.call(e,i)&&i!==n&&I(e,i,{get:()=>t[i],enumerable:!(r=J(t,i))||r.enumerable});return e};var L=(e,t,n)=>(n=e!=null?j(W(e)):{},R(t||!e||!e.__esModule?I(n,"default",{value:e,enumerable:!0}):n,e)),Z=e=>R(I({},"__esModule",{value:!0}),e);var D=X((de,O)=>{"use strict";O.exports=e=>{let t=e.match(/^[ \t]*(?=\S)/gm);return t?t.reduce((n,r)=>Math.min(n,r.length),1/0):0}});var ce={};H(ce,{configs:()=>le,rules:()=>ae});module.exports=Z(ce);var v=require("@typescript-eslint/utils"),w=L(require("typescript"));var q=L(D(),1);function C(e){let t=(0,q.default)(e);if(t===0)return e;let n=new RegExp(`^[ \\t]{${t}}`,"gm");return e.replace(n,"")}function $(e,t=1,n={}){let{indent:r=" ",includeEmptyLines:i=!1}=n;if(typeof e!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof e}\``);if(typeof t!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof t}\``);if(t<0)throw new RangeError(`Expected \`count\` to be at least 0, got \`${t}\``);if(typeof r!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof r}\``);if(t===0)return e;let l=i?/^/gm:/^(?!\s*$)/gm;return e.replace(l,r.repeat(t))}function A(e,t=0,n={}){return $(C(e),t,n)}var G=v.ESLintUtils.RuleCreator(()=>"https://qwik.builder.io/docs/advanced/dollar/"),F=G({name:"valid-lexical-scope",defaultOptions:[{allowAny:!0}],meta:{type:"problem",docs:{description:"Used the tsc typechecker to detect the capture of unserializable data in dollar ($) scopes.",recommended:"error"},schema:[{type:"object",properties:{allowAny:{type:"boolean"}},default:{allowAny:!0}}],messages:{referencesOutside:`Seems like you are referencing "{{varName}}" inside a different scope ({{dollarName}}), when this happens, Qwik needs to serialize the value, however {{reason}}.
|
|
1
|
+
"use strict";var qn=Object.create;var K=Object.defineProperty;var Cn=Object.getOwnPropertyDescriptor;var Nn=Object.getOwnPropertyNames;var Mn=Object.getPrototypeOf,kn=Object.prototype.hasOwnProperty;var l=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),Rn=(e,r)=>{for(var t in r)K(e,t,{get:r[t],enumerable:!0})},Pr=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of Nn(r))!kn.call(e,o)&&o!==t&&K(e,o,{get:()=>r[o],enumerable:!(n=Cn(r,o))||n.enumerable});return e};var D=(e,r,t)=>(t=e!=null?qn(Mn(e)):{},Pr(r||!e||!e.__esModule?K(t,"default",{value:e,enumerable:!0}):t,e)),Ln=e=>Pr(K({},"__esModule",{value:!0}),e);var _r=l((ms,Or)=>{"use strict";Or.exports=e=>{let r=e.match(/^[ \t]*(?=\S)/gm);return r?r.reduce((t,n)=>Math.min(t,n.length),1/0):0}});var H=l(ge=>{"use strict";Object.defineProperty(ge,"__esModule",{value:!0});ge.default=Kn;function Kn(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!e.type||e.type!=="JSXAttribute")throw new Error("The prop must be a JSXAttribute collected by the AST parser.");return e.name.type==="JSXNamespacedName"?e.name.namespace.name+":"+e.name.name.name:e.name.name}});var Mr=l(X=>{"use strict";Object.defineProperty(X,"__esModule",{value:!0});X.default=xe;X.hasAnyProp=Qn;X.hasEveryProp=Zn;var Hn=H(),Nr=Yn(Hn);function Yn(e){return e&&e.__esModule?e:{default:e}}var ve={spreadStrict:!0,ignoreCase:!0};function xe(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ve,n=t.ignoreCase?r.toUpperCase():r;return e.some(function(o){if(o.type==="JSXSpreadAttribute")return!t.spreadStrict;var a=t.ignoreCase?(0,Nr.default)(o).toUpperCase():(0,Nr.default)(o);return n===a})}function Qn(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ve,n=typeof r=="string"?r.split(" "):r;return n.some(function(o){return xe(e,o,t)})}function Zn(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ve,n=typeof r=="string"?r.split(" "):r;return n.every(function(o){return xe(e,o,t)})}});var Rr=l(he=>{"use strict";Object.defineProperty(he,"__esModule",{value:!0});he.default=eo;function kr(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return e.type==="JSXMemberExpression"?kr(e.object,e.property)+"."+r.name:e.name+"."+r.name}function eo(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=e.name;if(e.type==="JSXOpeningFragment")return"<>";if(!r)throw new Error("The argument provided is not a JSXElement node.");if(r.type==="JSXMemberExpression"){var t=r.object,n=t===void 0?{}:t,o=r.property,a=o===void 0?{}:o;return kr(n,a)}return r.type==="JSXNamespacedName"?r.namespace.name+":"+r.name.name:e.name.name}});var Lr=l(Y=>{"use strict";Object.defineProperty(Y,"__esModule",{value:!0});var be={clipboard:["onCopy","onCut","onPaste"],composition:["onCompositionEnd","onCompositionStart","onCompositionUpdate"],keyboard:["onKeyDown","onKeyPress","onKeyUp"],focus:["onFocus","onBlur"],form:["onChange","onInput","onSubmit"],mouse:["onClick","onContextMenu","onDblClick","onDoubleClick","onDrag","onDragEnd","onDragEnter","onDragExit","onDragLeave","onDragOver","onDragStart","onDrop","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp"],selection:["onSelect"],touch:["onTouchCancel","onTouchEnd","onTouchMove","onTouchStart"],ui:["onScroll"],wheel:["onWheel"],media:["onAbort","onCanPlay","onCanPlayThrough","onDurationChange","onEmptied","onEncrypted","onEnded","onError","onLoadedData","onLoadedMetadata","onLoadStart","onPause","onPlay","onPlaying","onProgress","onRateChange","onSeeked","onSeeking","onStalled","onSuspend","onTimeUpdate","onVolumeChange","onWaiting"],image:["onLoad","onError"],animation:["onAnimationStart","onAnimationEnd","onAnimationIteration"],transition:["onTransitionEnd"]},ro=Object.keys(be).reduce(function(e,r){return e.concat(be[r])},[]);Y.default=ro;Y.eventHandlersByType=be});var Vr=l(Se=>{"use strict";Object.defineProperty(Se,"__esModule",{value:!0});var to=function(){function e(r,t){var n=[],o=!0,a=!1,i=void 0;try{for(var s=r[Symbol.iterator](),f;!(o=(f=s.next()).done)&&(n.push(f.value),!(t&&n.length===t));o=!0);}catch(y){a=!0,i=y}finally{try{!o&&s.return&&s.return()}finally{if(a)throw i}}return n}return function(r,t){if(Array.isArray(r))return r;if(Symbol.iterator in Object(r))return e(r,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),q=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e};Se.default=so;var no=H(),oo=ao(no);function ao(e){return e&&e.__esModule?e:{default:e}}function Ur(e,r){var t={};for(var n in e)r.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}var io={ignoreCase:!0};function so(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:io;function n(s){return t.ignoreCase?s.toUpperCase():s}var o=n(r);function a(s){return s.type==="Property"&&s.key.type==="Identifier"&&o===n(s.key.name)}var i=e.find(function(s){return s.type==="JSXSpreadAttribute"?s.argument.type==="ObjectExpression"&&o!==n("key")&&s.argument.properties.some(a):o===n((0,oo.default)(s))});return i&&i.type==="JSXSpreadAttribute"?uo(i.argument.properties.find(a)):i}function uo(e){var r=e.key,t=e.value;return q({type:"JSXAttribute",name:q({type:"JSXIdentifier",name:r.name},Ee(r)),value:t.type==="Literal"?B(t):q({type:"JSXExpressionContainer",expression:lo(t)},Ee(t))},Ee(e))}function B(e){var r=e.range||[e.start,e.end],t=to(r,2),n=t[0],o=t[1];return q({},e,{end:void 0,range:[n,o],start:void 0})}function lo(e){var r=e.expressions,t=e.quasis,n=Ur(e,["expressions","quasis"]);return q({},B(n),r?{expressions:r.map(B)}:{},t?{quasis:t.map(B)}:{})}function Ee(e){var r=e.loc,t=Ur(e,["loc"]),n=B(t),o=n.range;return{loc:po(r),range:o}}function po(e){var r=e.start,t=e.end,n=e.source,o=e.filename;return q({start:r,end:t},n!==void 0?{source:n}:{},o!==void 0?{filename:o}:{})}});var Pe=l(Ae=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:!0});Ae.default=co;function co(e){var r=e.value,t=typeof r=="string"&&r.toLowerCase();return t==="true"?!0:t==="false"?!1:r}});var _e=l(Oe=>{"use strict";Object.defineProperty(Oe,"__esModule",{value:!0});Oe.default=fo;function fo(e){var r=Q().default,t=e.openingElement.name.name;return e.openingElement.selfClosing?"<"+t+" />":"<"+t+">"+[].concat(e.children).map(function(n){return r(n)}).join("")+"</"+t+">"}});var Te=l(we=>{"use strict";Object.defineProperty(we,"__esModule",{value:!0});we.default=yo;function yo(e){return e.raw}});var $r=l(je=>{"use strict";Object.defineProperty(je,"__esModule",{value:!0});je.default=mo;function mo(e){var r=Q().default;return e.children.length===0?"<></>":"<>"+[].concat(e.children).map(function(t){return r(t)}).join("")+"</>"}});var Jr=l(Fe=>{"use strict";Object.defineProperty(Fe,"__esModule",{value:!0});Fe.default=go;var Dr={Array,Date,Infinity:1/0,Math,Number,Object,String,undefined:void 0};function go(e){var r=e.name;return Object.hasOwnProperty.call(Dr,r)?Dr[r]:r}});var qe=l(Ie=>{"use strict";Object.defineProperty(Ie,"__esModule",{value:!0});Ie.default=xo;function vo(e,r){return(e.range?e.range[0]:e.start)-(r.range?r.range[0]:r.start)}function xo(e){var r=e.quasis,t=e.expressions,n=r.concat(t);return n.sort(vo).reduce(function(o,a){var i=a.type;return i==="TemplateElement"?o+a.value.raw:i==="Identifier"?a.name==="undefined"?""+o+a.name:o+"{"+a.name+"}":i.indexOf("Expression")>-1?o+"{"+i+"}":o},"")}});var Xr=l(Ce=>{"use strict";Object.defineProperty(Ce,"__esModule",{value:!0});Ce.default=So;var ho=qe(),bo=Eo(ho);function Eo(e){return e&&e.__esModule?e:{default:e}}function So(e){return(0,bo.default)(e.quasi)}});var Br=l(Ne=>{"use strict";Object.defineProperty(Ne,"__esModule",{value:!0});Ne.default=Ao;function Ao(e){return function(){return e}}});var Wr=l(Me=>{"use strict";Object.defineProperty(Me,"__esModule",{value:!0});Me.default=Po;function Po(e){var r=E().default,t=e.operator,n=e.left,o=e.right,a=r(n),i=r(o);return t==="&&"?a&&i:t==="??"?a===null||typeof a>"u"?i:a:a||i}});var zr=l(ke=>{"use strict";Object.defineProperty(ke,"__esModule",{value:!0});ke.default=Oo;function Oo(e){var r=E().default;return""+r(e.object)+(e.optional?"?.":".")+r(e.property)}});var Gr=l(Re=>{"use strict";Object.defineProperty(Re,"__esModule",{value:!0});Re.default=_o;function _o(e){var r=E().default;return r(e.expression||e)}});var Kr=l(Le=>{"use strict";Object.defineProperty(Le,"__esModule",{value:!0});Le.default=wo;function wo(e){var r=E().default;return r(e.callee)+"?.("+e.arguments.map(function(t){return r(t)}).join(", ")+")"}});var Hr=l(Ue=>{"use strict";Object.defineProperty(Ue,"__esModule",{value:!0});Ue.default=To;function To(e){var r=E().default;return r(e.object)+"?."+r(e.property)}});var Yr=l(Ve=>{"use strict";Object.defineProperty(Ve,"__esModule",{value:!0});Ve.default=jo;function jo(e){var r=E().default,t=Array.isArray(e.arguments)?e.arguments.map(function(n){return r(n)}).join(", "):"";return""+r(e.callee)+(e.optional?"?.":"")+"("+t+")"}});var Qr=l($e=>{"use strict";Object.defineProperty($e,"__esModule",{value:!0});$e.default=Fo;function Fo(e){var r=E().default,t=e.operator,n=e.argument;switch(t){case"-":return-r(n);case"+":return+r(n);case"!":return!r(n);case"~":return~r(n);case"delete":return!0;case"typeof":case"void":default:return}}});var Je=l(De=>{"use strict";Object.defineProperty(De,"__esModule",{value:!0});De.default=Io;function Io(){return"this"}});var Zr=l(Xe=>{"use strict";Object.defineProperty(Xe,"__esModule",{value:!0});Xe.default=qo;function qo(e){var r=E().default,t=e.test,n=e.alternate,o=e.consequent;return r(t)?r(o):r(n)}});var et=l(Be=>{"use strict";Object.defineProperty(Be,"__esModule",{value:!0});Be.default=Co;function Co(e){var r=E().default,t=e.operator,n=e.left,o=e.right,a=r(n),i=r(o);switch(t){case"==":return a==i;case"!=":return a!=i;case"===":return a===i;case"!==":return a!==i;case"<":return a<i;case"<=":return a<=i;case">":return a>i;case">=":return a>=i;case"<<":return a<<i;case">>":return a>>i;case">>>":return a>>>i;case"+":return a+i;case"-":return a-i;case"*":return a*i;case"/":return a/i;case"%":return a%i;case"|":return a|i;case"^":return a^i;case"&":return a&i;case"in":try{return a in i}catch{return!1}case"instanceof":return typeof i!="function"?!1:a instanceof i;default:return}}});var We=l((Gs,tt)=>{"use strict";var rt=Object.prototype.toString;tt.exports=function(r){var t=rt.call(r),n=t==="[object Arguments]";return n||(n=t!=="[object Array]"&&r!==null&&typeof r=="object"&&typeof r.length=="number"&&r.length>=0&&rt.call(r.callee)==="[object Function]"),n}});var ct=l((Ks,pt)=>{"use strict";var lt;Object.keys||(W=Object.prototype.hasOwnProperty,ze=Object.prototype.toString,nt=We(),Ge=Object.prototype.propertyIsEnumerable,ot=!Ge.call({toString:null},"toString"),at=Ge.call(function(){},"prototype"),z=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Z=function(e){var r=e.constructor;return r&&r.prototype===e},it={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},st=function(){if(typeof window>"u")return!1;for(var e in window)try{if(!it["$"+e]&&W.call(window,e)&&window[e]!==null&&typeof window[e]=="object")try{Z(window[e])}catch{return!0}}catch{return!0}return!1}(),ut=function(e){if(typeof window>"u"||!st)return Z(e);try{return Z(e)}catch{return!1}},lt=function(r){var t=r!==null&&typeof r=="object",n=ze.call(r)==="[object Function]",o=nt(r),a=t&&ze.call(r)==="[object String]",i=[];if(!t&&!n&&!o)throw new TypeError("Object.keys called on a non-object");var s=at&&n;if(a&&r.length>0&&!W.call(r,0))for(var f=0;f<r.length;++f)i.push(String(f));if(o&&r.length>0)for(var y=0;y<r.length;++y)i.push(String(y));else for(var x in r)!(s&&x==="prototype")&&W.call(r,x)&&i.push(String(x));if(ot)for(var g=ut(r),c=0;c<z.length;++c)!(g&&z[c]==="constructor")&&W.call(r,z[c])&&i.push(z[c]);return i});var W,ze,nt,Ge,ot,at,z,Z,it,st,ut;pt.exports=lt});var Ke=l((Hs,dt)=>{"use strict";var No=Array.prototype.slice,Mo=We(),ft=Object.keys,ee=ft?function(r){return ft(r)}:ct(),yt=Object.keys;ee.shim=function(){if(Object.keys){var r=function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2);r||(Object.keys=function(n){return Mo(n)?yt(No.call(n)):yt(n)})}else Object.keys=ee;return Object.keys||ee};dt.exports=ee});var He=l((Ys,mt)=>{"use strict";mt.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var r={},t=Symbol("test"),n=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var o=42;r[t]=o;for(t in r)return!1;if(typeof Object.keys=="function"&&Object.keys(r).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(r).length!==0)return!1;var a=Object.getOwnPropertySymbols(r);if(a.length!==1||a[0]!==t||!Object.prototype.propertyIsEnumerable.call(r,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var i=Object.getOwnPropertyDescriptor(r,t);if(i.value!==o||i.enumerable!==!0)return!1}return!0}});var xt=l((Qs,vt)=>{"use strict";var gt=typeof Symbol<"u"&&Symbol,ko=He();vt.exports=function(){return typeof gt!="function"||typeof Symbol!="function"||typeof gt("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:ko()}});var bt=l((Zs,ht)=>{"use strict";var Ro="Function.prototype.bind called on incompatible ",Ye=Array.prototype.slice,Lo=Object.prototype.toString,Uo="[object Function]";ht.exports=function(r){var t=this;if(typeof t!="function"||Lo.call(t)!==Uo)throw new TypeError(Ro+t);for(var n=Ye.call(arguments,1),o,a=function(){if(this instanceof o){var x=t.apply(this,n.concat(Ye.call(arguments)));return Object(x)===x?x:this}else return t.apply(r,n.concat(Ye.call(arguments)))},i=Math.max(0,t.length-n.length),s=[],f=0;f<i;f++)s.push("$"+f);if(o=Function("binder","return function ("+s.join(",")+"){ return binder.apply(this,arguments); }")(a),t.prototype){var y=function(){};y.prototype=t.prototype,o.prototype=new y,y.prototype=null}return o}});var re=l((eu,Et)=>{"use strict";var Vo=bt();Et.exports=Function.prototype.bind||Vo});var At=l((ru,St)=>{"use strict";var $o=re();St.exports=$o.call(Function.call,Object.prototype.hasOwnProperty)});var oe=l((tu,Tt)=>{"use strict";var d,k=SyntaxError,wt=Function,M=TypeError,Qe=function(e){try{return wt('"use strict"; return ('+e+").constructor;")()}catch{}},j=Object.getOwnPropertyDescriptor;if(j)try{j({},"")}catch{j=null}var Ze=function(){throw new M},Do=j?function(){try{return arguments.callee,Ze}catch{try{return j(arguments,"callee").get}catch{return Ze}}}():Ze,C=xt()(),O=Object.getPrototypeOf||function(e){return e.__proto__},N={},Jo=typeof Uint8Array>"u"?d:O(Uint8Array),F={"%AggregateError%":typeof AggregateError>"u"?d:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?d:ArrayBuffer,"%ArrayIteratorPrototype%":C?O([][Symbol.iterator]()):d,"%AsyncFromSyncIteratorPrototype%":d,"%AsyncFunction%":N,"%AsyncGenerator%":N,"%AsyncGeneratorFunction%":N,"%AsyncIteratorPrototype%":N,"%Atomics%":typeof Atomics>"u"?d:Atomics,"%BigInt%":typeof BigInt>"u"?d:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?d:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?d:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?d:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?d:Float32Array,"%Float64Array%":typeof Float64Array>"u"?d:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?d:FinalizationRegistry,"%Function%":wt,"%GeneratorFunction%":N,"%Int8Array%":typeof Int8Array>"u"?d:Int8Array,"%Int16Array%":typeof Int16Array>"u"?d:Int16Array,"%Int32Array%":typeof Int32Array>"u"?d:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":C?O(O([][Symbol.iterator]())):d,"%JSON%":typeof JSON=="object"?JSON:d,"%Map%":typeof Map>"u"?d:Map,"%MapIteratorPrototype%":typeof Map>"u"||!C?d:O(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?d:Promise,"%Proxy%":typeof Proxy>"u"?d:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?d:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?d:Set,"%SetIteratorPrototype%":typeof Set>"u"||!C?d:O(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?d:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":C?O(""[Symbol.iterator]()):d,"%Symbol%":C?Symbol:d,"%SyntaxError%":k,"%ThrowTypeError%":Do,"%TypedArray%":Jo,"%TypeError%":M,"%Uint8Array%":typeof Uint8Array>"u"?d:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?d:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?d:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?d:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?d:WeakMap,"%WeakRef%":typeof WeakRef>"u"?d:WeakRef,"%WeakSet%":typeof WeakSet>"u"?d:WeakSet};try{null.error}catch(e){Pt=O(O(e)),F["%Error.prototype%"]=Pt}var Pt,Xo=function e(r){var t;if(r==="%AsyncFunction%")t=Qe("async function () {}");else if(r==="%GeneratorFunction%")t=Qe("function* () {}");else if(r==="%AsyncGeneratorFunction%")t=Qe("async function* () {}");else if(r==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(t=n.prototype)}else if(r==="%AsyncIteratorPrototype%"){var o=e("%AsyncGenerator%");o&&(t=O(o.prototype))}return F[r]=t,t},Ot={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},G=re(),te=At(),Bo=G.call(Function.call,Array.prototype.concat),Wo=G.call(Function.apply,Array.prototype.splice),_t=G.call(Function.call,String.prototype.replace),ne=G.call(Function.call,String.prototype.slice),zo=G.call(Function.call,RegExp.prototype.exec),Go=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Ko=/\\(\\)?/g,Ho=function(r){var t=ne(r,0,1),n=ne(r,-1);if(t==="%"&&n!=="%")throw new k("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&t!=="%")throw new k("invalid intrinsic syntax, expected opening `%`");var o=[];return _t(r,Go,function(a,i,s,f){o[o.length]=s?_t(f,Ko,"$1"):i||a}),o},Yo=function(r,t){var n=r,o;if(te(Ot,n)&&(o=Ot[n],n="%"+o[0]+"%"),te(F,n)){var a=F[n];if(a===N&&(a=Xo(n)),typeof a>"u"&&!t)throw new M("intrinsic "+r+" exists, but is not available. Please file an issue!");return{alias:o,name:n,value:a}}throw new k("intrinsic "+r+" does not exist!")};Tt.exports=function(r,t){if(typeof r!="string"||r.length===0)throw new M("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new M('"allowMissing" argument must be a boolean');if(zo(/^%?[^%]*%?$/,r)===null)throw new k("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Ho(r),o=n.length>0?n[0]:"",a=Yo("%"+o+"%",t),i=a.name,s=a.value,f=!1,y=a.alias;y&&(o=y[0],Wo(n,Bo([0,1],y)));for(var x=1,g=!0;x<n.length;x+=1){var c=n[x],u=ne(c,0,1),p=ne(c,-1);if((u==='"'||u==="'"||u==="`"||p==='"'||p==="'"||p==="`")&&u!==p)throw new k("property names with quotes must have matching quotes");if((c==="constructor"||!g)&&(f=!0),o+="."+c,i="%"+o+"%",te(F,i))s=F[i];else if(s!=null){if(!(c in s)){if(!t)throw new M("base intrinsic for "+r+" exists, but the property is not available.");return}if(j&&x+1>=n.length){var m=j(s,c);g=!!m,g&&"get"in m&&!("originalValue"in m.get)?s=m.get:s=s[c]}else g=te(s,c),s=s[c];g&&!f&&(F[i]=s)}}return s}});var Ft=l((nu,jt)=>{"use strict";var Qo=oe(),er=Qo("%Object.defineProperty%",!0),rr=function(){if(er)try{return er({},"a",{value:1}),!0}catch{return!1}return!1};rr.hasArrayLengthDefineBug=function(){if(!rr())return null;try{return er([],"length",{value:1}).length!==1}catch{return!0}};jt.exports=rr});var tr=l((ou,Nt)=>{"use strict";var Zo=Ke(),ea=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",ra=Object.prototype.toString,ta=Array.prototype.concat,It=Object.defineProperty,na=function(e){return typeof e=="function"&&ra.call(e)==="[object Function]"},oa=Ft()(),qt=It&&oa,aa=function(e,r,t,n){if(r in e){if(n===!0){if(e[r]===t)return}else if(!na(n)||!n())return}qt?It(e,r,{configurable:!0,enumerable:!1,value:t,writable:!0}):e[r]=t},Ct=function(e,r){var t=arguments.length>2?arguments[2]:{},n=Zo(r);ea&&(n=ta.call(n,Object.getOwnPropertySymbols(r)));for(var o=0;o<n.length;o+=1)aa(e,n[o],r[n[o]],t[n[o]])};Ct.supportsDescriptors=!!qt;Nt.exports=Ct});var or=l((au,ae)=>{"use strict";var nr=re(),R=oe(),Rt=R("%Function.prototype.apply%"),Lt=R("%Function.prototype.call%"),Ut=R("%Reflect.apply%",!0)||nr.call(Lt,Rt),Mt=R("%Object.getOwnPropertyDescriptor%",!0),I=R("%Object.defineProperty%",!0),ia=R("%Math.max%");if(I)try{I({},"a",{value:1})}catch{I=null}ae.exports=function(r){var t=Ut(nr,Lt,arguments);if(Mt&&I){var n=Mt(t,"length");n.configurable&&I(t,"length",{value:1+ia(0,r.length-(arguments.length-1))})}return t};var kt=function(){return Ut(nr,Rt,arguments)};I?I(ae.exports,"apply",{value:kt}):ae.exports.apply=kt});var Jt=l((iu,Dt)=>{"use strict";var Vt=oe(),$t=or(),sa=$t(Vt("String.prototype.indexOf"));Dt.exports=function(r,t){var n=Vt(r,!!t);return typeof n=="function"&&sa(r,".prototype.")>-1?$t(n):n}});var ar=l((su,Gt)=>{"use strict";var ua=Ke(),Wt=He()(),zt=Jt(),Xt=Object,la=zt("Array.prototype.push"),Bt=zt("Object.prototype.propertyIsEnumerable"),pa=Wt?Object.getOwnPropertySymbols:null;Gt.exports=function(r,t){if(r==null)throw new TypeError("target must be an object");var n=Xt(r);if(arguments.length===1)return n;for(var o=1;o<arguments.length;++o){var a=Xt(arguments[o]),i=ua(a),s=Wt&&(Object.getOwnPropertySymbols||pa);if(s)for(var f=s(a),y=0;y<f.length;++y){var x=f[y];Bt(a,x)&&la(i,x)}for(var g=0;g<i.length;++g){var c=i[g];if(Bt(a,c)){var u=a[c];n[c]=u}}}return n}});var sr=l((uu,Kt)=>{"use strict";var ir=ar(),ca=function(){if(!Object.assign)return!1;for(var e="abcdefghijklmnopqrst",r=e.split(""),t={},n=0;n<r.length;++n)t[r[n]]=r[n];var o=Object.assign({},t),a="";for(var i in o)a+=i;return e!==a},fa=function(){if(!Object.assign||!Object.preventExtensions)return!1;var e=Object.preventExtensions({1:2});try{Object.assign(e,"xy")}catch{return e[1]==="y"}return!1};Kt.exports=function(){return!Object.assign||ca()||fa()?ir:Object.assign}});var Yt=l((lu,Ht)=>{"use strict";var ya=tr(),da=sr();Ht.exports=function(){var r=da();return ya(Object,{assign:r},{assign:function(){return Object.assign!==r}}),r}});var rn=l((pu,en)=>{"use strict";var ma=tr(),ga=or(),va=ar(),Qt=sr(),xa=Yt(),ha=ga.apply(Qt()),Zt=function(r,t){return ha(Object,arguments)};ma(Zt,{getPolyfill:Qt,implementation:va,shim:xa});en.exports=Zt});var nn=l(ur=>{"use strict";Object.defineProperty(ur,"__esModule",{value:!0});var ba=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e};ur.default=tn;var Ea=rn(),Sa=Aa(Ea);function Aa(e){return e&&e.__esModule?e:{default:e}}function tn(e){var r=E().default;return e.properties.reduce(function(t,n){var o=ba({},t);if(/^(?:Experimental)?Spread(?:Property|Element)$/.test(n.type)){if(n.argument.type==="ObjectExpression")return(0,Sa.default)(o,tn(n.argument))}else o[r(n.key)]=r(n.value);return o},{})}});var on=l(lr=>{"use strict";Object.defineProperty(lr,"__esModule",{value:!0});lr.default=Pa;function Pa(){return new Object}});var an=l(pr=>{"use strict";Object.defineProperty(pr,"__esModule",{value:!0});pr.default=Oa;function Oa(e){var r=E().default,t=e.operator,n=e.argument,o=e.prefix,a=r(n);switch(t){case"++":return o?++a:a++;case"--":return o?--a:a--;default:return}}});var sn=l(cr=>{"use strict";Object.defineProperty(cr,"__esModule",{value:!0});cr.default=_a;function _a(e){var r=E().default;return e.elements.map(function(t){if(t!==null)return r(t)})}});var un=l(fr=>{"use strict";Object.defineProperty(fr,"__esModule",{value:!0});fr.default=wa;function wa(e){var r=E().default,t=r(e.callee),n=e.object===null?r(e.callee.object):r(e.object);return e.object&&e.object.property?n+"."+t+".bind("+n+")":t+".bind("+n+")"}});var ln=l(yr=>{"use strict";Object.defineProperty(yr,"__esModule",{value:!0});yr.default=Ta;function Ta(){}});var pn=l(dr=>{"use strict";Object.defineProperty(dr,"__esModule",{value:!0});dr.default=ja;function ja(e){var r=E().default;return r(e.expression)}});var cn=l(mr=>{"use strict";Object.defineProperty(mr,"__esModule",{value:!0});mr.default=Fa;function Fa(e){var r=E().default;return e.expressions.map(function(t){return r(t)})}});var yn=l(gr=>{"use strict";Object.defineProperty(gr,"__esModule",{value:!0});gr.default=w;var Ia=Je().default;function fn(e,r,t){return t.computed?t.optional?e+"?.["+r+"]":e+"["+r+"]":t.optional?e+"?."+r:e+"."+r}function w(e){var r="The prop value with an expression type of TSNonNullExpression could not be resolved. Please file an issue ( https://github.com/jsx-eslint/jsx-ast-utils/issues/new ) to get this fixed immediately.";if(e.type==="Identifier"){var t=e.name;return t}if(e.type==="Literal")return e.value;if(e.type==="TSAsExpression")return w(e.expression);if(e.type==="ThisExpression")return Ia();if(e.type==="TSNonNullExpression"&&(!e.extra||e.extra.parenthesized===!1)){var n=e.expression;return w(n)+"!"}if(e.type==="TSNonNullExpression"&&e.extra&&e.extra.parenthesized===!0){var o=e.expression;return"("+w(o)+"!)"}if(e.type==="MemberExpression"){if(!e.extra||e.extra.parenthesized===!1)return fn(w(e.object),w(e.property),e);if(e.extra&&e.extra.parenthesized===!0){var a=fn(w(e.object),w(e.property),e);return"("+a+")"}}if(e.expression)for(var i=e.expression;i;){if(i.type==="Identifier")return console.error(r),i.name;var s=i;i=s.expression}return console.error(r),""}});var dn=l(vr=>{"use strict";Object.defineProperty(vr,"__esModule",{value:!0});vr.default=qa;function qa(e){var r=E().default;return r(e.left)+" "+e.operator+" "+r(e.right)}});var E=l(ie=>{"use strict";Object.defineProperty(ie,"__esModule",{value:!0});var Ca=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e};ie.default=Mi;ie.extractLiteral=ki;var Na=Pe(),Ma=v(Na),ka=_e(),Ra=v(ka),La=$r(),Ua=v(La),Va=Te(),$a=v(Va),Da=Jr(),Ja=v(Da),Xa=Xr(),Ba=v(Xa),Wa=qe(),za=v(Wa),Ga=Br(),mn=v(Ga),Ka=Wr(),Ha=v(Ka),Ya=zr(),Qa=v(Ya),Za=Gr(),ei=v(Za),ri=Kr(),ti=v(ri),ni=Hr(),oi=v(ni),ai=Yr(),ii=v(ai),si=Qr(),ui=v(si),li=Je(),pi=v(li),ci=Zr(),fi=v(ci),yi=et(),di=v(yi),mi=nn(),gi=v(mi),vi=on(),xi=v(vi),hi=an(),bi=v(hi),Ei=sn(),Si=v(Ei),Ai=un(),Pi=v(Ai),Oi=ln(),_i=v(Oi),wi=pn(),Ti=v(wi),ji=cn(),Fi=v(ji),Ii=yn(),qi=v(Ii),Ci=dn(),Ni=v(Ci);function v(e){return e&&e.__esModule?e:{default:e}}var T={Identifier:Ja.default,Literal:Ma.default,JSXElement:Ra.default,JSXFragment:Ua.default,JSXText:$a.default,TaggedTemplateExpression:Ba.default,TemplateLiteral:za.default,ArrowFunctionExpression:mn.default,FunctionExpression:mn.default,LogicalExpression:Ha.default,MemberExpression:Qa.default,ChainExpression:ei.default,OptionalCallExpression:ti.default,OptionalMemberExpression:oi.default,CallExpression:ii.default,UnaryExpression:ui.default,ThisExpression:pi.default,ConditionalExpression:fi.default,BinaryExpression:di.default,ObjectExpression:gi.default,NewExpression:xi.default,UpdateExpression:bi.default,ArrayExpression:Si.default,BindExpression:Pi.default,SpreadElement:_i.default,TypeCastExpression:Ti.default,SequenceExpression:Fi.default,TSNonNullExpression:qi.default,AssignmentExpression:Ni.default},b=function(){return null},vn=function(r){return"The prop value with an expression type of "+r+" could not be resolved. Please file an issue ( https://github.com/jsx-eslint/jsx-ast-utils/issues/new ) to get this fixed immediately."};function Mi(e){var r=void 0;typeof e.expression!="boolean"&&e.expression?r=e.expression:r=e;var t=r,n=t.type;for(r.object&&r.object.type==="TSNonNullExpression"&&(n="TSNonNullExpression");n==="TSAsExpression";){var o=r;if(n=o.type,r.expression){var a=r;r=a.expression}}return T[n]===void 0?(console.error(vn(n)),null):T[n](r)}var gn=Ca({},T,{Literal:function(r){var t=T.Literal.call(void 0,r),n=t===null;return n?"null":t},Identifier:function(r){var t=T.Identifier.call(void 0,r)===void 0;return t?void 0:null},JSXElement:b,JSXFragment:b,JSXText:b,ArrowFunctionExpression:b,FunctionExpression:b,LogicalExpression:b,MemberExpression:b,OptionalCallExpression:b,OptionalMemberExpression:b,CallExpression:b,UnaryExpression:function(r){var t=T.UnaryExpression.call(void 0,r);return t===void 0?null:t},UpdateExpression:function(r){var t=T.UpdateExpression.call(void 0,r);return t===void 0?null:t},ThisExpression:b,ConditionalExpression:b,BinaryExpression:b,ObjectExpression:b,NewExpression:b,ArrayExpression:function(r){var t=T.ArrayExpression.call(void 0,r);return t.filter(function(n){return n!==null})},BindExpression:b,SpreadElement:b,TSNonNullExpression:b,TSAsExpression:b,TypeCastExpression:b,SequenceExpression:b,ChainExpression:b});function ki(e){var r=e.expression||e,t=r.type;return gn[t]===void 0?(console.error(vn(t)),null):gn[t](r)}});var Q=l(ue=>{"use strict";Object.defineProperty(ue,"__esModule",{value:!0});var Ri=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e};ue.default=Wi;ue.getLiteralValue=zi;var Li=Pe(),Ui=se(Li),Vi=_e(),$i=se(Vi),Di=Te(),Ji=se(Di),xn=E(),Xi=se(xn);function se(e){return e&&e.__esModule?e:{default:e}}var hn={Literal:Ui.default,JSXElement:$i.default,JSXExpressionContainer:Xi.default,JSXText:Ji.default},Bi=Ri({},hn,{JSXElement:function(){return null},JSXExpressionContainer:xn.extractLiteral});function Wi(e){return hn[e.type](e)}function zi(e){return Bi[e.type](e)}});var Sn=l(le=>{"use strict";Object.defineProperty(le,"__esModule",{value:!0});le.default=Hi;le.getLiteralPropValue=Yi;var bn=Q(),Gi=Ki(bn);function Ki(e){return e&&e.__esModule?e:{default:e}}var En=function(r,t){if(r&&r.type==="JSXAttribute")return r.value===null?!0:t(r.value)};function Hi(e){return En(e,Gi.default)}function Yi(e){return En(e,bn.getLiteralValue)}});var pe=l((Pu,On)=>{"use strict";var xr=Mr(),Qi=L(xr),Zi=Rr(),es=L(Zi),An=Lr(),rs=L(An),ts=Vr(),ns=L(ts),Pn=Sn(),os=L(Pn),as=H(),is=L(as);function L(e){return e&&e.__esModule?e:{default:e}}On.exports={hasProp:Qi.default,hasAnyProp:xr.hasAnyProp,hasEveryProp:xr.hasEveryProp,elementType:es.default,eventHandlers:rs.default,eventHandlersByType:An.eventHandlersByType,getProp:ns.default,getPropValue:os.default,getLiteralPropValue:Pn.getLiteralPropValue,propName:is.default}});var ys={};Rn(ys,{configs:()=>fs,rules:()=>cs});module.exports=Ln(ys);var me=require("@typescript-eslint/utils"),_=D(require("typescript"));var wr=D(_r(),1);function fe(e){let r=(0,wr.default)(e);if(r===0)return e;let t=new RegExp(`^[ \\t]{${r}}`,"gm");return e.replace(t,"")}function ye(e,r=1,t={}){let{indent:n=" ",includeEmptyLines:o=!1}=t;if(typeof e!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof e}\``);if(typeof r!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof r}\``);if(r<0)throw new RangeError(`Expected \`count\` to be at least 0, got \`${r}\``);if(typeof n!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof n}\``);if(r===0)return e;let a=o?/^/gm:/^(?!\s*$)/gm;return e.replace(a,n.repeat(r))}function de(e,r=0,t={}){return ye(fe(e),r,t)}var Un=me.ESLintUtils.RuleCreator(()=>"https://qwik.builder.io/docs/advanced/dollar/"),Tr=Un({name:"valid-lexical-scope",defaultOptions:[{allowAny:!0}],meta:{type:"problem",docs:{description:"Used the tsc typechecker to detect the capture of unserializable data in dollar ($) scopes.",recommended:"error"},schema:[{type:"object",properties:{allowAny:{type:"boolean"}},default:{allowAny:!0}}],messages:{referencesOutside:`Seems like you are referencing "{{varName}}" inside a different scope ({{dollarName}}), when this happens, Qwik needs to serialize the value, however {{reason}}.
|
|
2
2
|
Check out https://qwik.builder.io/docs/advanced/dollar/ for more details.`,invalidJsxDollar:`Seems like you are using "{{varName}}" as an event handler, however functions are not serializable.
|
|
3
3
|
Did you mean to wrap it in \`$()\`?
|
|
4
4
|
|
|
5
5
|
{{solution}}
|
|
6
6
|
Check out https://qwik.builder.io/docs/advanced/dollar/ for more details.`,mutableIdentifier:`Seems like you are mutating the value of ("{{varName}}"), but this is not possible when captured by the ({{dollarName}}) closure, instead create an object and mutate one of its properties.
|
|
7
|
-
Check out https://qwik.builder.io/docs/advanced/dollar/ for more details.`}},create(e){var
|
|
8
|
-
${P
|
|
7
|
+
Check out https://qwik.builder.io/docs/advanced/dollar/ for more details.`}},create(e){var x;let t={allowAny:((x=e.options[0])==null?void 0:x.allowAny)??!0},n=e.getSourceCode().scopeManager,o=me.ESLintUtils.getParserServices(e),a=o.esTreeNodeToTSNodeMap,i=o.program.getTypeChecker(),s=new Map,f=[];function y(g){g.references.forEach(c=>{var m,h;let u=c.resolved,p=(m=c.resolved)==null?void 0:m.scope;if(u&&p){let P=(h=u.defs.at(0))==null?void 0:h.type;if(P==="Type"||P==="ImportBinding")return;let S=c.from,A;for(;S&&(A=s.get(S),!A);)S=S.upper;if(S&&A){let U=p.type;if(U==="global"||U==="module")return;let V=c.identifier,In=a.get(V),$=p;for(;$&&!s.has($);)$=$.upper;if($!==S){V.parent&&V.parent.type==="AssignmentExpression"&&V.parent.left===V&&e.report({messageId:"mutableIdentifier",node:c.identifier,data:{varName:c.identifier.name,dollarName:A}});let Ar=Vn(e,i,In,c.identifier,t);Ar&&e.report({messageId:"referencesOutside",node:c.identifier,data:{varName:c.identifier.name,dollarName:A,reason:$n(Ar)}})}}}}),g.childScopes.forEach(y)}return{CallExpression(g){if(g.callee.type==="Identifier"&&g.callee.name.endsWith("$")){let c=g.arguments.at(0);if(c&&c.type==="ArrowFunctionExpression"){let u=n.acquire(c);u&&s.set(u,g.callee.name)}}},JSXAttribute(g){let c=g.name,u=c.type==="JSXIdentifier"?c.name:c.name.name;if(u.endsWith("$")){let p=g.value;if(p&&p.type==="JSXExpressionContainer"){let m=n.acquire(p.expression);if(m)s.set(m,u);else if(p.expression.type==="Identifier"){let h=a.get(p.expression),P=i.getTypeAtLocation(h);if(!jr(P)){if(P.symbol.name==="PropFnInterface")return;e.report({messageId:"invalidJsxDollar",node:p.expression,data:{varName:p.expression.name,solution:`const ${p.expression.name} = $(
|
|
8
|
+
${Fr(P.symbol,e.getSourceCode().text)}
|
|
9
9
|
);
|
|
10
|
-
`}})}}}}},Program(
|
|
11
|
-
${
|
|
12
|
-
);`;
|
|
10
|
+
`}})}}}}},Program(g){let c=a.get(g),u=i.getSymbolAtLocation(c);u&&(f=i.getExportsOfModule(u))},"Program:exit"(){y(n.globalScope)}}}});function Vn(e,r,t,n,o){let a=r.getTypeAtLocation(t);return Dn(e,r,a,t,n,o,new Set)}function $n(e){let r="";return e.location?r+=`"${e.location}" `:r+="it ",r+=`${e.reason}`,r}function Dn(e,r,t,n,o,a,i){let s=J(e,r,t,n,a,0,i);if(s){let f=s.location;return f&&(s.location=`${o.name}.${f}`),s}return s}function J(e,r,t,n,o,a,i){if(i.has(t)||(i.add(t),t.getProperty("__no_serialize__")))return;if(t.flags&_.default.TypeFlags.Unknown)return{type:t,typeStr:r.typeToString(t),reason:"is unknown, which could be serializable or not, please make the type for specific"};let f=t.flags&_.default.TypeFlags.Any;if(!o.allowAny&&f)return{type:t,typeStr:r.typeToString(t),reason:"is any, which is not serializable"};if(t.flags&_.default.TypeFlags.BigIntLike)return{type:t,typeStr:r.typeToString(t),reason:"is BigInt and it is not supported yet, use a number instead"};if(t.flags&_.default.TypeFlags.ESSymbolLike)return{type:t,typeStr:r.typeToString(t),reason:"is Symbol, which is not serializable"};if(t.flags&_.default.TypeFlags.EnumLike)return{type:t,typeStr:r.typeToString(t),reason:"is an enum, use an string or a number instead"};if(jr(t))return;if(t.getCallSignatures().length>0){if(t.symbol.name==="PropFnInterface")return;let m="is a function, which is not serializable";if(a===0&&_.default.isIdentifier(n)){let h=`const ${n.text} = $(
|
|
11
|
+
${Fr(t.symbol,e.getSourceCode().text)}
|
|
12
|
+
);`;m+=`.
|
|
13
13
|
Did you mean to wrap it in \`$()\`?
|
|
14
14
|
|
|
15
|
-
${
|
|
16
|
-
`}return{type:
|
|
15
|
+
${h}
|
|
16
|
+
`}return{type:t,typeStr:r.typeToString(t),reason:m}}if(t.isUnion()){for(let p of t.types){let m=J(e,r,p,n,o,a+1,i);if(m)return m}return}if((t.flags&_.default.TypeFlags.Object)!==0){let p=Xn(t,r);if(p)return J(e,r,p,n,o,a+1,i);let m=Bn(t,r);if(m){for(let S of m){let A=J(e,r,S,n,o,a+1,i);if(A)return A}return}let h=t.symbol.name;if(t.getProperty("nextElementSibling")||t.getProperty("activeElement")||Wn[h])return;if(t.isClass())return{type:t,typeStr:r.typeToString(t),reason:`is an instance of the "${t.symbol.name}" class, which is not serializable. Use a simple object literal instead`};let P=t.getProperty("prototype");if(P){let S=r.getTypeOfSymbolAtLocation(P,n);if(S.isClass())return{type:S,typeStr:r.typeToString(S),reason:"is a class constructor, which is not serializable"}}if(!h.startsWith("__")&&t.symbol.valueDeclaration)return{type:t,typeStr:r.typeToString(t),reason:`is an instance of the "${t.symbol.name}" class, which is not serializable`};for(let S of t.getProperties()){let A=Jn(e,r,S,n,o,a+1,i);if(A){let U=A.location;return A.location=`${S.name}${U?`.${U}`:""}`,A}}}}function Jn(e,r,t,n,o,a,i){let s=r.getTypeOfSymbolAtLocation(t,n);return J(e,r,s,n,o,a,i)}function Xn(e,r){return r.getElementTypeOfArrayType(e)}function Bn(e,r){return r.isTupleType(e)?r.getTypeArguments(e):void 0}function jr(e){return!!(e.flags&_.default.TypeFlags.Any)||!!e.getProperty("__brand__QRL__")}function Fr(e,r){if(e.declarations&&e.declarations.length>0){let t=e.declarations[0],n=r.slice(t.pos,t.end).replace(/^\s*$/gm,"");return de(n,2)}return""}var Wn={Promise:!0,URL:!0,RegExp:!0,Date:!0,FormData:!0,URLSearchParams:!0,Error:!0};var Ir={meta:{type:"problem",docs:{description:"Object destructuring is not recommended for component$",category:"Variables",recommended:!0,url:"https://github.com/BuilderIO/qwik"}},create(e){let r=[];return{ArrowFunctionExpression(){r.push({await:!1})},"ArrowFunctionExpression:exit"(){r.pop()},AwaitExpression(){let t=r[r.length-1];t&&(t.await=!0)},"CallExpression[callee.name=/^use[A-Z]/]"(t){let n=r[r.length-1];n&&n.await&&e.report({node:t,message:"Calling use* methods after await is not safe."})}}}};var qr={loader$:!0,routeLoader$:!0,routeAction$:!0,routeHandler$:!0},zn={...qr,action$:!0,globalAction$:!0},Cr={meta:{type:"problem",docs:{description:"Detect declaration location of loader$",recommended:!0,url:"https://github.com/BuilderIO/qwik"},messages:{invalidLoaderLocation:'`{{fnName}}()` can only be declared in `layout.tsx`, `index.tsx` and `plugin.tsx` inside the `src/routes` directory, instead it was declared in "{{path}}".\nPlease check the docs: https://qwik.builder.io/qwikcity/loader',missingExport:"The return of `{{fnName}}()` needs to be exported in the same module, like this\n```\nexport const {{id}} = {{fnName}}(() => { ... });\n```",wrongName:"The named export of `{{fnName}}()` needs to follow the `use*` naming convention. It must start with `use`, like this:\n```\nexport const {{fixed}} = {{fnName}}(() => { ... });\n```\nInstead it was named:\n```\nexport const {{id}} = ...\n```",recommendedValue:"For `{{fnName}}()` it is recommended to inline the arrow function. Instead of:\n```\nexport const {{id}} = {{fnName}}({{arg}});\n```\nDo this:\n```\nexport const {{id}} = {{fnName}}(() => { ...logic here... });\n```\nThis will help the optimizer make sure that no server code is leaked to the client build."}},create(e){let r=Gn(e.getFilename()),t=/\/layout(|!|-.+)\.tsx?$/.test(r),n=/\/index(|!|@.+)\.tsx?$/.test(r),o=/\/plugin(|@.+)\.tsx?$/.test(r),i=/\/src\/routes\//.test(r)&&(n||t||o);return{CallExpression(s){if(s.callee.type!=="Identifier")return;let f=s.callee.name;if(!zn[f])return;if(!i&&qr[f]){e.report({node:s.callee,messageId:"invalidLoaderLocation",data:{fnName:f,path:r}});return}let y=s.parent;if(y.type!=="VariableDeclarator"){e.report({node:s.callee,messageId:"missingExport",data:{fnName:f,id:"useStuff"}});return}if(y.id.type!=="Identifier"){e.report({node:s.callee,messageId:"missingExport",data:{fnName:f,id:"useStuff"}});return}if(!/^use/.test(y.id.name)){let x="use"+y.id.name[0].toUpperCase()+y.id.name.slice(1);e.report({node:y.id,messageId:"wrongName",data:{fnName:f,id:y.id.name,fixed:x}});return}if(y.parent.parent.type!=="ExportNamedDeclaration"){e.report({node:y.id,messageId:"missingExport",data:{fnName:f,id:y.id.name}});return}if(s.arguments.length>0&&s.arguments[0].type==="Identifier"){e.report({node:s.arguments[0],messageId:"recommendedValue",data:{fnName:f,id:y.id.name,arg:s.arguments[0].name}});return}}}}};function Gn(e){let r=/^\\\\\?\\/.test(e),t=/[^\u0000-\u0080]+/.test(e);return r||t||(e=e.replace(/\\/g,"/"),e.endsWith("/")&&(e=e.slice(0,e.length-1))),e}var hr=D(pe()),ss=[{from:"className",to:"class"},{from:"htmlFor",to:"for"}];var _n={meta:{type:"problem",docs:{recommended:"warn",description:"Disallow usage of React-specific `className`/`htmlFor` props."},fixable:"code",schema:[],messages:{prefer:"Prefer the `{{ to }}` prop over the deprecated `{{ from }}` prop."}},create(e){return{JSXOpeningElement(r){for(let{from:t,to:n}of ss){let o=hr.default.getProp(r.attributes,t);if(o){let a=hr.default.hasProp(r.attributes,n,{ignoreCase:!1})?void 0:i=>i.replaceText(o.name,n);e.report({node:o,messageId:"prefer",data:{from:t,to:n},fix:a})}}}}}};var br=D(pe()),wn={meta:{type:"problem",docs:{recommended:!1,description:"Enforce using the classlist prop over importing a classnames helper. The classlist prop accepts an object `{ [class: string]: boolean }` just like classnames."},fixable:"code",schema:[{type:"object",properties:{classnames:{type:"array",description:"An array of names to treat as `classnames` functions",default:["cn","clsx","classnames"],items:{type:"string",minItems:1,uniqueItems:!0}}},additionalProperties:!1}],messages:{preferClasslist:"The classlist prop should be used instead of {{ classnames }} to efficiently set classes based on an object."}},create(e){var t;let r=((t=e.options[0])==null?void 0:t.classnames)??["cn","clsx","classnames"];return{JSXAttribute(n){var o,a;if(!(["class","className"].indexOf(br.default.propName(n))===-1||br.default.hasProp((o=n.parent)==null?void 0:o.attributes,"classlist",{ignoreCase:!1}))&&((a=n.value)==null?void 0:a.type)==="JSXExpressionContainer"){let i=n.value.expression;i.type==="CallExpression"&&i.callee.type==="Identifier"&&r.indexOf(i.callee.name)!==-1&&i.arguments.length===1&&i.arguments[0].type==="ObjectExpression"&&e.report({node:n,messageId:"preferClasslist",data:{classnames:i.callee.name},fix:s=>{let f=n.range,y=i.arguments[0].range;return[s.replaceTextRange([f[0],y[0]],"classlist={"),s.replaceTextRange([y[1],f[1]],"}")]}})}}}}};var Tn=require("@typescript-eslint/utils"),{getStaticValue:us}=Tn.ASTUtils,ls=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i,jn={meta:{type:"problem",docs:{recommended:"error",description:"Disallow javascript: URLs.",url:"https://github.com/solidjs-community/eslint-plugin-solid/blob/main/docs/jsx-no-script-url.md"},schema:[],messages:{noJSURL:"For security, don't use javascript: URLs. Use event handlers instead if you can."}},create(e){return{JSXAttribute(r){if(r.name.type==="JSXIdentifier"&&r.value){let t=us(r.value.type==="JSXExpressionContainer"?r.value.expression:r.value,e.getScope());t&&typeof t.value=="string"&&ls.test(t.value)&&e.report({node:r.value,messageId:"noJSURL"})}}}}};var Sr=D(pe());function Er(e){return e.type==="FunctionExpression"||e.type==="ArrowFunctionExpression"}var ce={checkFragmentShorthand:!1,checkKeyMustBeforeSpread:!1,warnOnDuplicates:!1},ps={missingIterKey:'Missing "key" prop for element in iterator',missingIterKeyUsePrag:'Missing "key" prop for element in iterator. The key prop allows for improved rendering performance. Shorthand fragment syntax does not support providing keys. Use <Fragment> instead',missingArrayKey:'Missing "key" prop for element in array. The key prop allows for improved rendering performance.',missingArrayKeyUsePrag:'Missing "key" prop for element in array. The key prop allows for improved rendering performance. Shorthand fragment syntax does not support providing keys. Use <Fragment> instead',nonUniqueKeys:"`key` prop must be unique"},Fn={meta:{docs:{description:"Disallow missing `key` props in iterators/collection literals",category:"Possible Errors",recommended:!0},messages:ps,schema:[{type:"object",properties:{checkFragmentShorthand:{type:"boolean",default:ce.checkFragmentShorthand},checkKeyMustBeforeSpread:{type:"boolean",default:ce.checkKeyMustBeforeSpread},warnOnDuplicates:{type:"boolean",default:ce.warnOnDuplicates}},additionalProperties:!1}]},create(e){let r=Object.assign({},ce,e.options[0]),t=r.checkFragmentShorthand,n=r.checkKeyMustBeforeSpread,o=r.warnOnDuplicates;function a(u){u.type==="JSXElement"&&!Sr.default.hasProp(u.openingElement.attributes,"key")?e.report({node:u,messageId:"missingIterKey"}):t&&u.type==="JSXFragment"&&e.report({node:u,messageId:"missingIterKeyUsePrag"})}function i(u,p=[]){return u.type==="IfStatement"?(u.consequent&&i(u.consequent,p),u.alternate&&i(u.alternate,p)):Array.isArray(u.body)&&u.body.forEach(m=>{m.type==="IfStatement"&&i(m,p),m.type==="ReturnStatement"&&p.push(m)}),p}function s(u){let p=!1;return u.some(m=>m.type==="JSXSpreadAttribute"?(p=!0,!1):m.type!=="JSXAttribute"?!1:p&&Sr.default.propName(m)==="key")}function f(u){Er(u)&&u.body.type==="BlockStatement"&&i(u.body).filter(p=>p&&p.argument).forEach(p=>{a(p.argument)})}function y(u){let p=u&&u.type==="ArrowFunctionExpression",m=h=>h&&(h.type==="JSXElement"||h.type==="JSXFragment");p&&m(u.body)&&a(u.body),u.body.type==="ConditionalExpression"?(m(u.body.consequent)&&a(u.body.consequent),m(u.body.alternate)&&a(u.body.alternate)):u.body.type==="LogicalExpression"&&m(u.body.right)&&a(u.body.right)}let x=`:matches(
|
|
17
|
+
CallExpression
|
|
18
|
+
[callee.object.object.name=Fragment]
|
|
19
|
+
[callee.object.property.name=Children]
|
|
20
|
+
[callee.property.name=toArray],
|
|
21
|
+
CallExpression
|
|
22
|
+
[callee.object.name=Children]
|
|
23
|
+
[callee.property.name=toArray]
|
|
24
|
+
)`.replace(/\s/g,""),g=!1,c=new WeakSet;return{[x](){g=!0},[`${x}:exit`](){g=!1},"ArrayExpression, JSXElement > JSXElement"(u){if(g)return;let p=(u.type==="ArrayExpression"?u.elements:u.parent.children).filter(h=>h&&h.type==="JSXElement");if(p.length===0)return;let m={};p.forEach(h=>{h.openingElement.attributes.filter(A=>A.name&&A.name.name==="key").length===0&&u.type==="ArrayExpression"&&e.report({node:h,messageId:"missingArrayKey"})}),o&&Object.values(m).filter(h=>h.length>1).forEach(h=>{h.forEach(P=>{c.has(P)||(c.add(P),e.report({node:P,messageId:"nonUniqueKeys"}))})})},JSXFragment(u){!t||g||u.parent.type==="ArrayExpression"&&e.report({node:u,messageId:"missingArrayKeyUsePrag"})},'CallExpression[callee.type="MemberExpression"][callee.property.name="map"], CallExpression[callee.type="OptionalMemberExpression"][callee.property.name="map"], OptionalCallExpression[callee.type="MemberExpression"][callee.property.name="map"], OptionalCallExpression[callee.type="OptionalMemberExpression"][callee.property.name="map"]'(u){if(g)return;let p=u.arguments.length>0&&u.arguments[0];!p||!Er(p)||(y(p),f(p))},'CallExpression[callee.type="MemberExpression"][callee.property.name="from"]'(u){if(g)return;let p=u.arguments.length>1&&u.arguments[1];Er(p)&&(y(p),f(p))}}}};var cs={"no-use-after-await":Ir,"valid-lexical-scope":Tr,"loader-location":Cr,"no-react-props":_n,"prefer-classlist":wn,"jsx-no-script-url":jn,"jsx-key":Fn},fs={recommended:{plugins:["qwik"],rules:{"qwik/no-use-after-await":"error","qwik/valid-lexical-scope":"error","qwik/no-react-props":"error","qwik/prefer-classlist":"warn","qwik/jsx-no-script-url":"warn","qwik/loader-location":"warn","qwik/jsx-key":"warn"}},strict:{plugins:["qwik"],rules:{"qwik/valid-lexical-scope":"error","qwik/no-use-after-await":"error","qwik/loader-location":"error","qwik/no-react-props":"error","qwik/prefer-classlist":"error","qwik/jsx-no-script-url":"error","qwik/jsx-key":"error"}}};0&&(module.exports={configs,rules});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-qwik",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.0-dev20230314171944",
|
|
4
4
|
"description": "An Open-Source sub-framework designed with a focus on server-side-rendering, lazy-loading, and styling/animation.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": "Builder Team",
|
|
@@ -26,8 +26,11 @@
|
|
|
26
26
|
"node": ">=16"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@types/eslint": "8.21.
|
|
29
|
+
"@types/eslint": "8.21.2",
|
|
30
30
|
"@types/estree": "^1.0.0",
|
|
31
31
|
"redent": "^4.0.0"
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"jsx-ast-utils": "^3.3.3"
|
|
32
35
|
}
|
|
33
36
|
}
|