@batijs/core 0.0.278 → 0.0.279

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.
Files changed (2) hide show
  1. package/dist/index.js +2 -2
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -965,7 +965,7 @@ ${x.map(({test:O,consequent:M})=>`<Match when={${d.getText(O)}}>${n(M)}</Match>`
965
965
  `),B){let K=p.body;if(K.type==="BlockStatement")K.body.length>0&&(yield d.insertTextBefore(K.body[0],B));else{let G=w.getTokenBefore(K);G?.value==="("&&(yield d.remove(G));let ee=w.getTokenAfter(K);ee?.value===")"&&(yield d.remove(ee)),yield d.insertTextBefore(K,`{
966
966
  ${B} return (`),yield d.insertTextAfter(K,`);
967
967
  }`)}}let W=w.scopeManager?.acquire(p);if(W){for(let[K,G]of T.map(ee=>[ee,W.set.get(ee.var)]))if(G){for(let ee of G.references)if(ee.isReadOnly()){let ce=K.real.type==="Identifier"&&!K.computed?`.${K.real.name}`:`[${w.getText(K.real)}]`;yield d.replaceText(ee.identifier,`${g}${ce}`)}}}}return{FunctionDeclaration:s,FunctionExpression:s,ArrowFunctionExpression:s,"FunctionDeclaration:exit":a,"FunctionExpression:exit":a,"ArrowFunctionExpression:exit":a,JSXElement(){e.length&&(n().hasJSX=!0)},JSXFragment(){e.length&&(n().hasJSX=!0)}}}})}}),_Nr,dNr,cIr,jFi=x0({"src/rules/no-innerhtml.ts"(){"use strict";QS(),_Nr=QFe.ESLintUtils.RuleCreator.withoutDocs,{getStringIfConstant:dNr}=QFe.ASTUtils,cIr=_Nr({meta:{type:"problem",docs:{description:"Disallow usage of the innerHTML attribute, which can often lead to security vulnerabilities.",url:"https://github.com/solidjs-community/eslint-plugin-solid/blob/main/docs/no-innerhtml.md"},fixable:"code",hasSuggestions:!0,schema:[{type:"object",properties:{allowStatic:{description:"if the innerHTML value is guaranteed to be a static HTML string (i.e. no user input), allow it",type:"boolean",default:!0}},additionalProperties:!1}],messages:{dangerous:"The innerHTML attribute is dangerous; passing unsanitized input can lead to security vulnerabilities.",conflict:"The innerHTML attribute should not be used on an element with child elements; they will be overwritten.",notHtml:"The string passed to innerHTML does not appear to be valid HTML.",useInnerText:"For text content, using innerText is clearer and safer.",dangerouslySetInnerHTML:"The dangerouslySetInnerHTML prop is not supported; use innerHTML instead."}},defaultOptions:[{allowStatic:!0}],create(t){let e=!!(t.options[0]?.allowStatic??!0);return{JSXAttribute(n){if(Ene(n)==="dangerouslySetInnerHTML"){if(n.value?.type==="JSXExpressionContainer"&&n.value.expression.type==="ObjectExpression"&&n.value.expression.properties.length===1){let s=n.value.expression.properties[0];s.type==="Property"&&s.key.type==="Identifier"&&s.key.name==="__html"?t.report({node:n,messageId:"dangerouslySetInnerHTML",fix:a=>{let l=n.range,p=s.value.range;return[a.replaceTextRange([l[0],p[0]],"innerHTML={"),a.replaceTextRange([p[1],l[1]],"}")]}}):t.report({node:n,messageId:"dangerouslySetInnerHTML"})}else t.report({node:n,messageId:"dangerouslySetInnerHTML"});return}else if(Ene(n)!=="innerHTML")return;if(e){let s=n.value?.type==="JSXExpressionContainer"?n.value.expression:n.value,a=s&&dNr(s);typeof a=="string"?(0,oIr.default)(a)?n.parent?.parent?.type==="JSXElement"&&n.parent.parent.children?.length&&t.report({node:n.parent.parent,messageId:"conflict"}):t.report({node:n,messageId:"notHtml",suggest:[{fix:l=>l.replaceText(n.name,"innerText"),messageId:"useInnerText"}]}):t.report({node:n,messageId:"dangerous"})}else t.report({node:n,messageId:"dangerous"})}}}})}}),mNr,uIr,UFi=x0({"src/rules/no-proxy-apis.ts"(){"use strict";QS(),mNr=lIr.ESLintUtils.RuleCreator.withoutDocs,uIr=mNr({meta:{type:"problem",docs:{description:"Disallow usage of APIs that use ES6 Proxies, only to target environments that don't support them.",url:"https://github.com/solidjs-community/eslint-plugin-solid/blob/main/docs/no-proxy-apis.md"},schema:[],messages:{noStore:"Solid Store APIs use Proxies, which are incompatible with your target environment.",spreadCall:"Using a function call in JSX spread makes Solid use Proxies, which are incompatible with your target environment.",spreadMember:"Using a property access in JSX spread makes Solid use Proxies, which are incompatible with your target environment.",proxyLiteral:"Proxies are incompatible with your target environment.",mergeProps:"If you pass a function to `mergeProps`, it will create a Proxy, which are incompatible with your target environment."}},defaultOptions:[],create(t){let{matchImport:e,handleImportDeclaration:n}=KFe();return{ImportDeclaration(s){n(s),s.source.value==="solid-js/store"&&t.report({node:s,messageId:"noStore"})},"JSXSpreadAttribute MemberExpression"(s){t.report({node:s,messageId:"spreadMember"})},"JSXSpreadAttribute CallExpression"(s){t.report({node:s,messageId:"spreadCall"})},CallExpression(s){s.callee.type==="Identifier"?e("mergeProps",s.callee.name)&&s.arguments.filter(a=>{if(a.type==="SpreadElement")return!0;let l=whe(a,t);return l.type==="Identifier"&&!Ahe(l.name)||_y(l)}).forEach(a=>{t.report({node:a,messageId:"mergeProps"})}):s.callee.type==="MemberExpression"&&s.callee.object.type==="Identifier"&&s.callee.object.name==="Proxy"&&s.callee.property.type==="Identifier"&&s.callee.property.name==="revocable"&&t.report({node:s,messageId:"proxyLiteral"})},NewExpression(s){s.callee.type==="Identifier"&&s.callee.name==="Proxy"&&t.report({node:s,messageId:"proxyLiteral"})}}}})}}),hNr,fIr,qFi=x0({"src/rules/no-react-deps.ts"(){"use strict";QS(),hNr=pIr.ESLintUtils.RuleCreator.withoutDocs,fIr=hNr({meta:{type:"problem",docs:{description:"Disallow usage of dependency arrays in `createEffect` and `createMemo`.",url:"https://github.com/solidjs-community/eslint-plugin-solid/blob/main/docs/no-react-deps.md"},fixable:"code",schema:[],messages:{noUselessDep:"In Solid, `{{name}}` doesn't accept a dependency array because it automatically tracks its dependencies. If you really need to override the list of dependencies, use `on`."}},defaultOptions:[],create(t){let{matchImport:e,handleImportDeclaration:n}=KFe();return{ImportDeclaration:n,CallExpression(s){if(s.callee.type==="Identifier"&&e(["createEffect","createMemo"],s.callee.name)&&s.arguments.length===2&&s.arguments.every(a=>a.type!=="SpreadElement")){let[a,l]=s.arguments.map(p=>whe(p,t));_y(a)&&a.params.length===0&&l.type==="ArrayExpression"&&t.report({node:s.arguments[1],messageId:"noUselessDep",data:{name:s.callee.name},fix:l===s.arguments[1]?p=>p.remove(l):void 0})}}}}})}}),gNr,yNr,dIr,VFi=x0({"src/rules/no-react-specific-props.ts"(){"use strict";QS(),gNr=_Ir.ESLintUtils.RuleCreator.withoutDocs,yNr=[{from:"className",to:"class"},{from:"htmlFor",to:"for"}],dIr=gNr({meta:{type:"problem",docs:{description:"Disallow usage of React-specific `className`/`htmlFor` props, which were deprecated in v1.4.0.",url:"https://github.com/solidjs-community/eslint-plugin-solid/blob/main/docs/no-react-specific-props.md"},fixable:"code",schema:[],messages:{prefer:"Prefer the `{{ to }}` prop over the deprecated `{{ from }}` prop.",noUselessKey:"Elements in a <For> or <Index> list do not need a key prop."}},defaultOptions:[],create(t){return{JSXOpeningElement(e){for(let{from:n,to:s}of yNr){let a=Jkr(e.attributes,n);if(a){let l=YNr(e.attributes,s)?void 0:p=>p.replaceText(a.name,s);t.report({node:a,messageId:"prefer",data:{from:n,to:s},fix:l})}}if(e.name.type==="JSXIdentifier"&&vN(e.name.name)){let n=Jkr(e.attributes,"key");n&&t.report({node:n,messageId:"noUselessKey",fix:s=>s.remove(n)})}}}}})}}),bNr,kdt,vNr,TNr,hIr,JFi=x0({"src/rules/no-unknown-namespaces.ts"(){"use strict";QS(),bNr=mIr.ESLintUtils.RuleCreator.withoutDocs,kdt=["on","oncapture","use","prop","attr"],vNr=["style","class"],TNr=["xmlns","xlink"],hIr=bNr({meta:{type:"problem",docs:{description:"Enforce using only Solid-specific namespaced attribute names (i.e. `'on:'` in `<div on:click={...} />`).",url:"https://github.com/solidjs-community/eslint-plugin-solid/blob/main/docs/no-unknown-namespaces.md"},hasSuggestions:!0,schema:[{type:"object",properties:{allowedNamespaces:{description:"an array of additional namespace names to allow",type:"array",items:{type:"string"},default:[],minItems:1,uniqueItems:!0}},additionalProperties:!1}],messages:{unknown:`'{{namespace}}:' is not one of Solid's special prefixes for JSX attributes (${kdt.map(t=>`'${t}:'`).join(", ")}).`,style:"Using the '{{namespace}}:' special prefix is potentially confusing, prefer the '{{namespace}}' prop instead.",component:"Namespaced props have no effect on components.","component-suggest":"Replace {{namespace}}:{{name}} with {{name}}."}},defaultOptions:[],create(t){let e=t.options?.[0]?.allowedNamespaces;return{"JSXAttribute > JSXNamespacedName":n=>{let s=n.parent.parent;if(s.name.type==="JSXIdentifier"&&!vN(s.name.name)){t.report({node:n,messageId:"component",suggest:[{messageId:"component-suggest",data:{namespace:n.namespace.name,name:n.name.name},fix:l=>l.replaceText(n,n.name.name)}]});return}let a=n.namespace?.name;kdt.includes(a)||TNr.includes(a)||e?.includes(a)||(vNr.includes(a)?t.report({node:n,messageId:"style",data:{namespace:a}}):t.report({node:n,messageId:"unknown",data:{namespace:a}}))}}}})}}),SNr,yIr,$Fi=x0({"src/rules/prefer-classlist.ts"(){"use strict";QS(),SNr=gIr.ESLintUtils.RuleCreator.withoutDocs,yIr=SNr({meta:{type:"problem",docs:{description:"Enforce using the classlist prop over importing a classnames helper. The classlist prop accepts an object `{ [class: string]: boolean }` just like classnames.",url:"https://github.com/solidjs-community/eslint-plugin-solid/blob/main/docs/prefer-classlist.md"},fixable:"code",deprecated:!0,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."}},defaultOptions:[],create(t){let e=t.options[0]?.classnames??["cn","clsx","classnames"];return{JSXAttribute(n){if(!(["class","className"].indexOf(Ene(n))===-1||YNr(n.parent?.attributes??[],"classlist"))&&n.value?.type==="JSXExpressionContainer"){let s=n.value.expression;s.type==="CallExpression"&&s.callee.type==="Identifier"&&e.indexOf(s.callee.name)!==-1&&s.arguments.length===1&&s.arguments[0].type==="ObjectExpression"&&t.report({node:n,messageId:"preferClasslist",data:{classnames:s.callee.name},fix:a=>{let l=n.range,p=s.arguments[0].range;return[a.replaceTextRange([l[0],p[0]],"classlist={"),a.replaceTextRange([p[1],l[1]],"}")]}})}}}}})}}),xNr,ENr,bIr,WFi=x0({"src/rules/prefer-for.ts"(){"use strict";QS(),xNr=ZFe.ESLintUtils.RuleCreator.withoutDocs,{getPropertyName:ENr}=ZFe.ASTUtils,bIr=xNr({meta:{type:"problem",docs:{description:"Enforce using Solid's `<For />` component for mapping an array to JSX elements.",url:"https://github.com/solidjs-community/eslint-plugin-solid/blob/main/docs/prefer-for.md"},fixable:"code",schema:[],messages:{preferFor:"Use Solid's `<For />` component for efficiently rendering lists. Array#map causes DOM elements to be recreated.",preferForOrIndex:"Use Solid's `<For />` component or `<Index />` component for rendering lists. Array#map causes DOM elements to be recreated."}},defaultOptions:[],create(t){let e=n=>{let s=n.parent,a=n.callee.object,l=n.arguments[0];t.report({node:n,messageId:"preferFor",fix:p=>{let f=[s.range[0],a.range[0]],d=[a.range[1],l.range[0]],g=[l.range[1],s.range[1]];return[p.replaceTextRange(f,"<For each={"),p.replaceTextRange(d,"}>{"),p.replaceTextRange(g,"}</For>")]}})};return{CallExpression(n){let s=n.parent?.type==="ChainExpression"?n.parent:n;if(s.parent?.type==="JSXExpressionContainer"&&yq(s.parent.parent)&&n.callee.type==="MemberExpression"&&ENr(n.callee)==="map"&&n.arguments.length===1&&_y(n.arguments[0])){let a=n.arguments[0];a.params.length===1&&a.params[0].type!=="RestElement"?e(n):t.report({node:n,messageId:"preferForOrIndex"})}}}}})}}),CNr,YFe,TIr,YFi=x0({"src/rules/prefer-show.ts"(){"use strict";QS(),TN(),CNr=vIr.ESLintUtils.RuleCreator.withoutDocs,YFe=["JSXElement","JSXFragment","Identifier"],TIr=CNr({meta:{type:"problem",docs:{description:"Enforce using Solid's `<Show />` component for conditionally showing content. Solid's compiler covers this case, so it's a stylistic rule only.",url:"https://github.com/solidjs-community/eslint-plugin-solid/blob/main/docs/prefer-show.md"},fixable:"code",schema:[],messages:{preferShowAnd:"Use Solid's `<Show />` component for conditionally showing content.",preferShowTernary:"Use Solid's `<Show />` component for conditionally showing content with a fallback."}},defaultOptions:[],create(t){let e=DA(t),n=l=>{let p=e.getText(l);return yq(l)?p:`{${p}}`},s=l=>{l.operator==="&&"&&YFe.includes(l.right.type)&&t.report({node:l,messageId:"preferShowAnd",fix:p=>p.replaceText(l.parent?.type==="JSXExpressionContainer"&&yq(l.parent.parent)?l.parent:l,`<Show when={${e.getText(l.left)}}>${n(l.right)}</Show>`)})},a=l=>{(YFe.includes(l.consequent.type)||YFe.includes(l.alternate.type))&&t.report({node:l,messageId:"preferShowTernary",fix:p=>p.replaceText(l.parent?.type==="JSXExpressionContainer"&&yq(l.parent.parent)?l.parent:l,`<Show when={${e.getText(l.test)}} fallback={${e.getText(l.alternate)}}>${n(l.consequent)}</Show>`)})};return{JSXExpressionContainer(l){yq(l.parent)&&(l.expression.type==="LogicalExpression"?s(l.expression):l.expression.type==="ArrowFunctionExpression"&&l.expression.body.type==="LogicalExpression"?s(l.expression.body):l.expression.type==="ConditionalExpression"?a(l.expression):l.expression.type==="ArrowFunctionExpression"&&l.expression.body.type==="ConditionalExpression"&&a(l.expression.body))}}}})}}),ANr,PNr,wNr,DNr,Sne,xne,xIr,zFi=x0({"src/rules/reactivity.ts"(){"use strict";QS(),TN(),{getFunctionHeadLocation:ANr}=e8e.ASTUtils,PNr=e8e.ESLintUtils.RuleCreator.withoutDocs,wNr=class{node;trackedScopes=[];unnamedDerivedSignals=new Set;hasJSX=!1;constructor(t){this.node=t}},DNr=class extends Array{currentScope=()=>this[this.length-1];parentScope=()=>this[this.length-2];pushSignal(t,e=this.currentScope().node){this.signals.push({references:t.references.filter(n=>!n.init),variable:t,declarationScope:e})}pushUniqueSignal(t,e){let n=this.signals.find(s=>s.variable===t);n?n.declarationScope=this.findDeepestDeclarationScope(n.declarationScope,e):this.pushSignal(t,e)}pushProps(t,e=this.currentScope().node){this.props.push({references:t.references.filter(n=>!n.init),variable:t,declarationScope:e})}syncCallbacks=new Set;*consumeSignalReferencesInScope(){yield*this.consumeReferencesInScope(this.signals),this.signals=this.signals.filter(t=>t.references.length!==0)}*consumePropsReferencesInScope(){yield*this.consumeReferencesInScope(this.props),this.props=this.props.filter(t=>t.references.length!==0)}*consumeReferencesInScope(t){for(let e of t){let{references:n}=e,s=[],a=[];n.forEach(l=>{this.isReferenceInCurrentScope(l)?s.push(l):a.push(l)}),yield*s.map(l=>({reference:l,declarationScope:e.declarationScope})),e.references=a}}findDeepestDeclarationScope=(t,e)=>{if(t===e)return t;for(let n=this.length-1;n>=0;n-=1){let{node:s}=this[n];if(t===s||e===s)return s}throw new Error("This should never happen")};isReferenceInCurrentScope(t){let e=xdt(t.identifier,zFe);for(;_y(e)&&this.syncCallbacks.has(e);)e=xdt(e,zFe);return e===this.currentScope().node}signals=[];props=[]},Sne=(t,e,n)=>{if(t?.type==="ArrayPattern"){let s=t.elements[e];if(s?.type==="Identifier")return B8(n,s)}return null},xne=(t,e)=>t.type==="Identifier"?B8(e,t):null,xIr=PNr({meta:{type:"problem",docs:{description:"Enforce that reactivity (props, signals, memos, etc.) is properly used, so changes in those values will be tracked and update the view as expected.",url:"https://github.com/solidjs-community/eslint-plugin-solid/blob/main/docs/reactivity.md"},schema:[{type:"object",properties:{customReactiveFunctions:{description:"List of function names to consider as reactive functions (allow signals to be safely passed as arguments). In addition, any create* or use* functions are automatically included.",type:"array",items:{type:"string"},default:[]}},additionalProperties:!1}],messages:{noWrite:"The reactive variable '{{name}}' should not be reassigned or altered directly.",untrackedReactive:"The reactive variable '{{name}}' should be used within JSX, a tracked scope (like createEffect), or inside an event handler function, or else changes will be ignored.",expectedFunctionGotExpression:"The reactive variable '{{name}}' should be wrapped in a function for reactivity. This includes event handler bindings on native elements, which are not reactive like other JSX props.",badSignal:"The reactive variable '{{name}}' should be called as a function when used in {{where}}.",badUnnamedDerivedSignal:"This function should be passed to a tracked scope (like createEffect) or an event handler because it contains reactivity, or else changes will be ignored.",shouldDestructure:"For proper analysis, array destructuring should be used to capture the {{nth}}result of this function call.",shouldAssign:"For proper analysis, a variable should be used to capture the result of this function call.",noAsyncTrackedScope:"This tracked scope should not be async. Solid's reactivity only tracks synchronously."}},defaultOptions:[{customReactiveFunctions:[]}],create(t,[e]){let n=(B,W)=>t.report({node:B,messageId:"shouldDestructure",data:W?{nth:W+" "}:void 0}),s=B=>t.report({node:B,messageId:"shouldAssign"}),a=DA(t),l=new DNr,{currentScope:p,parentScope:f}=l,{matchImport:d,handleImportDeclaration:g}=KFe(),y=(B,W)=>{if(B.params.length===1&&B.params[0].type==="Identifier"&&B.parent?.type!=="JSXExpressionContainer"&&B.parent?.type!=="TemplateLiteral"&&W(B.params[0])){let K=B8(t,B.params[0]);K&&l.pushProps(K,B)}},T=B=>{if(_y(B)){if(l.syncCallbacks.has(B))return;y(B,W=>Ahe(W.name))}l.push(new wNr(B))},v=(B,W)=>{switch(B.expect){case"function":case"called-function":return W===B.node;case"expression":return!!kFi(W,p().node,K=>K===B.node)}},x=(B,W)=>{let K=p().node;if(!p().trackedScopes.find(G=>v(G,B))){let G=p().trackedScopes.find(ee=>v({...ee,expect:"expression"},B));if(W===K){let ee=null;if(B.parent?.type==="MemberExpression")for(ee=B.parent;ee.parent?.type==="MemberExpression";)ee=ee.parent;let ce=B.parent?.type==="CallExpression"?B.parent:null;t.report({node:ee??ce??B,messageId:G?"expectedFunctionGotExpression":"untrackedReactive",data:{name:ee?a.getText(ee):B.name}})}else{if(!f()||!_y(K))throw new Error("this shouldn't happen!");let ee=()=>(f().unnamedDerivedSignals??=new Set).add(K);if(K.type==="FunctionDeclaration"){let ce=a.scopeManager?.getDeclaredVariables(K)?.[0];ce?l.pushUniqueSignal(ce,W):ee()}else if(K.parent?.type==="VariableDeclarator"){let ce=K.parent,he=a.scopeManager?.getDeclaredVariables(ce)?.[0];he?l.pushUniqueSignal(he,W):ee()}else K.parent?.type==="Property"||ee()}}},A=B=>{if(_y(B)&&y(B,K=>{if(!Ahe(K.name)&&p().hasJSX){let G=Odt(B);if(G&&!/^[a-z]/.test(G))return!0}return!1}),_y(B)&&l.syncCallbacks.has(B))return;for(let{reference:K,declarationScope:G}of l.consumeSignalReferencesInScope()){let ee=K.identifier;if(K.isWrite())t.report({node:ee,messageId:"noWrite",data:{name:ee.name}});else if(ee.type==="Identifier"){let ce=he=>t.report({node:ee,messageId:"badSignal",data:{name:ee.name,where:he}});if(ee.parent?.type==="CallExpression"||ee.parent?.type==="ArrayExpression"&&ee.parent.parent?.type==="CallExpression")x(ee,G);else if(ee.parent?.type==="TemplateLiteral")ce("template literals");else if(ee.parent?.type==="BinaryExpression"&&["<","<=",">",">=","<<",">>",">>>","+","-","*","/","%","**","|","^","&","in"].includes(ee.parent.operator))ce("arithmetic or comparisons");else if(ee.parent?.type==="UnaryExpression"&&["-","+","~"].includes(ee.parent.operator))ce("unary expressions");else if(ee.parent?.type==="MemberExpression"&&ee.parent.computed&&ee.parent.property===ee)ce("property accesses");else if(ee.parent?.type==="JSXExpressionContainer"&&!p().trackedScopes.find(he=>he.node===ee&&(he.expect==="function"||he.expect==="called-function"))){let he=ee.parent.parent;(yq(he)||he?.type==="JSXAttribute"&&he.parent?.type==="JSXOpeningElement"&&he.parent.name.type==="JSXIdentifier"&&vN(he.parent.name.name))&&ce("JSX")}}}for(let{reference:K,declarationScope:G}of l.consumePropsReferencesInScope()){let ee=K.identifier;if(K.isWrite())t.report({node:ee,messageId:"noWrite",data:{name:ee.name}});else if(ee.parent?.type==="MemberExpression"&&ee.parent.object===ee){let{parent:ce}=ee;ce.parent?.type==="AssignmentExpression"&&ce.parent.left===ce?t.report({node:ee,messageId:"noWrite",data:{name:ee.name}}):ce.property.type==="Identifier"&&/^(?:initial|default|static[A-Z])/.test(ce.property.name)||x(ee,G)}else(ee.parent?.type==="AssignmentExpression"||ee.parent?.type==="VariableDeclarator")&&t.report({node:ee,messageId:"untrackedReactive",data:{name:ee.name}})}let{unnamedDerivedSignals:W}=p();if(W)for(let K of W)p().trackedScopes.find(G=>v(G,K))||t.report({loc:ANr(K,a),messageId:"badUnnamedDerivedSignal"});l.pop()},w=B=>{if(B.arguments.length===1&&_y(B.arguments[0])&&!B.arguments[0].async&&(B.callee.type==="Identifier"&&d(["batch","produce"],B.callee.name)||B.callee.type==="MemberExpression"&&!B.callee.computed&&B.callee.object.type!=="ObjectExpression"&&/^(?:forEach|map|flatMap|reduce|reduceRight|find|findIndex|filter|every|some)$/.test(B.callee.property.name))&&l.syncCallbacks.add(B.arguments[0]),B.callee.type==="Identifier"){if(d(["createSignal","createStore"],B.callee.name)&&B.parent?.type==="VariableDeclarator"){let W=Sne(B.parent.id,1,t);if(W)for(let K of W.references){let{identifier:G}=K;if(!K.init&&K.isRead()&&G.parent?.type==="CallExpression")for(let ee of G.parent.arguments)_y(ee)&&!ee.async&&l.syncCallbacks.add(ee)}}else if(d(["mapArray","indexArray"],B.callee.name)){let W=B.arguments[1];_y(W)&&l.syncCallbacks.add(W)}}_y(B.callee)&&l.syncCallbacks.add(B.callee)},O=(B,W)=>{if(W=Ndt(W),W.type==="CallExpression"&&W.callee.type==="Identifier"){let{callee:K}=W;if(d(["createSignal","useTransition"],K.name)){let G=B&&Sne(B,0,t);G?l.pushSignal(G,p().node):n(B??W,"first")}else if(d(["createMemo","createSelector"],K.name)){let G=B&&xne(B,t);G?l.pushSignal(G,p().node):s(B??W)}else if(d("createStore",K.name)){let G=B&&Sne(B,0,t);G?l.pushProps(G,p().node):n(B??W,"first")}else if(d("mergeProps",K.name)){let G=B&&xne(B,t);G?l.pushProps(G,p().node):s(B??W)}else if(d("splitProps",K.name))if(B?.type==="ArrayPattern"){let G=B.elements.map((ee,ce)=>Sne(B,ce,t)).filter(Boolean);G.length===0?n(B):G.forEach(ee=>{l.pushProps(ee,p().node)})}else{let G=B&&xne(B,t);G&&l.pushProps(G,p().node)}else if(d("createResource",K.name)){let G=B&&Sne(B,0,t);G&&l.pushProps(G,p().node)}else if(d("createMutable",K.name)){let G=B&&xne(B,t);G&&l.pushProps(G,p().node)}else if(d("mapArray",K.name)){let G=W.arguments[1];if(_y(G)&&G.params.length>=2&&G.params[1].type==="Identifier"){let ee=B8(t,G.params[1]);ee&&l.pushSignal(ee)}}else if(d("indexArray",K.name)){let G=W.arguments[1];if(_y(G)&&G.params.length>=1&&G.params[0].type==="Identifier"){let ee=B8(t,G.params[0]);ee&&l.pushSignal(ee)}}}},M=B=>{let W=(G,ee)=>{p().trackedScopes.push({node:G,expect:ee}),ee!=="called-function"&&_y(G)&&G.async&&t.report({node:G,messageId:"noAsyncTrackedScope"})},K=G=>{(0,SIr.traverse)(G,{enter(ee){let ce=ee,he=whe(ce,t);(_y(he)||he.type==="Identifier"&&he.parent.type!=="MemberExpression"&&!(he.parent.type==="CallExpression"&&he.parent.callee===he))&&(W(ce,"called-function"),this.skip())},fallback:"iteration"})};if(B.type==="JSXExpressionContainer")B.parent?.type==="JSXAttribute"&&/^on[:A-Z]/.test(a.getText(B.parent.name))&&B.parent.parent?.type==="JSXOpeningElement"&&B.parent.parent.name.type==="JSXIdentifier"&&vN(B.parent.parent.name.name)||B.parent?.type==="JSXAttribute"&&B.parent.name.type==="JSXNamespacedName"&&B.parent.name.namespace.name==="use"&&_y(B.expression)?W(B.expression,"called-function"):B.parent?.type==="JSXAttribute"&&B.parent.name.name==="value"&&B.parent.parent?.type==="JSXOpeningElement"&&(B.parent.parent.name.type==="JSXIdentifier"&&B.parent.parent.name.name.endsWith("Provider")||B.parent.parent.name.type==="JSXMemberExpression"&&B.parent.parent.name.property.name==="Provider")||B.parent?.type==="JSXAttribute"&&B.parent.name?.type==="JSXIdentifier"&&/^static[A-Z]/.test(B.parent.name.name)&&B.parent.parent?.type==="JSXOpeningElement"&&B.parent.parent.name.type==="JSXIdentifier"&&!vN(B.parent.parent.name.name)||(B.parent?.type==="JSXAttribute"&&B.parent.name.name==="ref"&&_y(B.expression)?W(B.expression,"called-function"):yq(B.parent)&&_y(B.expression)?W(B.expression,"function"):W(B.expression,"expression"));else if(B.type==="JSXSpreadAttribute")W(B.argument,"expression");else if(B.type==="NewExpression"){let{callee:G,arguments:{0:ee}}=B;G.type==="Identifier"&&ee&&["IntersectionObserver","MutationObserver","PerformanceObserver","ReportingObserver","ResizeObserver"].includes(G.name)&&W(ee,"called-function")}else if(B.type==="CallExpression"){if(B.callee.type==="Identifier"){let{callee:G,arguments:{0:ee,1:ce}}=B;if(d(["createMemo","children","createEffect","createRenderEffect","createDeferred","createComputed","createSelector","untrack","mapArray","indexArray","observable"],G.name)||d("createResource",G.name)&&B.arguments.length>=2)W(ee,"function");else if(d(["onMount","onCleanup","onError"],G.name)||["setInterval","setTimeout","setImmediate","requestAnimationFrame","requestIdleCallback"].includes(G.name))W(ee,"called-function");else if(d("on",G.name))ee&&(ee.type==="ArrayExpression"?ee.elements.forEach(he=>{he&&he?.type!=="SpreadElement"&&W(he,"function")}):W(ee,"function")),ce&&W(ce,"called-function");else if(d("createStore",G.name)&&ee?.type==="ObjectExpression")for(let he of ee.properties)he.type==="Property"&&he.kind==="get"&&_y(he.value)&&W(he.value,"function");else if(d("runWithOwner",G.name)){if(ce){let he=!0,Ne=ee.type==="Identifier"&&B8(t,ee);if(Ne){let Be=Ne.defs[0];if(Be&&Be.node.type==="VariableDeclarator"&&Be.node.init?.type==="CallExpression"&&Be.node.init.callee.type==="Identifier"&&d("getOwner",Be.node.init.callee.name)){let Oe=xdt(Be.node,zFe),$e=l.findIndex(({node:et})=>Oe===et);($e>=1&&!l[$e-1].trackedScopes.some(et=>et.expect==="function"&&et.node===Oe)||$e===0)&&(he=!1)}}he&&W(ce,"function")}}else if(/^(?:use|create)[A-Z]/.test(G.name)||e.customReactiveFunctions.includes(G.name))for(let he of B.arguments)K(he)}else if(B.callee.type==="MemberExpression"){let{property:G}=B.callee;if(G.type==="Identifier"&&G.name==="addEventListener"&&B.arguments.length>=2)W(B.arguments[1],"called-function");else if(G.type==="Identifier"&&(/^(?:use|create)[A-Z]/.test(G.name)||e.customReactiveFunctions.includes(G.name)))for(let ee of B.arguments)K(ee)}}else if(B.type==="VariableDeclarator"){if(B.init?.type==="CallExpression"&&B.init.callee.type==="Identifier"&&d(["createReactive","createReaction"],B.init.callee.name)){let G=xne(B.id,t);if(G){for(let ee of G.references)if(!ee.init&&ee.isReadOnly()&&ee.identifier.parent?.type==="CallExpression"&&ee.identifier.parent.callee===ee.identifier){let ce=ee.identifier.parent.arguments[0];ce&&W(ce,"function")}}_y(B.init.arguments[0])&&W(B.init.arguments[0],"called-function")}}else if(B.type==="AssignmentExpression")B.left.type==="MemberExpression"&&B.left.property.type==="Identifier"&&_y(B.right)&&/^on[a-z]+$/.test(B.left.property.name)&&W(B.right,"called-function");else if(B.type==="TaggedTemplateExpression"){for(let G of B.quasi.expressions)if(_y(G)){W(G,"called-function");for(let ee of G.params)if(ee.type==="Identifier"&&Ahe(ee.name)){let ce=B8(t,ee);ce&&l.pushProps(ce,p().node)}}}};return{ImportDeclaration:g,JSXExpressionContainer(B){M(B)},JSXSpreadAttribute(B){M(B)},CallExpression(B){M(B),w(B);let W=B.parent&&Ndt(B.parent,!0);W?.type!=="AssignmentExpression"&&W?.type!=="VariableDeclarator"&&O(null,B)},NewExpression(B){M(B)},VariableDeclarator(B){B.init&&(O(B.id,B.init),M(B))},AssignmentExpression(B){B.left.type!=="MemberExpression"&&O(B.left,B.right),M(B)},TaggedTemplateExpression(B){M(B)},"JSXElement > JSXExpressionContainer > :function"(B){if(_y(B)&&B.parent?.type==="JSXExpressionContainer"&&B.parent.parent?.type==="JSXElement"){let W=B.parent.parent;if(W.openingElement.name.type==="JSXIdentifier"){let K=W.openingElement.name.name;if(d("For",K)&&B.params.length===2&&B.params[1].type==="Identifier"){let G=B8(t,B.params[1]);G&&l.pushSignal(G,p().node)}else if(d("Index",K)&&B.params.length>=1&&B.params[0].type==="Identifier"){let G=B8(t,B.params[0]);G&&l.pushSignal(G,p().node)}}}},FunctionExpression:T,ArrowFunctionExpression:T,FunctionDeclaration:T,Program:T,"FunctionExpression:exit":A,"ArrowFunctionExpression:exit":A,"FunctionDeclaration:exit":A,"Program:exit":A,JSXElement(){l.length&&(p().hasJSX=!0)},JSXFragment(){l.length&&(p().hasJSX=!0)}}}})}});function KFi(t){return t.name.type==="JSXIdentifier"&&!vN(t.name.name)||t.name.type==="JSXMemberExpression"}function GFi(t){return CIr.test(t)}function HFi(t){return t.parent.children.length===0}function XFi(t){let e=t.parent.children;return e.length===1&&e[0].type==="JSXText"&&e[0].value.indexOf(`
968
- `)!==-1&&e[0].value.replace(/(?!\xA0)\s/g,"")===""}var kNr,CIr,AIr,QFi=x0({"src/rules/self-closing-comp.ts"(){"use strict";QS(),TN(),kNr=EIr.ESLintUtils.RuleCreator.withoutDocs,CIr=/^(?:area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/,AIr=kNr({meta:{type:"layout",docs:{description:"Disallow extra closing tags for components without children.",url:"https://github.com/solidjs-community/eslint-plugin-solid/blob/main/docs/self-closing-comp.md"},fixable:"code",schema:[{type:"object",properties:{component:{type:"string",description:"which Solid components should be self-closing when possible",enum:["all","none"],default:"all"},html:{type:"string",description:"which native elements should be self-closing when possible",enum:["all","void","none"],default:"all"}},additionalProperties:!1}],messages:{selfClose:"Empty components are self-closing.",dontSelfClose:"This element should not be self-closing."}},defaultOptions:[],create(t){function e(n){if(KFi(n))return(t.options[0]?.component??"all")==="all";if(n.name.type==="JSXIdentifier"&&vN(n.name.name))switch(t.options[0]?.html??"all"){case"all":return!0;case"void":return GFi(n.name.name);case"none":return!1}return!0}return{JSXOpeningElement(n){if(HFi(n)||XFi(n)){let a=e(n);a&&!n.selfClosing?t.report({node:n,messageId:"selfClose",fix(l){let p=n.range[1]-1,f=n.parent.closingElement.range[1],d=[p,f];return l.replaceTextRange(d," />")}}):!a&&n.selfClosing&&t.report({node:n,messageId:"dontSelfClose",fix(l){let p=DA(t),f=p.getText(n.name),d=n.range[1],g=p.getLastTokens(n,{count:3}),T=[p.isSpaceBetween?.(g[0],g[1])?d-3:d-2,d];return l.replaceTextRange(T,`></${f}>`)}})}}}}})}}),NNr,INr,FNr,ONr,DIr,ZFi=x0({"src/rules/style-prop.ts"(){"use strict";QS(),TN(),NNr=t8e.ESLintUtils.RuleCreator.withoutDocs,{getPropertyName:INr,getStaticValue:FNr}=t8e.ASTUtils,ONr=/\b(?:width|height|margin|padding|border-width|font-size)\b/i,DIr=NNr({meta:{type:"problem",docs:{description:"Require CSS properties in the `style` prop to be valid and kebab-cased (ex. 'font-size'), not camel-cased (ex. 'fontSize') like in React, and that property values with dimensions are strings, not numbers with implicit 'px' units.",url:"https://github.com/solidjs-community/eslint-plugin-solid/blob/main/docs/style-prop.md"},fixable:"code",schema:[{type:"object",properties:{styleProps:{description:"an array of prop names to treat as a CSS style object",default:["style"],type:"array",items:{type:"string"},minItems:1,uniqueItems:!0},allowString:{description:"if allowString is set to true, this rule will not convert a style string literal into a style object (not recommended for performance)",type:"boolean",default:!1}},additionalProperties:!1}],messages:{kebabStyleProp:"Use {{ kebabName }} instead of {{ name }}.",invalidStyleProp:"{{ name }} is not a valid CSS property.",numericStyleValue:'This CSS property value should be a string with a unit; Solid does not automatically append a "px" unit.',stringStyle:"Use an object for the style prop instead of a string."}},defaultOptions:[],create(t){let e=new Set(wIr.all),n=!!t.options[0]?.allowString,s=t.options[0]?.styleProps||["style"];return{JSXAttribute(a){if(s.indexOf(Ene(a))===-1)return;let l=a.value?.type==="JSXExpressionContainer"?a.value.expression:a.value;if(l)if(l.type==="Literal"&&typeof l.value=="string"&&!n){let p;try{p=qkr(l.value)??void 0}catch{}t.report({node:l,messageId:"stringStyle",fix:p&&(f=>f.replaceText(a.value,`{${JSON.stringify(p)}}`))})}else l.type==="TemplateLiteral"&&!n?t.report({node:l,messageId:"stringStyle"}):l.type==="ObjectExpression"&&l.properties.filter(f=>f.type==="Property").forEach(f=>{let d=INr(f,Phe(t,f));if(d&&!d.startsWith("--")&&!e.has(d)){let g=(0,PIr.default)(d);e.has(g)?t.report({node:f.key,messageId:"kebabStyleProp",data:{name:d,kebabName:g},fix:y=>y.replaceText(f.key,`"${g}"`)}):t.report({node:f.key,messageId:"invalidStyleProp",data:{name:d}})}else if(!d||!d.startsWith("--")&&ONr.test(d)){let g=FNr(f.value)?.value;typeof g=="number"&&g!==0&&t.report({node:f.value,messageId:"numericStyleValue"})}});else return}}}})}}),LNr,NIr,e8i=x0({"src/rules/no-array-handlers.ts"(){"use strict";QS(),LNr=kIr.ESLintUtils.RuleCreator.withoutDocs,NIr=LNr({meta:{type:"problem",docs:{description:"Disallow usage of type-unsafe event handlers.",url:"https://github.com/solidjs-community/eslint-plugin-solid/blob/main/docs/no-array-handlers.md"},schema:[],messages:{noArrayHandlers:"Passing an array as an event handler is potentially type-unsafe."}},defaultOptions:[],create(t){return{JSXAttribute(e){let n=e.parent;if(n.name.type!=="JSXIdentifier"||!vN(n.name.name))return;let s=e.name.type==="JSXNamespacedName"&&e.name.namespace.name==="on",a=e.name.type==="JSXIdentifier"&&/^on[a-zA-Z]/.test(e.name.name);(s||a)&&e.value?.type==="JSXExpressionContainer"&&whe(e.value.expression,t).type==="ArrayExpression"&&t.report({node:e,messageId:"noArrayHandlers"})}}}})}}),t8i=qNr({"package.json"(t,e){e.exports={name:"eslint-plugin-solid",version:"0.14.3",description:"Solid-specific linting rules for ESLint.",keywords:["eslint","eslintplugin","solid","solidjs","reactivity"],repository:"https://github.com/solidjs-community/eslint-plugin-solid",license:"MIT",author:"Josh Wilson <joshwilsonvu@gmail.com>",exports:{".":{types:{import:"./dist/index.d.mts",require:"./dist/index.d.ts"},import:"./dist/index.mjs",require:"./dist/index.js"},"./configs/recommended":{types:{import:"./dist/configs/recommended.d.mts",require:"./dist/configs/recommended.d.ts"},import:"./dist/configs/recommended.mjs",require:"./dist/configs/recommended.js"},"./configs/typescript":{types:{import:"./dist/configs/typescript.d.mts",require:"./dist/configs/typescript.d.ts"},import:"./dist/configs/typescript.mjs",require:"./dist/configs/typescript.js"},"./package.json":"./package.json"},main:"dist/index.js",types:"dist/index.d.ts",files:["src","dist","README.md"],scripts:{build:"tsup",test:"vitest --run","test:all":"PARSER=all vitest --run","test:babel":"PARSER=babel vitest --run","test:ts":"PARSER=ts vitest --run","test:v6":"PARSER=v6 vitest --run","test:v7":"PARSER=v7 vitest --run","test:watch":"vitest","turbo:build":"tsup","turbo:docs":"PARSER=none tsx scripts/docs.ts","turbo:test":"vitest --run"},dependencies:{"@typescript-eslint/utils":"^7.13.1 || ^8.0.0",estraverse:"^5.3.0","is-html":"^2.0.0","kebab-case":"^1.0.2","known-css-properties":"^0.30.0","style-to-object":"^1.0.6"},devDependencies:{"@babel/core":"^7.24.4","@babel/eslint-parser":"^7.24.7","@microsoft/api-extractor":"^7.47.6","@types/eslint":"^8.56.10","@types/eslint-v6":"npm:@types/eslint@6","@types/eslint-v7":"npm:@types/eslint@7","@types/eslint-v8":"npm:@types/eslint@8","@types/eslint__js":"^8.42.3","@types/estraverse":"^5.1.7","@types/is-html":"^2.0.2","@typescript-eslint/eslint-plugin":"^8.0.0","@typescript-eslint/parser":"^8.0.0",eslint:"^9.5.0","eslint-v6":"npm:eslint@6","eslint-v7":"npm:eslint@7","eslint-v8":"npm:eslint@8","markdown-magic":"^3.3.0",prettier:"^2.8.8",tsup:"^8.2.4",tsx:"^4.17.0",vitest:"^1.5.2"},peerDependencies:{eslint:"^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0"},engines:{node:">=18.0.0"}}}}),RNr,MNr,BNr,jNr,IIr,r8i=x0({"src/plugin.ts"(){"use strict";NFi(),IFi(),FFi(),OFi(),LFi(),RFi(),MFi(),BFi(),jFi(),UFi(),qFi(),VFi(),JFi(),$Fi(),WFi(),YFi(),zFi(),QFi(),ZFi(),e8i(),{name:RNr,version:MNr}=t8i(),BNr={name:RNr,version:MNr},jNr={"components-return-once":GNr,"event-handlers":HNr,imports:QNr,"jsx-no-duplicate-props":eIr,"jsx-no-undef":nIr,"jsx-no-script-url":tIr,"jsx-uses-vars":sIr,"no-destructure":aIr,"no-innerhtml":cIr,"no-proxy-apis":uIr,"no-react-deps":fIr,"no-react-specific-props":dIr,"no-unknown-namespaces":hIr,"prefer-classlist":yIr,"prefer-for":bIr,"prefer-show":TIr,reactivity:xIr,"self-closing-comp":AIr,"style-prop":DIr,"no-array-handlers":NIr},IIr={meta:BNr,rules:jNr}}}),FIr=qNr({"src/configs/recommended.ts"(t,e){r8i();var n={plugins:{solid:IIr},languageOptions:{sourceType:"module",parserOptions:{ecmaFeatures:{jsx:!0}}},rules:{"solid/jsx-no-duplicate-props":2,"solid/jsx-no-undef":2,"solid/jsx-uses-vars":2,"solid/no-unknown-namespaces":2,"solid/no-innerhtml":2,"solid/jsx-no-script-url":2,"solid/components-return-once":1,"solid/no-destructure":2,"solid/prefer-for":2,"solid/reactivity":1,"solid/event-handlers":1,"solid/imports":1,"solid/style-prop":1,"solid/no-react-deps":1,"solid/no-react-specific-props":1,"solid/self-closing-comp":1,"solid/no-array-handlers":0,"solid/prefer-show":0,"solid/no-proxy-apis":0,"solid/prefer-classlist":0}};e.exports=n}});var OIr=FIr();function bq(t,e){let s=new Function(`{ return function(BATI, BATI_TEST){ return ${t} } };`).call(null).call(null,e.BATI,e.BATI_TEST);if(s!=="remove-comments-only"&&typeof s!="boolean")throw new Error("Condition evaluation failed");return s}function LIr(t){return!t.includes("BATI.has")&&!t.includes("BATI_TEST")?null:t.replace(/^# /,"").trim()}function RIr(t,e){if(!e.test.range)return null;let n=t.text.slice(e.test.range[0],e.test.range[1]);return LIr(n)}function r8e(t){return LIr(t.value)}function MIr(t){return t.value.includes(" BATI ")?t.value.replace(/^#/,"").replace(/#$/,"").replace(/\s+BATI\s+/,"").trim().split(","):null}function BIr(t){return[t.body[0].range[0],t.body[t.body.length-1].range[1]]}function jIr(t,e,n){return t.type==="ConditionalExpression"&&"parent"in t&&t.parent&&t.parent.type==="JSXExpressionContainer"&&(e.type==="JSXElement"||n==="null"||n==="undefined")?{range:t.parent.range,body:n==="null"||n==="undefined"?"":n}:{range:t.range,body:n}}function vq(t,e,n,s){let a=RIr(e,n);if(a===null)return;let l=bq(a,s);t.report({node:n,message:"bati/if-statement",*fix(p){if(l)if(n.consequent.type==="BlockStatement"){let f=e.text.slice(...BIr(n.consequent));yield p.replaceTextRange(n.range,f)}else{let f=e.text.slice(...n.consequent.range),d=jIr(n,n.consequent,f);yield p.replaceTextRange(d.range,d.body)}else if(n.alternate)if(n.alternate.type==="BlockStatement"){let f=e.text.slice(...BIr(n.alternate));yield p.replaceTextRange(n.range,f)}else{let f=e.text.slice(...n.alternate.range),d=jIr(n,n.alternate,f);yield p.replaceTextRange(d.range,d.body)}else yield p.remove(n)}})}function UIr(t,e,n){let s=e.getAllComments();if(s.length>0&&s[0].range?.[0]===0){let a=s[0],l=MIr(a);if(l===null||l.length===0)return;let p=Bre(t);for(let f of l)switch(f){case"include-if-imported":p?.addFlag(f);break;default:t.report({node:n,message:`Unknown BATI file flag ${f}`,loc:a.loc});return}t.report({node:n,message:"bati/global-comment",*fix(f){yield f.remove(a)}})}}function tK(t,e,n,s){let a=e.getCommentsBefore(n);if(a.length>0){let l=a[0];if(l.handled)return;l.handled=!0;let p=r8e(l);if(p===null)return;let f=bq(p,s),d,g;if(!(a.length>1&&f==="remove-comments-only")){let T=["Property"];for(["SpreadElement","Identifier"].includes(n.type)&&T.includes(n.parent?.type)&&(n=n.parent),d=n.range[0],g=n.range[1];e.text[g]?.match(/\s|,/)&&(g+=1,e.text[g-1]!==","););}t.report({node:n,message:"bati/statement-comments",*fix(T){if(!f||f==="remove-comments-only"){d!==void 0&&g!==void 0&&(yield T.removeRange([d,g]));for(let v of a)yield T.remove(v)}else yield T.remove(l)}})}}var SDs=Bf(LR(),1),xDs=Bf(xs(),1);function n8e(t,e,n,s){Ldt(t,e,n.typeAnnotation,s,()=>{let a=n.expression.range[1]+1,l=n.range[1];return[a,l]},(a,l)=>l.name==="IfAsUnkown"?` as unknown as ${a}`:` as ${a}`)}function i8e(t,e,n,s){for(let a of n.params)Ldt(t,e,a,s,()=>[n.params[0].range[0],n.params[n.params.length-1].range[1]],l=>l)}function s8e(t,e,n,s){Ldt(t,e,n,s,()=>n.range,a=>a)}function Ldt(t,e,n,s,a,l){if(n.type==="TSTypeReference"&&n.typeName.type==="TSQualifiedName"&&n.typeName.left.type==="Identifier"&&n.typeName.left.name==="BATI"){let{right:p}=n.typeName,f=a();switch(p.name){case"Any":t.report({node:n,message:"bati/as-expression-any",*fix(d){yield d.removeRange(f)}});break;case"If":case"IfAsUnkown":if(n.typeArguments?.type==="TSTypeParameterInstantiation"&&n.typeArguments.params[0].type==="TSTypeLiteral"){let d=n.typeArguments.params[0].members;t.report({node:n,message:"bati/as-expression-if",*fix(g){let y,T=!1;for(let v of d){if(v.type!=="TSPropertySignature"||v.key.type!=="Literal"&&v.key.type!=="Identifier"||v.typeAnnotation?.type!=="TSTypeAnnotation")throw console.log(),new Error("Linter: Malformed BATI.If members type");let x="value"in v.key?v.key.value:v.key.name,A=e.text.slice(v.typeAnnotation.typeAnnotation.range[0],v.typeAnnotation.typeAnnotation.range[1]);if(x==="_"){y=A;continue}if(bq(x,s)){yield g.replaceTextRange(f,l(A,p)),T=!0;break}}T||(y?yield g.replaceTextRange(f,l(y,p)):yield g.removeRange(f))}})}else throw new Error("Linter: Malformed BATI.If type");break;default:throw new Error(`Linter: Unhandled BATI.${p.name} type`)}}}function Rdt(t){let e={rules:{ts:{meta:{fixable:"code"},create(s){let a=s.sourceCode;return{Program(l){UIr(s,a,l)},ImportDeclaration(l){aIe(s,l)},":expression"(l){tK(s,a,l,t)},":statement"(l){tK(s,a,l,t)},SpreadElement(l){tK(s,a,l,t)},ConditionalExpression(l){vq(s,a,l,t)},IfStatement(l){vq(s,a,l,t)},JSXAttribute(l){tK(s,a,l,t)},TSAsExpression(l){n8e(s,a,l,t)},TSTypeParameterInstantiation(l){i8e(s,a,l,t)},TSTypeReference(l){s8e(s,a,l,t)}}}}}},n=[{plugins:{batiTs:e},languageOptions:{parser:qIr},rules:{"batiTs/ts":"error"},files:["**/*.ts","**/*.js","**/*.tsx","**/*.jsx"]}];return t.BATI.has("solid")&&n.push({files:["**/*.{ts,tsx}"],...OIr,languageOptions:{parser:qIr}}),{plugin:e,config:n}}var NVi=Bf(tdt(),1),kIs=Bf(LR(),1),IVi=Bf(TLr(),1);function SLr(t,e){let n=e.getTokenBefore("startTag"in t?t.startTag:t,{includeComments:!0,filter:s=>s.type!=="HTMLWhitespace"});return n&&n.type==="HTMLComment"?[...SLr(n,e),n]:[]}function yht(t){let e={rules:{vue:{meta:{fixable:"code"},create(s){let a=s.sourceCode,l=a.parserServices.getTemplateBodyTokenStore();return a.parserServices.defineTemplateBodyVisitor({ConditionalExpression(p){vq(s,a,p,t)},IfStatement(p){vq(s,a,p,t)},VElement(p){let f=SLr(p,l);if(f.length>0){let d=r8e(f[0]);if(d===null)return;let g=bq(d,t);s.report({node:p,message:"bati/vue-velement",*fix(y){g?yield y.removeRange([f[0].range[0],f[0].range[1]]):(yield y.remove(p),yield y.removeRange([f[0].range[0],f[f.length-1].range[1]]))}})}}},{ImportDeclaration(p){aIe(s,p)},":statement"(p){tK(s,a,p,t)},ConditionalExpression(p){vq(s,a,p,t)},IfStatement(p){vq(s,a,p,t)},TSAsExpression(p){n8e(s,a,p,t)},TSTypeParameterInstantiation(p){i8e(s,a,p,t)},TSTypeReference(p){s8e(s,a,p,t)}})}}}};return{plugin:e,config:[{plugins:{batiVue:e},languageOptions:{parser:IVi,parserOptions:{parser:NVi,ecmaVersion:2022,sourceType:"module"}},rules:{"batiVue/vue":"error"},files:["**/*.vue"]}]}}var yUr=Bf(fUr(),1),bUr=Bf(gUr(),1);var nrs=(t,e)=>(n,s)=>{let{parent:a}=n.node??s.sourceCode.getNodeByRangeIndex(s.sourceCode.getIndexFromLoc(n.loc.start));return a?/^Import(|Default|Namespace)Specifier$/.test(a.type)==t&&Object.assign(n,e?.(a,s)):n},e1t={filter:t=>t.value===","},irs={includeComments:!0},srs=nrs(!0,(t,e)=>({fix(n){let s=t.parent;if(!s)return null;let a=Bre(e);if(s.specifiers.length===1){let l=e.sourceCode.getTokenAfter(s,irs),p=l?l.loc.start.line-s.loc.start.line:0,f=l?l.range[0]:s.range[1],d=Math.max(0,p-1);return a?.deleteImport(s.source.value),[n.remove(s),n.replaceTextRange([s.range[1],f],`
968
+ `)!==-1&&e[0].value.replace(/(?!\xA0)\s/g,"")===""}var kNr,CIr,AIr,QFi=x0({"src/rules/self-closing-comp.ts"(){"use strict";QS(),TN(),kNr=EIr.ESLintUtils.RuleCreator.withoutDocs,CIr=/^(?:area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/,AIr=kNr({meta:{type:"layout",docs:{description:"Disallow extra closing tags for components without children.",url:"https://github.com/solidjs-community/eslint-plugin-solid/blob/main/docs/self-closing-comp.md"},fixable:"code",schema:[{type:"object",properties:{component:{type:"string",description:"which Solid components should be self-closing when possible",enum:["all","none"],default:"all"},html:{type:"string",description:"which native elements should be self-closing when possible",enum:["all","void","none"],default:"all"}},additionalProperties:!1}],messages:{selfClose:"Empty components are self-closing.",dontSelfClose:"This element should not be self-closing."}},defaultOptions:[],create(t){function e(n){if(KFi(n))return(t.options[0]?.component??"all")==="all";if(n.name.type==="JSXIdentifier"&&vN(n.name.name))switch(t.options[0]?.html??"all"){case"all":return!0;case"void":return GFi(n.name.name);case"none":return!1}return!0}return{JSXOpeningElement(n){if(HFi(n)||XFi(n)){let a=e(n);a&&!n.selfClosing?t.report({node:n,messageId:"selfClose",fix(l){let p=n.range[1]-1,f=n.parent.closingElement.range[1],d=[p,f];return l.replaceTextRange(d," />")}}):!a&&n.selfClosing&&t.report({node:n,messageId:"dontSelfClose",fix(l){let p=DA(t),f=p.getText(n.name),d=n.range[1],g=p.getLastTokens(n,{count:3}),T=[p.isSpaceBetween?.(g[0],g[1])?d-3:d-2,d];return l.replaceTextRange(T,`></${f}>`)}})}}}}})}}),NNr,INr,FNr,ONr,DIr,ZFi=x0({"src/rules/style-prop.ts"(){"use strict";QS(),TN(),NNr=t8e.ESLintUtils.RuleCreator.withoutDocs,{getPropertyName:INr,getStaticValue:FNr}=t8e.ASTUtils,ONr=/\b(?:width|height|margin|padding|border-width|font-size)\b/i,DIr=NNr({meta:{type:"problem",docs:{description:"Require CSS properties in the `style` prop to be valid and kebab-cased (ex. 'font-size'), not camel-cased (ex. 'fontSize') like in React, and that property values with dimensions are strings, not numbers with implicit 'px' units.",url:"https://github.com/solidjs-community/eslint-plugin-solid/blob/main/docs/style-prop.md"},fixable:"code",schema:[{type:"object",properties:{styleProps:{description:"an array of prop names to treat as a CSS style object",default:["style"],type:"array",items:{type:"string"},minItems:1,uniqueItems:!0},allowString:{description:"if allowString is set to true, this rule will not convert a style string literal into a style object (not recommended for performance)",type:"boolean",default:!1}},additionalProperties:!1}],messages:{kebabStyleProp:"Use {{ kebabName }} instead of {{ name }}.",invalidStyleProp:"{{ name }} is not a valid CSS property.",numericStyleValue:'This CSS property value should be a string with a unit; Solid does not automatically append a "px" unit.',stringStyle:"Use an object for the style prop instead of a string."}},defaultOptions:[],create(t){let e=new Set(wIr.all),n=!!t.options[0]?.allowString,s=t.options[0]?.styleProps||["style"];return{JSXAttribute(a){if(s.indexOf(Ene(a))===-1)return;let l=a.value?.type==="JSXExpressionContainer"?a.value.expression:a.value;if(l)if(l.type==="Literal"&&typeof l.value=="string"&&!n){let p;try{p=qkr(l.value)??void 0}catch{}t.report({node:l,messageId:"stringStyle",fix:p&&(f=>f.replaceText(a.value,`{${JSON.stringify(p)}}`))})}else l.type==="TemplateLiteral"&&!n?t.report({node:l,messageId:"stringStyle"}):l.type==="ObjectExpression"&&l.properties.filter(f=>f.type==="Property").forEach(f=>{let d=INr(f,Phe(t,f));if(d&&!d.startsWith("--")&&!e.has(d)){let g=(0,PIr.default)(d);e.has(g)?t.report({node:f.key,messageId:"kebabStyleProp",data:{name:d,kebabName:g},fix:y=>y.replaceText(f.key,`"${g}"`)}):t.report({node:f.key,messageId:"invalidStyleProp",data:{name:d}})}else if(!d||!d.startsWith("--")&&ONr.test(d)){let g=FNr(f.value)?.value;typeof g=="number"&&g!==0&&t.report({node:f.value,messageId:"numericStyleValue"})}});else return}}}})}}),LNr,NIr,e8i=x0({"src/rules/no-array-handlers.ts"(){"use strict";QS(),LNr=kIr.ESLintUtils.RuleCreator.withoutDocs,NIr=LNr({meta:{type:"problem",docs:{description:"Disallow usage of type-unsafe event handlers.",url:"https://github.com/solidjs-community/eslint-plugin-solid/blob/main/docs/no-array-handlers.md"},schema:[],messages:{noArrayHandlers:"Passing an array as an event handler is potentially type-unsafe."}},defaultOptions:[],create(t){return{JSXAttribute(e){let n=e.parent;if(n.name.type!=="JSXIdentifier"||!vN(n.name.name))return;let s=e.name.type==="JSXNamespacedName"&&e.name.namespace.name==="on",a=e.name.type==="JSXIdentifier"&&/^on[a-zA-Z]/.test(e.name.name);(s||a)&&e.value?.type==="JSXExpressionContainer"&&whe(e.value.expression,t).type==="ArrayExpression"&&t.report({node:e,messageId:"noArrayHandlers"})}}}})}}),t8i=qNr({"package.json"(t,e){e.exports={name:"eslint-plugin-solid",version:"0.14.3",description:"Solid-specific linting rules for ESLint.",keywords:["eslint","eslintplugin","solid","solidjs","reactivity"],repository:"https://github.com/solidjs-community/eslint-plugin-solid",license:"MIT",author:"Josh Wilson <joshwilsonvu@gmail.com>",exports:{".":{types:{import:"./dist/index.d.mts",require:"./dist/index.d.ts"},import:"./dist/index.mjs",require:"./dist/index.js"},"./configs/recommended":{types:{import:"./dist/configs/recommended.d.mts",require:"./dist/configs/recommended.d.ts"},import:"./dist/configs/recommended.mjs",require:"./dist/configs/recommended.js"},"./configs/typescript":{types:{import:"./dist/configs/typescript.d.mts",require:"./dist/configs/typescript.d.ts"},import:"./dist/configs/typescript.mjs",require:"./dist/configs/typescript.js"},"./package.json":"./package.json"},main:"dist/index.js",types:"dist/index.d.ts",files:["src","dist","README.md"],scripts:{build:"tsup",test:"vitest --run","test:all":"PARSER=all vitest --run","test:babel":"PARSER=babel vitest --run","test:ts":"PARSER=ts vitest --run","test:v6":"PARSER=v6 vitest --run","test:v7":"PARSER=v7 vitest --run","test:watch":"vitest","turbo:build":"tsup","turbo:docs":"PARSER=none tsx scripts/docs.ts","turbo:test":"vitest --run"},dependencies:{"@typescript-eslint/utils":"^7.13.1 || ^8.0.0",estraverse:"^5.3.0","is-html":"^2.0.0","kebab-case":"^1.0.2","known-css-properties":"^0.30.0","style-to-object":"^1.0.6"},devDependencies:{"@babel/core":"^7.24.4","@babel/eslint-parser":"^7.24.7","@microsoft/api-extractor":"^7.47.6","@types/eslint":"^8.56.10","@types/eslint-v6":"npm:@types/eslint@6","@types/eslint-v7":"npm:@types/eslint@7","@types/eslint-v8":"npm:@types/eslint@8","@types/eslint__js":"^8.42.3","@types/estraverse":"^5.1.7","@types/is-html":"^2.0.2","@typescript-eslint/eslint-plugin":"^8.0.0","@typescript-eslint/parser":"^8.0.0",eslint:"^9.5.0","eslint-v6":"npm:eslint@6","eslint-v7":"npm:eslint@7","eslint-v8":"npm:eslint@8","markdown-magic":"^3.3.0",prettier:"^2.8.8",tsup:"^8.2.4",tsx:"^4.17.0",vitest:"^1.5.2"},peerDependencies:{eslint:"^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0"},engines:{node:">=18.0.0"}}}}),RNr,MNr,BNr,jNr,IIr,r8i=x0({"src/plugin.ts"(){"use strict";NFi(),IFi(),FFi(),OFi(),LFi(),RFi(),MFi(),BFi(),jFi(),UFi(),qFi(),VFi(),JFi(),$Fi(),WFi(),YFi(),zFi(),QFi(),ZFi(),e8i(),{name:RNr,version:MNr}=t8i(),BNr={name:RNr,version:MNr},jNr={"components-return-once":GNr,"event-handlers":HNr,imports:QNr,"jsx-no-duplicate-props":eIr,"jsx-no-undef":nIr,"jsx-no-script-url":tIr,"jsx-uses-vars":sIr,"no-destructure":aIr,"no-innerhtml":cIr,"no-proxy-apis":uIr,"no-react-deps":fIr,"no-react-specific-props":dIr,"no-unknown-namespaces":hIr,"prefer-classlist":yIr,"prefer-for":bIr,"prefer-show":TIr,reactivity:xIr,"self-closing-comp":AIr,"style-prop":DIr,"no-array-handlers":NIr},IIr={meta:BNr,rules:jNr}}}),FIr=qNr({"src/configs/recommended.ts"(t,e){r8i();var n={plugins:{solid:IIr},languageOptions:{sourceType:"module",parserOptions:{ecmaFeatures:{jsx:!0}}},rules:{"solid/jsx-no-duplicate-props":2,"solid/jsx-no-undef":2,"solid/jsx-uses-vars":2,"solid/no-unknown-namespaces":2,"solid/no-innerhtml":2,"solid/jsx-no-script-url":2,"solid/components-return-once":1,"solid/no-destructure":2,"solid/prefer-for":2,"solid/reactivity":1,"solid/event-handlers":1,"solid/imports":1,"solid/style-prop":1,"solid/no-react-deps":1,"solid/no-react-specific-props":1,"solid/self-closing-comp":1,"solid/no-array-handlers":0,"solid/prefer-show":0,"solid/no-proxy-apis":0,"solid/prefer-classlist":0}};e.exports=n}});var OIr=FIr();function bq(t,e){let s=new Function(`{ return function(BATI, BATI_TEST){ return ${t} } };`).call(null).call(null,e.BATI,e.BATI_TEST);if(s!=="remove-comments-only"&&typeof s!="boolean")throw new Error("Condition evaluation failed");return s}function LIr(t){return!t.includes("BATI.has")&&!t.includes("BATI_TEST")?null:t.replace(/^# /,"").trim()}function RIr(t,e){if(!e.test.range)return null;let n=t.text.slice(e.test.range[0],e.test.range[1]);return LIr(n)}function r8e(t){return LIr(t.value)}function MIr(t){return t.value.includes(" BATI ")?t.value.replace(/^#/,"").replace(/#$/,"").replace(/\s+BATI\s+/,"").trim().split(","):null}function BIr(t){return[t.body[0].range[0],t.body[t.body.length-1].range[1]]}function jIr(t,e,n){return t.type==="ConditionalExpression"&&"parent"in t&&t.parent&&t.parent.type==="JSXExpressionContainer"&&(e.type==="JSXElement"||n==="null"||n==="undefined")?{range:t.parent.range,body:n==="null"||n==="undefined"?"":n}:{range:t.range,body:n}}function vq(t,e,n,s){let a=RIr(e,n);if(a===null)return;let l=bq(a,s);t.report({node:n,message:"bati/if-statement",*fix(p){if(l)if(n.consequent.type==="BlockStatement"){let f=e.text.slice(...BIr(n.consequent));yield p.replaceTextRange(n.range,f)}else{let f=e.text.slice(...n.consequent.range),d=jIr(n,n.consequent,f);yield p.replaceTextRange(d.range,d.body)}else if(n.alternate)if(n.alternate.type==="BlockStatement"){let f=e.text.slice(...BIr(n.alternate));yield p.replaceTextRange(n.range,f)}else{let f=e.text.slice(...n.alternate.range),d=jIr(n,n.alternate,f);yield p.replaceTextRange(d.range,d.body)}else yield p.remove(n)}})}function UIr(t,e,n){let s=e.getAllComments();if(s.length>0&&s[0].range?.[0]===0){let a=s[0],l=MIr(a);if(l===null||l.length===0)return;let p=Bre(t);for(let f of l)switch(f){case"include-if-imported":p?.addFlag(f);break;default:t.report({node:n,message:`Unknown BATI file flag ${f}`,loc:a.loc});return}t.report({node:n,message:"bati/global-comment",*fix(f){yield f.remove(a)}})}}function tK(t,e,n,s){let a=e.getCommentsBefore(n);if(a.length>0){let l=a[0];if(l.handled)return;l.handled=!0;let p=r8e(l);if(p===null)return;let f=bq(p,s),d,g;if(!(a.length>1&&f==="remove-comments-only")){let T=["Property"];for(["SpreadElement","Identifier"].includes(n.type)&&T.includes(n.parent?.type)&&(n=n.parent),d=n.range[0],g=n.range[1];e.text[g]?.match(/\s|,/)&&(g+=1,e.text[g-1]!==","););}t.report({node:n,message:"bati/statement-comments",*fix(T){if(!f||f==="remove-comments-only"){d!==void 0&&g!==void 0&&(yield T.removeRange([d,g]));for(let v of a)yield T.remove(v)}else yield T.remove(l)}})}}var SDs=Bf(LR(),1),xDs=Bf(xs(),1);function n8e(t,e,n,s){Ldt(t,e,n.typeAnnotation,s,()=>{let a=n.expression.range[1]+1,l=n.range[1];return[a,l]},(a,l)=>l.name==="IfAsUnkown"?` as unknown as ${a}`:` as ${a}`)}function i8e(t,e,n,s){for(let a of n.params)Ldt(t,e,a,s,()=>[n.params[0].range[0],n.params[n.params.length-1].range[1]],l=>l)}function s8e(t,e,n,s){Ldt(t,e,n,s,()=>n.range,a=>a)}function Ldt(t,e,n,s,a,l){if(n.type==="TSTypeReference"&&n.typeName.type==="TSQualifiedName"&&n.typeName.left.type==="Identifier"&&n.typeName.left.name==="BATI"){let{right:p}=n.typeName,f=a();switch(p.name){case"Any":t.report({node:n,message:"bati/as-expression-any",*fix(d){yield d.removeRange(f)}});break;case"If":case"IfAsUnkown":if(n.typeArguments?.type==="TSTypeParameterInstantiation"&&n.typeArguments.params[0].type==="TSTypeLiteral"){let d=n.typeArguments.params[0].members;t.report({node:n,message:"bati/as-expression-if",*fix(g){let y,T=!1;for(let v of d){if(v.type!=="TSPropertySignature"||v.key.type!=="Literal"&&v.key.type!=="Identifier"||v.typeAnnotation?.type!=="TSTypeAnnotation")throw console.log(),new Error("Linter: Malformed BATI.If members type");let x="value"in v.key?v.key.value:v.key.name,A=e.text.slice(v.typeAnnotation.typeAnnotation.range[0],v.typeAnnotation.typeAnnotation.range[1]);if(x==="_"){y=A;continue}if(bq(x,s)){yield g.replaceTextRange(f,l(A,p)),T=!0;break}}T||(y?yield g.replaceTextRange(f,l(y,p)):yield g.removeRange(f))}})}else throw new Error("Linter: Malformed BATI.If type");break;default:throw new Error(`Linter: Unhandled BATI.${p.name} type`)}}}function Rdt(t){let e={rules:{ts:{meta:{fixable:"code"},create(s){let a=s.sourceCode;return{Program(l){UIr(s,a,l)},ImportDeclaration(l){aIe(s,l)},":expression"(l){tK(s,a,l,t)},":statement"(l){tK(s,a,l,t)},SpreadElement(l){tK(s,a,l,t)},ConditionalExpression(l){vq(s,a,l,t)},IfStatement(l){vq(s,a,l,t)},JSXAttribute(l){tK(s,a,l,t)},TSAsExpression(l){n8e(s,a,l,t)},TSTypeParameterInstantiation(l){i8e(s,a,l,t)},TSTypeReference(l){s8e(s,a,l,t)}}}}}},n=[{plugins:{batiTs:e},languageOptions:{parser:qIr,parserOptions:{warnOnUnsupportedTypeScriptVersion:!1}},rules:{"batiTs/ts":"error"},files:["**/*.ts","**/*.js","**/*.tsx","**/*.jsx"]}];return t.BATI.has("solid")&&n.push({files:["**/*.{ts,tsx}"],...OIr,languageOptions:{parser:qIr}}),{plugin:e,config:n}}var NVi=Bf(tdt(),1),kIs=Bf(LR(),1),IVi=Bf(TLr(),1);function SLr(t,e){let n=e.getTokenBefore("startTag"in t?t.startTag:t,{includeComments:!0,filter:s=>s.type!=="HTMLWhitespace"});return n&&n.type==="HTMLComment"?[...SLr(n,e),n]:[]}function yht(t){let e={rules:{vue:{meta:{fixable:"code"},create(s){let a=s.sourceCode,l=a.parserServices.getTemplateBodyTokenStore();return a.parserServices.defineTemplateBodyVisitor({ConditionalExpression(p){vq(s,a,p,t)},IfStatement(p){vq(s,a,p,t)},VElement(p){let f=SLr(p,l);if(f.length>0){let d=r8e(f[0]);if(d===null)return;let g=bq(d,t);s.report({node:p,message:"bati/vue-velement",*fix(y){g?yield y.removeRange([f[0].range[0],f[0].range[1]]):(yield y.remove(p),yield y.removeRange([f[0].range[0],f[f.length-1].range[1]]))}})}}},{ImportDeclaration(p){aIe(s,p)},":statement"(p){tK(s,a,p,t)},ConditionalExpression(p){vq(s,a,p,t)},IfStatement(p){vq(s,a,p,t)},TSAsExpression(p){n8e(s,a,p,t)},TSTypeParameterInstantiation(p){i8e(s,a,p,t)},TSTypeReference(p){s8e(s,a,p,t)}})}}}};return{plugin:e,config:[{plugins:{batiVue:e},languageOptions:{parser:IVi,parserOptions:{parser:NVi,ecmaVersion:2022,sourceType:"module"}},rules:{"batiVue/vue":"error"},files:["**/*.vue"]}]}}var yUr=Bf(fUr(),1),bUr=Bf(gUr(),1);var nrs=(t,e)=>(n,s)=>{let{parent:a}=n.node??s.sourceCode.getNodeByRangeIndex(s.sourceCode.getIndexFromLoc(n.loc.start));return a?/^Import(|Default|Namespace)Specifier$/.test(a.type)==t&&Object.assign(n,e?.(a,s)):n},e1t={filter:t=>t.value===","},irs={includeComments:!0},srs=nrs(!0,(t,e)=>({fix(n){let s=t.parent;if(!s)return null;let a=Bre(e);if(s.specifiers.length===1){let l=e.sourceCode.getTokenAfter(s,irs),p=l?l.loc.start.line-s.loc.start.line:0,f=l?l.range[0]:s.range[1],d=Math.max(0,p-1);return a?.deleteImport(s.source.value),[n.remove(s),n.replaceTextRange([s.range[1],f],`
969
969
  `.repeat(d))]}if(t!==s.specifiers[s.specifiers.length-1]){let l=e.sourceCode.getTokenAfter(t,e1t),p=e.sourceCode.getTokenBefore(t);return[n.removeRange([p.range[1],t.range[0]]),n.remove(t),n.remove(l)]}if(s.specifiers.filter(l=>l.type==="ImportSpecifier").length===1){let l=e.sourceCode.getTokenBefore(t,e1t),p=e.sourceCode.getTokenAfter(t,{filter:f=>f.value==="}"});return n.removeRange([l.range[0],p.range[1]])}return n.removeRange([e.sourceCode.getTokenBefore(t,e1t).range[0],t.range[1]])}}));function t1t(){let t=yUr.default.rules["no-unused-vars"];t.meta.fixable="code";let e={rules:{"unused-imports":bUr.default.filterReports(t,srs)}};return{plugin:e,config:[{plugins:{"unused-imports":e},rules:{"unused-imports/unused-imports":"error"}}]}}function vUr(t,e,n){return aTr(t,[...Rdt(n).config,...yht(n).config,...t1t().config],e)}var TUr=new Function("return this")().Promise,a1t=!1;try{a1t=new Function("return (async function(){}).constructor")()}catch(t){if(!(t instanceof SyntaxError))throw t}function EUr(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Wge(t,e,n){for(var s in e)EUr(e,s)&&(e[s]!=null&&typeof e[s]=="object"&&(s==="storage"||s==="prefixes")&&!n?t[s]=Wge({},e[s]):t[s]=e[s]);return t}function ars(t,e,n,s){var a,l;return typeof e.autoTrim=="string"?a=l=e.autoTrim:Array.isArray(e.autoTrim)&&(a=e.autoTrim[1],l=e.autoTrim[0]),(n||n===!1)&&(a=n),(s||s===!1)&&(l=s),a==="slurp"&&l==="slurp"?t.trim():(a==="_"||a==="slurp"?String.prototype.trimLeft?t=t.trimLeft():t=t.replace(/^[\s\uFEFF\xA0]+/,""):(a==="-"||a==="nl")&&(t=t.replace(/^(?:\n|\r|\r\n)/,"")),l==="_"||l==="slurp"?String.prototype.trimRight?t=t.trimRight():t=t.replace(/[\s\uFEFF\xA0]+$/,""):(l==="-"||l==="nl")&&(t=t.replace(/(?:\n|\r|\r\n)$/,"")),t)}function ors(t){return/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(t)}var tLe=function(){function t(e){this.cache=e}return t.prototype.define=function(e,n){this.cache[e]=n},t.prototype.get=function(e){return this.cache[e]},t.prototype.remove=function(e){delete this.cache[e]},t.prototype.reset=function(){this.cache={}},t.prototype.load=function(e){Wge(this.cache,e,!0)},t}();function crs(t,e){Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e}function iS(t){var e=new Error(t);return crs(e,iS.prototype),e}iS.prototype=Object.create(Error.prototype,{name:{value:"Squirrelly Error",enumerable:!1}});function Wq(t,e,n){var s=e.slice(0,n).split(/\n/),a=s.length,l=s[a-1].length+1;throw t+=" at line "+a+" col "+l+`:
970
970
 
971
971
  `+e.split(/\n/)[a-1]+`
@@ -1090,7 +1090,7 @@ ${t}
1090
1090
 
1091
1091
  `));let a=s?s.replace(/^(.+)/gm,"# $1")+`
1092
1092
  `:"",l=`${e}=${Rus(n)}
1093
- `;return t+a+l}function Rus(t){let e="";switch(typeof t){case"string":t&&(e=JSON.stringify(t));break;case"boolean":case"number":e=String(t);break;case"undefined":e="";break;case"object":t!==null&&(e=JSON.stringify(t));break}return e}var rps=Bf(KWr(),1);import{randomBytes as u7s}from"node:crypto";var lTt={name:"@batijs/core",version:"0.0.278",description:"",type:"module",types:"./dist/index.d.ts",scripts:{"check-types":"tsc --noEmit",vue:"tsx src/parse/linters/vue.ts",test:"vitest run","test:ci":"vitest run",build:"tsup"},keywords:[],author:"Jo\xEBl Charles <joel.charles91@gmail.com>",repository:"https://github.com/vikejs/bati",license:"MIT",devDependencies:{"@batijs/features":"workspace:*","@types/eslint":"^9.6.1","@types/estree":"^1.0.5","@types/node":"^18.19.14","@types/which":"^3.0.4","@typescript-eslint/parser":"^8.5.0","@typescript-eslint/utils":"^8.5.0",colorette:"^2.0.20",esbuild:"^0.23.1",eslint:"^9.10.0","eslint-plugin-solid":"^0.14.3","eslint-rule-composer":"^0.3.0",espree:"^10.1.0",magicast:"^0.3.5",prettier:"^3.3.3",squirrelly:"^9.1.0",tsup:"^8.2.4",tsx:"^4.19.1",typescript:"^5.6.2","unplugin-purge-polyfills":"^0.0.5",vitest:"^2.1.1","vue-eslint-parser":"^9.4.3",which:"^4.0.0",yaml:"^2.5.1"},exports:{".":"./dist/index.js","./types":{types:"./global.d.ts"}},typesVersions:{"*":{types:["./global.d.ts"]}},files:["dist/"]};function ips(){if(process.env.npm_config_user_agent)return sps(process.env.npm_config_user_agent)}function sps(t){let e=t.split(" ")[0],n=e.lastIndexOf("/"),s=e.substring(0,n);return{name:s==="npminstall"?"cnpm":s,version:e.substring(n+1)}}function d7s(){switch(ips()?.name){case"pnpm":return"pnpm create bati";case"yarn":return"yarn dlx @batijs/cli";case"bun":return"bun create bati";default:return"npm create bati --"}}function m7s(){let t=lTt.version.split("."),e=t[0],n=t[1],s=t.slice(2).join(".");return{version:lTt.version,semver:[e,n,s]}}var export_which=rps.default;export{Pbt as Readme,QLs as addDependency,xus as addVitePlugin,t7s as appendToEnv,xLs as bgBlack,jLs as bgBlackBright,PLs as bgBlue,JLs as bgBlueBright,DLs as bgCyan,WLs as bgCyanBright,CLs as bgGreen,qLs as bgGreenBright,wLs as bgMagenta,$Ls as bgMagentaBright,ELs as bgRed,ULs as bgRedBright,kLs as bgWhite,YLs as bgWhiteBright,ALs as bgYellow,VLs as bgYellowBright,mLs as black,NLs as blackBright,yLs as blue,LLs as blueBright,lLs as bold,Lie as builders,Ous as createColors,vLs as cyan,MLs as cyanBright,mWr as deepMergeObject,cTt as dim,Rtt as formatCode,Qq as generateCode,d7s as getArgs,m7s as getVersion,SLs as gray,gLs as green,FLs as greenBright,_Ls as hidden,fLs as inverse,Nus as isColorSupported,uLs as italic,HOs as loadAsJson,XOs as loadAsMagicast,Abt as loadFile,GOs as loadReadme,QOs as loadRelativeFileAsMagicast,ZOs as loadYaml,bLs as magenta,RLs as magentaBright,C8s as markdown,ips as packageManager,MLe as parseModule,wVr as parseReadme,u7s as randomBytes,hLs as red,ILs as redBright,cLs as reset,ZLs as setScripts,dLs as strikethrough,Ers as transformAndFormat,pLs as underline,export_which as which,TLs as white,BLs as whiteBright,xWr as withIcon,SWr as yellow,OLs as yellowBright};
1093
+ `;return t+a+l}function Rus(t){let e="";switch(typeof t){case"string":t&&(e=JSON.stringify(t));break;case"boolean":case"number":e=String(t);break;case"undefined":e="";break;case"object":t!==null&&(e=JSON.stringify(t));break}return e}var rps=Bf(KWr(),1);import{randomBytes as u7s}from"node:crypto";var lTt={name:"@batijs/core",version:"0.0.279",description:"",type:"module",types:"./dist/index.d.ts",scripts:{"check-types":"tsc --noEmit",vue:"tsx src/parse/linters/vue.ts",test:"vitest run","test:ci":"vitest run",build:"tsup"},keywords:[],author:"Jo\xEBl Charles <joel.charles91@gmail.com>",repository:"https://github.com/vikejs/bati",license:"MIT",devDependencies:{"@batijs/features":"workspace:*","@types/eslint":"^9.6.1","@types/estree":"^1.0.5","@types/node":"^18.19.14","@types/which":"^3.0.4","@typescript-eslint/parser":"^8.5.0","@typescript-eslint/utils":"^8.5.0",colorette:"^2.0.20",esbuild:"^0.23.1",eslint:"^9.10.0","eslint-plugin-solid":"^0.14.3","eslint-rule-composer":"^0.3.0",espree:"^10.1.0",magicast:"^0.3.5",prettier:"^3.3.3",squirrelly:"^9.1.0",tsup:"^8.2.4",tsx:"^4.19.1",typescript:"^5.6.2","unplugin-purge-polyfills":"^0.0.5",vitest:"^2.1.1","vue-eslint-parser":"^9.4.3",which:"^4.0.0",yaml:"^2.5.1"},exports:{".":"./dist/index.js","./types":{types:"./global.d.ts"}},typesVersions:{"*":{types:["./global.d.ts"]}},files:["dist/"]};function ips(){if(process.env.npm_config_user_agent)return sps(process.env.npm_config_user_agent)}function sps(t){let e=t.split(" ")[0],n=e.lastIndexOf("/"),s=e.substring(0,n);return{name:s==="npminstall"?"cnpm":s,version:e.substring(n+1)}}function d7s(){switch(ips()?.name){case"pnpm":return"pnpm create bati";case"yarn":return"yarn dlx @batijs/cli";case"bun":return"bun create bati";default:return"npm create bati --"}}function m7s(){let t=lTt.version.split("."),e=t[0],n=t[1],s=t.slice(2).join(".");return{version:lTt.version,semver:[e,n,s]}}var export_which=rps.default;export{Pbt as Readme,QLs as addDependency,xus as addVitePlugin,t7s as appendToEnv,xLs as bgBlack,jLs as bgBlackBright,PLs as bgBlue,JLs as bgBlueBright,DLs as bgCyan,WLs as bgCyanBright,CLs as bgGreen,qLs as bgGreenBright,wLs as bgMagenta,$Ls as bgMagentaBright,ELs as bgRed,ULs as bgRedBright,kLs as bgWhite,YLs as bgWhiteBright,ALs as bgYellow,VLs as bgYellowBright,mLs as black,NLs as blackBright,yLs as blue,LLs as blueBright,lLs as bold,Lie as builders,Ous as createColors,vLs as cyan,MLs as cyanBright,mWr as deepMergeObject,cTt as dim,Rtt as formatCode,Qq as generateCode,d7s as getArgs,m7s as getVersion,SLs as gray,gLs as green,FLs as greenBright,_Ls as hidden,fLs as inverse,Nus as isColorSupported,uLs as italic,HOs as loadAsJson,XOs as loadAsMagicast,Abt as loadFile,GOs as loadReadme,QOs as loadRelativeFileAsMagicast,ZOs as loadYaml,bLs as magenta,RLs as magentaBright,C8s as markdown,ips as packageManager,MLe as parseModule,wVr as parseReadme,u7s as randomBytes,hLs as red,ILs as redBright,cLs as reset,ZLs as setScripts,dLs as strikethrough,Ers as transformAndFormat,pLs as underline,export_which as which,TLs as white,BLs as whiteBright,xWr as withIcon,SWr as yellow,OLs as yellowBright};
1094
1094
  /*! Bundled license information:
1095
1095
 
1096
1096
  uri-js/dist/es5/uri.all.js:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@batijs/core",
3
- "version": "0.0.278",
3
+ "version": "0.0.279",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",
@@ -32,7 +32,7 @@
32
32
  "vue-eslint-parser": "^9.4.3",
33
33
  "which": "^4.0.0",
34
34
  "yaml": "^2.5.1",
35
- "@batijs/features": "0.0.278"
35
+ "@batijs/features": "0.0.279"
36
36
  },
37
37
  "exports": {
38
38
  ".": "./dist/index.js",