eslint-plugin-qwik 1.3.3 → 1.3.4

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/index.js +3 -3
  2. package/package.json +5 -5
package/index.js CHANGED
@@ -228,8 +228,8 @@ export default component$((props) => {
228
228
  )}>Hello world</div>;
229
229
  });`.trim();var fl={meta:{type:"problem",docs:{description:"Detect unused server$() functions.",recommended:!0,url:"https://qwik.builder.io/docs/advanced/eslint/#unused-server"},messages:{unusedServer:`Unused server$(). Seems like you are declaring a new server$ function, but you are never calling it. You might want to do:
230
230
 
231
- {{ suggestion }}`}},create(r){return{CallExpression(e){if(e.callee.type!=="Identifier")return;if(e.callee.name==="server$"){let n=!1;if((e.parent.type==="ExpressionStatement"||e.parent.type==="AwaitExpression"&&e.parent.parent.type==="ExpressionStatement")&&(n=!0),n){let o=`const serverFn = server$(...);
232
- await serverFn(...);`;r.report({node:e.callee,messageId:"unusedServer",data:{suggestion:o}})}}}}}},jx=`
231
+ {{ suggestion }}`}},create(r){return{CallExpression(e){if(e.callee.type!=="Identifier")return;if(e.callee.name==="server$"){let n=!1;(e.parent.type==="ExpressionStatement"||e.parent.type==="AwaitExpression"&&e.parent.parent.type==="ExpressionStatement")&&(n=!0),n&&r.report({node:e.callee,messageId:"unusedServer",data:{suggestion:`const serverFn = server$(...);
232
+ await serverFn(...);`}})}}}}},jx=`
233
233
  import { component$ } from '@builder.io/qwik';
234
234
  import { server$ } from '@builder.io/qwik-city';
235
235
 
