@pandacss/eslint-plugin 0.1.11 → 0.1.12

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/dist/index.js CHANGED
@@ -7957,7 +7957,7 @@ init_cjs_shims();
7957
7957
 
7958
7958
  // package.json
7959
7959
  var name = "@pandacss/eslint-plugin";
7960
- var version = "0.1.11";
7960
+ var version = "0.1.12";
7961
7961
 
7962
7962
  // src/configs/all.ts
7963
7963
  init_cjs_shims();
@@ -7999,6 +7999,7 @@ var import_utils2 = require("@typescript-eslint/utils");
7999
7999
  var isIdentifier = (0, import_ast_utils.isNodeOfType)(import_utils2.AST_NODE_TYPES.Identifier);
8000
8000
  var isLiteral = (0, import_ast_utils.isNodeOfType)(import_utils2.AST_NODE_TYPES.Literal);
8001
8001
  var isTemplateLiteral = (0, import_ast_utils.isNodeOfType)(import_utils2.AST_NODE_TYPES.TemplateLiteral);
8002
+ var isArrayExpression = (0, import_ast_utils.isNodeOfType)(import_utils2.AST_NODE_TYPES.ArrayExpression);
8002
8003
  var isObjectExpression = (0, import_ast_utils.isNodeOfType)(import_utils2.AST_NODE_TYPES.ObjectExpression);
8003
8004
  var isMemberExpression = (0, import_ast_utils.isNodeOfType)(import_utils2.AST_NODE_TYPES.MemberExpression);
8004
8005
  var isVariableDeclarator = (0, import_ast_utils.isNodeOfType)(import_utils2.AST_NODE_TYPES.VariableDeclarator);
