@pandacss/eslint-plugin 0.1.11 → 0.1.13

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.13";
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,13 +8459,20 @@ 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;
8467
+ if (isArrayExpression(node.value.expression)) {
8468
+ return checkElements(node.value.expression, context);
8469
+ }
8463
8470
  context.report({
8464
8471
  node: node.value,
8465
8472
  messageId: "dynamic"
8466
8473
  });
8467
8474
  },
8475
+ // Dynamic properties
8468
8476
  "Property[computed=true]"(node) {
8469
8477
  if (!isInPandaFunction(node, context))
8470
8478
  return;
@@ -8482,8 +8490,14 @@ var rule4 = createRule({
8482
8490
  return;
8483
8491
  if (isObjectExpression(node.value))
8484
8492
  return;
8493
+ if (isArrayExpression(node.value)) {
8494
+ return checkElements(node.value, context);
8495
+ }
8485
8496
  if (!isPandaAttribute(node, context))
8486
8497
  return;
8498
+ if (isArrayExpression(node.value)) {
8499
+ return checkElements(node.value, context);
8500
+ }
8487
8501
  context.report({
8488
8502
  node: node.value,
8489
8503
  messageId: "dynamic"
@@ -8492,6 +8506,20 @@ var rule4 = createRule({
8492
8506
  };
8493
8507
  }
8494
8508
  });
8509
+ function checkElements(array, context) {
8510
+ array.elements.forEach((node) => {
8511
+ if (!node)
8512
+ return;
8513
+ if (isLiteral(node))
8514
+ return;
8515
+ if (isTemplateLiteral(node) && node.expressions.length === 0)
8516
+ return;
8517
+ context.report({
8518
+ node,
8519
+ messageId: "dynamic"
8520
+ });
8521
+ });
8522
+ }
8495
8523
  var no_dynamic_styling_default = rule4;
8496
8524
 
8497
8525
  // 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.13";
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,13 +8485,20 @@ 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;
8493
+ if (isArrayExpression(node.value.expression)) {
8494
+ return checkElements(node.value.expression, context);
8495
+ }
8475
8496
  context.report({
8476
8497
  node: node.value,
8477
8498
  messageId: "dynamic"
8478
8499
  });
8479
8500
  },
8501
+ // Dynamic properties
8480
8502
  "Property[computed=true]"(node) {
8481
8503
  if (!isInPandaFunction(node, context))
8482
8504
  return;
@@ -8494,8 +8516,14 @@ var init_no_dynamic_styling = __esm({
8494
8516
  return;
8495
8517
  if (isObjectExpression(node.value))
8496
8518
  return;
8519
+ if (isArrayExpression(node.value)) {
8520
+ return checkElements(node.value, context);
8521
+ }
8497
8522
  if (!isPandaAttribute(node, context))
8498
8523
  return;
8524
+ if (isArrayExpression(node.value)) {
8525
+ return checkElements(node.value, context);
8526
+ }
8499
8527
  context.report({
8500
8528
  node: node.value,
8501
8529
  messageId: "dynamic"
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.13",
4
4
  "description": "Eslint plugin for Panda CSS",
5
5
  "author": "Abraham Aremu <anubra266@gmail.com>",
6
6
  "main": "dist/index.js",