@@ -295,7 +295,7 @@ ${bl(t.symbol,r.sourceCode.text)}
295
295
  Did you mean to wrap it in \`$()\`?
296
296
 
297
297
  ${d}
298
- `}return{type:t,typeStr:e.typeToString(t),reason:l}}if(t.isUnion()){for(let g of t.types){let l=_e(r,e,g,n,o,i+1,a);if(l)return l}return}if((t.flags&N.default.TypeFlags.Object)!==0){let g=xv(t,e);if(g)return _e(r,e,g,n,o,i+1,a);let l=Sv(t,e);if(l){for(let h of l){let S=_e(r,e,h,n,o,i+1,a);if(S)return S}return}let d=t.symbol.name;if(t.getProperty("nextElementSibling")||t.getProperty("activeElement")||d in Ev)return;if(t.isClass())return{type:t,typeStr:e.typeToString(t),reason:`is an instance of the "${t.symbol.name}" class, which is not serializable. Use a simple object literal instead`};let x=t.getProperty("prototype");if(x){let h=e.getTypeOfSymbolAtLocation(x,n);if(h.isClass())return{type:h,typeStr:e.typeToString(h),reason:"is a class constructor, which is not serializable"}}if(!d.startsWith("__")&&t.symbol.valueDeclaration)return{type:t,typeStr:e.typeToString(t),reason:`is an instance of the "${t.symbol.name}" class, which is not serializable`};for(let h of t.getProperties()){let S=bv(r,e,h,n,o,i+1,a);if(S){let O=S.location;return S.location=`${h.name}${O?`.${O}`:""}`,S}}}}function bv(r,e,t,n,o,i,a){let u=e.getTypeOfSymbolAtLocation(t,n);return _e(r,e,u,n,o,i,a)}function xv(r,e){return e.getElementTypeOfArrayType(r)}function Sv(r,e){return e.isTupleType(r)?e.getTypeArguments(r):void 0}function hl(r){return!!(r.flags&N.default.TypeFlags.Any)||!!r.getProperty("__brand__QRL__")}function bl(r,e){if(r.declarations&&r.declarations.length>0){let t=r.declarations[0],n=e.slice(t.pos,t.end).replace(/^\s*$/gm,"");return xn(n,2)}return""}var Ev={Promise:!0,URL:!0,RegExp:!0,Date:!0,FormData:!0,URLSearchParams:!0,Error:!0,Set:!0,Map:!0},Yx=`
298
+ `}return{type:t,typeStr:e.typeToString(t),reason:l}}if(t.isUnion()){for(let g of t.types){let l=_e(r,e,g,n,o,i+1,a);if(l)return l}return}if((t.flags&N.default.TypeFlags.Object)!==0){let g=xv(t,e);if(g)return _e(r,e,g,n,o,i+1,a);let l=Sv(t,e);if(l){for(let h of l){let S=_e(r,e,h,n,o,i+1,a);if(S)return S}return}let d=t.symbol.name;if(t.getProperty("nextElementSibling")||t.getProperty("activeElement")||d in Ev)return;if(t.isClass())return{type:t,typeStr:e.typeToString(t),reason:`is an instance of the "${t.symbol.name}" class, which is not serializable. Use a simple object literal instead`};let x=t.getProperty("prototype");if(x){let h=e.getTypeOfSymbolAtLocation(x,n);if(h.isClass())return{type:h,typeStr:e.typeToString(h),reason:"is a class constructor, which is not serializable"}}if(!d.startsWith("__")&&t.symbol.valueDeclaration)return{type:t,typeStr:e.typeToString(t),reason:`is an instance of the "${t.symbol.name}" class, which is not serializable`};for(let h of t.getProperties()){let S=bv(r,e,h,n,o,i+1,a);if(S){let O=S.location;return S.location=`${h.name}${O?`.${O}`:""}`,S}}}}function bv(r,e,t,n,o,i,a){let u=e.getTypeOfSymbolAtLocation(t,n);return _e(r,e,u,n,o,i,a)}function xv(r,e){return e.getElementTypeOfArrayType(r)}function Sv(r,e){return e.isTupleType(r)?e.getTypeArguments(r):void 0}function hl(r){return!!(r.flags&N.default.TypeFlags.Any)||!!r.getNonNullableType().getProperty("__brand__QRL__")}function bl(r,e){if(r.declarations&&r.declarations.length>0){let t=r.declarations[0],n=e.slice(t.pos,t.end).replace(/^\s*$/gm,"");return xn(n,2)}return""}var Ev={Promise:!0,URL:!0,RegExp:!0,Date:!0,FormData:!0,URLSearchParams:!0,Error:!0,Set:!0,Map:!0},Yx=`
299
299
  import { component$, useTask$, $ } from '@builder.io/qwik';
300
300
 
301
301
  export const HelloWorld = component$(() => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "eslint-plugin-qwik",
3
3
  "description": "An Open-Source sub-framework designed with a focus on server-side-rendering, lazy-loading, and styling/animation.",
4
- "version": "1.3.3",
4
+ "version": "1.3.4",
5
5
  "author": "Builder Team",
6
6
  "bugs": "https://github.com/BuilderIO/qwik/issues",
7
7
  "dependencies": {
@@ -9,10 +9,10 @@
9
9
  },
10
10
  "devDependencies": {
11
11
  "@builder.io/qwik": "workspace:*",
12
- "@types/eslint": "^8.44.8",
12
+ "@types/eslint": "^8.56.1",
13
13
  "@types/estree": "^1.0.2",
14
- "@typescript-eslint/rule-tester": "^6.13.2",
15
- "@typescript-eslint/utils": "^6.13.2",
14
+ "@typescript-eslint/rule-tester": "^6.18.1",
15
+ "@typescript-eslint/utils": "^6.18.1",
16
16
  "redent": "^4.0.0"
17
17
  },
18
18
  "engines": {
@@ -27,7 +27,7 @@
27
27
  "license": "MIT",
28
28
  "main": "index.js",
29
29
  "peerDependencies": {
30
- "eslint": "^8.55.0"
30
+ "eslint": "^8.56.0"
31
31
  },
32
32
  "repository": {
33
33
  "type": "git",