@@ -8458,6 +8459,9 @@ var rule4 = createRule({
8458
8459
  return;
8459
8460
  if (isObjectExpression(node.value.expression))
8460
8461
  return;
8462
+ if (isArrayExpression(node.value.expression)) {
8463
+ return checkElements(node.value.expression, context);
8464
+ }
8461
8465
  if (!isPandaProp(node, context))
8462
8466
  return;
8463
8467
  context.report({
@@ -8465,6 +8469,7 @@ var rule4 = createRule({
8465
8469
  messageId: "dynamic"
8466
8470
  });
8467
8471
  },
8472
+ // Dynamic properties
8468
8473
  "Property[computed=true]"(node) {
8469
8474
  if (!isInPandaFunction(node, context))
8470
8475
  return;
@@ -8482,6 +8487,9 @@ var rule4 = createRule({
8482
8487
  return;
8483
8488
  if (isObjectExpression(node.value))
8484
8489
  return;
8490
+ if (isArrayExpression(node.value)) {
8491
+ return checkElements(node.value, context);
8492
+ }
8485
8493
  if (!isPandaAttribute(node, context))
8486
8494
  return;
8487
8495
  context.report({
@@ -8492,6 +8500,20 @@ var rule4 = createRule({
8492
8500
  };
8493
8501
  }
8494
8502
  });
8503
+ function checkElements(array, context) {
8504
+ array.elements.forEach((node) => {
8505
+ if (!node)
8506
+ return;
8507
+ if (isLiteral(node))
8508
+ return;
8509
+ if (isTemplateLiteral(node) && node.expressions.length === 0)
8510
+ return;
8511
+ context.report({
8512
+ node,
8513
+ messageId: "dynamic"
8514
+ });
8515
+ });
8516
+ }
8495
8517
  var no_dynamic_styling_default = rule4;
8496
8518
 
8497
8519
  // src/rules/no-escape-hatch.ts
package/dist/index.mjs CHANGED
@@ -10,7 +10,7 @@ var name, version;
10
10
  var init_package = __esm({
11
11
  "package.json"() {
12
12
  name = "@pandacss/eslint-plugin";
13
- version = "0.1.11";
13
+ version = "0.1.12";
14
14
  }
15
15
  });
16
16
 
@@ -7957,7 +7957,7 @@ var require_dist3 = __commonJS({
7957
7957
  // src/utils/nodes.ts
7958
7958
  import { isNodeOfType } from "@typescript-eslint/utils/ast-utils";
7959
7959
  import { AST_NODE_TYPES } from "@typescript-eslint/utils";
7960
- var isIdentifier, isLiteral, isTemplateLiteral, isObjectExpression, isMemberExpression, isVariableDeclarator, isVariableDeclaration, isJSXMemberExpression, isJSXOpeningElement, isJSXExpressionContainer, isJSXAttribute, isJSXIdentifier, isCallExpression, isImportDeclaration, isImportSpecifier, isProperty;
7960
+ var isIdentifier, isLiteral, isTemplateLiteral, isArrayExpression, isObjectExpression, isMemberExpression, isVariableDeclarator, isVariableDeclaration, isJSXMemberExpression, isJSXOpeningElement, isJSXExpressionContainer, isJSXAttribute, isJSXIdentifier, isCallExpression, isImportDeclaration, isImportSpecifier, isProperty;
7961
7961
  var init_nodes = __esm({
7962
7962
  "src/utils/nodes.ts"() {
7963
7963
  "use strict";
@@ -7965,6 +7965,7 @@ var init_nodes = __esm({
7965
7965
  isIdentifier = isNodeOfType(AST_NODE_TYPES.Identifier);
7966
7966
  isLiteral = isNodeOfType(AST_NODE_TYPES.Literal);
7967
7967
  isTemplateLiteral = isNodeOfType(AST_NODE_TYPES.TemplateLiteral);
7968
+ isArrayExpression = isNodeOfType(AST_NODE_TYPES.ArrayExpression);
7968
7969
  isObjectExpression = isNodeOfType(AST_NODE_TYPES.ObjectExpression);
7969
7970
  isMemberExpression = isNodeOfType(AST_NODE_TYPES.MemberExpression);
7970
7971
  isVariableDeclarator = isNodeOfType(AST_NODE_TYPES.VariableDeclarator);
@@ -8433,6 +8434,20 @@ var init_no_debug = __esm({
8433
8434
  });
8434
8435
 
8435
8436
  // src/rules/no-dynamic-styling.ts
8437
+ function checkElements(array, context) {
8438
+ array.elements.forEach((node) => {
8439
+ if (!node)
8440
+ return;
8441
+ if (isLiteral(node))
8442
+ return;
8443
+ if (isTemplateLiteral(node) && node.expressions.length === 0)
8444
+ return;
8445
+ context.report({
8446
+ node,
8447
+ messageId: "dynamic"
8448
+ });
8449
+ });
8450
+ }
8436
8451
  var RULE_NAME4, rule4, no_dynamic_styling_default;
8437
8452
  var init_no_dynamic_styling = __esm({
8438
8453
  "src/rules/no-dynamic-styling.ts"() {
@@ -8470,6 +8485,9 @@ var init_no_dynamic_styling = __esm({
8470
8485
  return;
8471
8486
  if (isObjectExpression(node.value.expression))
8472
8487
  return;
8488
+ if (isArrayExpression(node.value.expression)) {
8489
+ return checkElements(node.value.expression, context);
8490
+ }
8473
8491
  if (!isPandaProp(node, context))
8474
8492
  return;
8475
8493
  context.report({
@@ -8477,6 +8495,7 @@ var init_no_dynamic_styling = __esm({
8477
8495
  messageId: "dynamic"
8478
8496
  });
8479
8497
  },
8498
+ // Dynamic properties
8480
8499
  "Property[computed=true]"(node) {
8481
8500
  if (!isInPandaFunction(node, context))
8482
8501
  return;
@@ -8494,6 +8513,9 @@ var init_no_dynamic_styling = __esm({
8494
8513
  return;
8495
8514
  if (isObjectExpression(node.value))
8496
8515
  return;
8516
+ if (isArrayExpression(node.value)) {
8517
+ return checkElements(node.value, context);
8518
+ }
8497
8519
  if (!isPandaAttribute(node, context))
8498
8520
  return;
8499
8521
  context.report({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pandacss/eslint-plugin",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
4
4
  "description": "Eslint plugin for Panda CSS",
5
5
  "author": "Abraham Aremu <anubra266@gmail.com>",
6
6
  "main": "dist/index.js",