@pandacss/eslint-plugin 0.0.4 → 0.0.5

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.
@@ -27,9 +27,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
27
27
  mod
28
28
  ));
29
29
 
30
- // ../node_modules/.pnpm/tsup@8.0.1_typescript@5.3.3/node_modules/tsup/assets/esm_shims.js
30
+ // ../node_modules/.pnpm/tsup@8.0.1_postcss@8.4.33_typescript@5.3.3/node_modules/tsup/assets/esm_shims.js
31
31
  var init_esm_shims = __esm({
32
- "../node_modules/.pnpm/tsup@8.0.1_typescript@5.3.3/node_modules/tsup/assets/esm_shims.js"() {
32
+ "../node_modules/.pnpm/tsup@8.0.1_postcss@8.4.33_typescript@5.3.3/node_modules/tsup/assets/esm_shims.js"() {
33
33
  "use strict";
34
34
  }
35
35
  });
package/dist/index.js CHANGED
@@ -28,10 +28,10 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
28
28
  mod
29
29
  ));
30
30
 
31
- // ../node_modules/.pnpm/tsup@8.0.1_typescript@5.3.3/node_modules/tsup/assets/cjs_shims.js
31
+ // ../node_modules/.pnpm/tsup@8.0.1_postcss@8.4.33_typescript@5.3.3/node_modules/tsup/assets/cjs_shims.js
32
32
  var getImportMetaUrl, importMetaUrl;
33
33
  var init_cjs_shims = __esm({
34
- "../node_modules/.pnpm/tsup@8.0.1_typescript@5.3.3/node_modules/tsup/assets/cjs_shims.js"() {
34
+ "../node_modules/.pnpm/tsup@8.0.1_postcss@8.4.33_typescript@5.3.3/node_modules/tsup/assets/cjs_shims.js"() {
35
35
  "use strict";
36
36
  getImportMetaUrl = () => typeof document === "undefined" ? new URL("file:" + __filename).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
37
37
  importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
@@ -7957,7 +7957,7 @@ init_cjs_shims();
7957
7957
 
7958
7958
  // package.json
7959
7959
  var name = "@pandacss/eslint-plugin";
7960
- var version = "0.0.4";
7960
+ var version = "0.0.5";
7961
7961
 
7962
7962
  // src/configs/all.ts
7963
7963
  init_cjs_shims();
@@ -8107,6 +8107,9 @@ var isPandaImport = (node, context) => {
8107
8107
  return imports.some((imp) => imp.mod === node.source.value);
8108
8108
  };
8109
8109
  var isPandaProp = (node, context) => {
8110
+ const prop = node.name.name;
8111
+ if (typeof prop !== "string" || !isValidProperty(prop, context))
8112
+ return;
8110
8113
  const jsxAncestor = getAncestor(isJSXOpeningElement, node);
8111
8114
  if (!jsxAncestor)
8112
8115
  return;
@@ -8125,12 +8128,17 @@ var isPandaAttribute = (node, context) => {
8125
8128
  const jsxAttrAncestor = getAncestor(isJSXAttribute, node);
8126
8129
  if (!jsxExprAncestor || !jsxAttrAncestor)
8127
8130
  return;
8128
- if (!isPandaProp(jsxAttrAncestor.name, context))
8131
+ if (!isPandaProp(jsxAttrAncestor, context))
8129
8132
  return;
8130
8133
  if (!isValidStyledProp(jsxAttrAncestor.name, context))
8131
8134
  return;
8132
8135
  return true;
8133
8136
  }
8137
+ if (!isIdentifier(node.key))
8138
+ return;
8139
+ const attr = node.key.name;
8140
+ if (!isValidProperty(attr, context))
8141
+ return;
8134
8142
  if (isIdentifier(callAncestor.callee)) {
8135
8143
  return isPandaIsh(callAncestor.callee.name, context);
8136
8144
  }
@@ -8232,12 +8240,12 @@ var rule2 = createRule({
8232
8240
  create(context) {
8233
8241
  return {
8234
8242
  CallExpression(node) {
8243
+ if (!isValidFile(context))
8244
+ return;
8235
8245
  if (!isIdentifier(node.callee))
8236
8246
  return;
8237
8247
  if (!CONFIG_FUNCTIONS.includes(node.callee.name))
8238
8248
  return;
8239
- if (!isValidFile(context))
8240
- return;
8241
8249
  context.report({
8242
8250
  node,
8243
8251
  messageId: "configFunction",
@@ -8296,15 +8304,15 @@ var rule3 = createRule({
8296
8304
  defaultOptions: [],
8297
8305
  create(context) {
8298
8306
  return {
8299
- JSXIdentifier(node) {
8300
- if (node.name !== "debug")
8307
+ JSXAttribute(node) {
8308
+ if (!isJSXIdentifier(node.name) || node.name.name !== "debug")
8301
8309
  return;
8302
8310
  if (!isPandaProp(node, context))
8303
8311
  return;
8304
8312
  context.report({
8305
8313
  node,
8306
8314
  messageId: "debug",
8307
- fix: (fixer) => fixer.remove(node.parent)
8315
+ fix: (fixer) => fixer.remove(node)
8308
8316
  });
8309
8317
  },
8310
8318
  Property(node) {
@@ -8350,7 +8358,7 @@ var rule4 = createRule({
8350
8358
  return;
8351
8359
  if (isJSXExpressionContainer(node.value) && isTemplateLiteral(node.value.expression) && node.value.expression.expressions.length === 0)
8352
8360
  return;
8353
- if (!isPandaProp(node.name, context))
8361
+ if (!isPandaProp(node, context))
8354
8362
  return;
8355
8363
  context.report({
8356
8364
  node: node.value,
@@ -8736,13 +8744,15 @@ var rule9 = createRule({
8736
8744
  });
8737
8745
  };
8738
8746
  return {
8739
- JSXIdentifier(node) {
8747
+ JSXAttribute(node) {
8748
+ if (!isJSXIdentifier(node.name))
8749
+ return;
8740
8750
  if (!isPandaProp(node, context))
8741
8751
  return;
8742
- const longhand = resolveLonghand(node.name, context);
8752
+ const longhand = resolveLonghand(node.name.name, context);
8743
8753
  if (!longhand)
8744
8754
  return;
8745
- sendReport(node, node.name);
8755
+ sendReport(node.name, node.name.name);
8746
8756
  },
8747
8757
  Property(node) {
8748
8758
  if (!isIdentifier(node.key))
@@ -9008,13 +9018,15 @@ var rule11 = createRule({
9008
9018
  });
9009
9019
  };
9010
9020
  return {
9011
- JSXIdentifier(node) {
9021
+ JSXAttribute(node) {
9022
+ if (!isJSXIdentifier(node.name))
9023
+ return;
9012
9024
  if (!isPandaProp(node, context))
9013
9025
  return;
9014
- const cpd = resolveCompositeProperty(node.name);
9026
+ const cpd = resolveCompositeProperty(node.name.name);
9015
9027
  if (!cpd)
9016
9028
  return;
9017
- sendReport(node, node.name);
9029
+ sendReport(node, node.name.name);
9018
9030
  },
9019
9031
  Property(node) {
9020
9032
  if (!isIdentifier(node.key))
package/dist/index.mjs CHANGED
@@ -3,14 +3,14 @@ import {
3
3
  __esm,
4
4
  __toESM,
5
5
  init_esm_shims
6
- } from "./chunk-2OH4QDKP.mjs";
6
+ } from "./chunk-6BVJTDXV.mjs";
7
7
 
8
8
  // package.json
9
9
  var name, version;
10
10
  var init_package = __esm({
11
11
  "package.json"() {
12
12
  name = "@pandacss/eslint-plugin";
13
- version = "0.0.4";
13
+ version = "0.0.5";
14
14
  }
15
15
  });
16
16
 
@@ -8083,6 +8083,9 @@ var init_helpers = __esm({
8083
8083
  return imports.some((imp) => imp.mod === node.source.value);
8084
8084
  };
8085
8085
  isPandaProp = (node, context) => {
8086
+ const prop = node.name.name;
8087
+ if (typeof prop !== "string" || !isValidProperty(prop, context))
8088
+ return;
8086
8089
  const jsxAncestor = getAncestor(isJSXOpeningElement, node);
8087
8090
  if (!jsxAncestor)
8088
8091
  return;
@@ -8101,12 +8104,17 @@ var init_helpers = __esm({
8101
8104
  const jsxAttrAncestor = getAncestor(isJSXAttribute, node);
8102
8105
  if (!jsxExprAncestor || !jsxAttrAncestor)
8103
8106
  return;
8104
- if (!isPandaProp(jsxAttrAncestor.name, context))
8107
+ if (!isPandaProp(jsxAttrAncestor, context))
8105
8108
  return;
8106
8109
  if (!isValidStyledProp(jsxAttrAncestor.name, context))
8107
8110
  return;
8108
8111
  return true;
8109
8112
  }
8113
+ if (!isIdentifier(node.key))
8114
+ return;
8115
+ const attr = node.key.name;
8116
+ if (!isValidProperty(attr, context))
8117
+ return;
8110
8118
  if (isIdentifier(callAncestor.callee)) {
8111
8119
  return isPandaIsh(callAncestor.callee.name, context);
8112
8120
  }
@@ -8226,12 +8234,12 @@ var init_no_config_function_in_source = __esm({
8226
8234
  create(context) {
8227
8235
  return {
8228
8236
  CallExpression(node) {
8237
+ if (!isValidFile(context))
8238
+ return;
8229
8239
  if (!isIdentifier(node.callee))
8230
8240
  return;
8231
8241
  if (!CONFIG_FUNCTIONS.includes(node.callee.name))
8232
8242
  return;
8233
- if (!isValidFile(context))
8234
- return;
8235
8243
  context.report({
8236
8244
  node,
8237
8245
  messageId: "configFunction",
@@ -8299,15 +8307,15 @@ var init_no_debug = __esm({
8299
8307
  defaultOptions: [],
8300
8308
  create(context) {
8301
8309
  return {
8302
- JSXIdentifier(node) {
8303
- if (node.name !== "debug")
8310
+ JSXAttribute(node) {
8311
+ if (!isJSXIdentifier(node.name) || node.name.name !== "debug")
8304
8312
  return;
8305
8313
  if (!isPandaProp(node, context))
8306
8314
  return;
8307
8315
  context.report({
8308
8316
  node,
8309
8317
  messageId: "debug",
8310
- fix: (fixer) => fixer.remove(node.parent)
8318
+ fix: (fixer) => fixer.remove(node)
8311
8319
  });
8312
8320
  },
8313
8321
  Property(node) {
@@ -8362,7 +8370,7 @@ var init_no_dynamic_styling = __esm({
8362
8370
  return;
8363
8371
  if (isJSXExpressionContainer(node.value) && isTemplateLiteral(node.value.expression) && node.value.expression.expressions.length === 0)
8364
8372
  return;
8365
- if (!isPandaProp(node.name, context))
8373
+ if (!isPandaProp(node, context))
8366
8374
  return;
8367
8375
  context.report({
8368
8376
  node: node.value,
@@ -8793,13 +8801,15 @@ var init_no_shorthand_prop = __esm({
8793
8801
  });
8794
8802
  };
8795
8803
  return {
8796
- JSXIdentifier(node) {
8804
+ JSXAttribute(node) {
8805
+ if (!isJSXIdentifier(node.name))
8806
+ return;
8797
8807
  if (!isPandaProp(node, context))
8798
8808
  return;
8799
- const longhand = resolveLonghand(node.name, context);
8809
+ const longhand = resolveLonghand(node.name.name, context);
8800
8810
  if (!longhand)
8801
8811
  return;
8802
- sendReport(node, node.name);
8812
+ sendReport(node.name, node.name.name);
8803
8813
  },
8804
8814
  Property(node) {
8805
8815
  if (!isIdentifier(node.key))
@@ -9088,13 +9098,15 @@ var init_prefer_atomic_properties = __esm({
9088
9098
  });
9089
9099
  };
9090
9100
  return {
9091
- JSXIdentifier(node) {
9101
+ JSXAttribute(node) {
9102
+ if (!isJSXIdentifier(node.name))
9103
+ return;
9092
9104
  if (!isPandaProp(node, context))
9093
9105
  return;
9094
- const cpd = resolveCompositeProperty(node.name);
9106
+ const cpd = resolveCompositeProperty(node.name.name);
9095
9107
  if (!cpd)
9096
9108
  return;
9097
- sendReport(node, node.name);
9109
+ sendReport(node, node.name.name);
9098
9110
  },
9099
9111
  Property(node) {
9100
9112
  if (!isIdentifier(node.key))
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  init_esm_shims
3
- } from "../chunk-2OH4QDKP.mjs";
3
+ } from "../chunk-6BVJTDXV.mjs";
4
4
 
5
5
  // src/utils/worker.ts
6
6
  init_esm_shims();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pandacss/eslint-plugin",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "description": "Eslint plugin for Panda CSS",
5
5
  "author": "Abraham Aremu <anubra266@gmail.com>",
6
6
  "main": "dist/index.js",