@pandacss/eslint-plugin 0.2.3 → 0.2.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.
@@ -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.3.5_fsy66rctrfuonv2d24453kt37m/node_modules/tsup/assets/esm_shims.js
30
+ // ../node_modules/.pnpm/tsup@8.3.5_postcss@8.4.38_typescript@5.7.2/node_modules/tsup/assets/esm_shims.js
31
31
  var init_esm_shims = __esm({
32
- "../node_modules/.pnpm/tsup@8.3.5_fsy66rctrfuonv2d24453kt37m/node_modules/tsup/assets/esm_shims.js"() {
32
+ "../node_modules/.pnpm/tsup@8.3.5_postcss@8.4.38_typescript@5.7.2/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.3.5_fsy66rctrfuonv2d24453kt37m/node_modules/tsup/assets/cjs_shims.js
31
+ // ../node_modules/.pnpm/tsup@8.3.5_postcss@8.4.38_typescript@5.7.2/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.3.5_fsy66rctrfuonv2d24453kt37m/node_modules/tsup/assets/cjs_shims.js"() {
34
+ "../node_modules/.pnpm/tsup@8.3.5_postcss@8.4.38_typescript@5.7.2/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();
@@ -7884,7 +7884,7 @@ init_cjs_shims();
7884
7884
 
7885
7885
  // package.json
7886
7886
  var name = "@pandacss/eslint-plugin";
7887
- var version = "0.2.3";
7887
+ var version = "0.2.4";
7888
7888
 
7889
7889
  // src/configs/all.ts
7890
7890
  init_cjs_shims();
@@ -8532,6 +8532,14 @@ var rule6 = createRule({
8532
8532
  properties: {
8533
8533
  noOpacity: {
8534
8534
  type: "boolean"
8535
+ },
8536
+ whitelist: {
8537
+ type: "array",
8538
+ items: {
8539
+ type: "string",
8540
+ minLength: 0
8541
+ },
8542
+ uniqueItems: true
8535
8543
  }
8536
8544
  },
8537
8545
  additionalProperties: false
@@ -8540,12 +8548,14 @@ var rule6 = createRule({
8540
8548
  },
8541
8549
  defaultOptions: [
8542
8550
  {
8543
- noOpacity: false
8551
+ noOpacity: false,
8552
+ whitelist: []
8544
8553
  }
8545
8554
  ],
8546
8555
  create(context) {
8547
8556
  const noOpacity = context.options[0]?.noOpacity;
8548
- const colorTokenCache = /* @__PURE__ */ new Map();
8557
+ const whitelist = context.options[0]?.whitelist ?? [];
8558
+ const colorTokenCache = new Map(whitelist?.map((item) => [item, true]));
8549
8559
  const colorAttributeCache = /* @__PURE__ */ new Map();
8550
8560
  const isColorToken2 = (token) => {
8551
8561
  if (colorTokenCache.has(token)) {
@@ -8947,10 +8957,30 @@ var rule10 = createRule({
8947
8957
  noMargin: "Use flex or grid with the `gap` property to define spacing in parent elements for a more resilient layout."
8948
8958
  },
8949
8959
  type: "suggestion",
8950
- schema: []
8960
+ schema: [
8961
+ {
8962
+ type: "object",
8963
+ properties: {
8964
+ whitelist: {
8965
+ type: "array",
8966
+ items: {
8967
+ type: "string",
8968
+ minLength: 0
8969
+ },
8970
+ uniqueItems: true
8971
+ }
8972
+ },
8973
+ additionalProperties: false
8974
+ }
8975
+ ]
8951
8976
  },
8952
- defaultOptions: [],
8977
+ defaultOptions: [
8978
+ {
8979
+ whitelist: []
8980
+ }
8981
+ ],
8953
8982
  create(context) {
8983
+ const whitelist = context.options[0]?.whitelist ?? [];
8954
8984
  const longhandCache = /* @__PURE__ */ new Map();
8955
8985
  const getLonghand = (name2) => {
8956
8986
  if (longhandCache.has(name2)) {
@@ -8966,6 +8996,7 @@ var rule10 = createRule({
8966
8996
  return marginRegex.test(longhand);
8967
8997
  };
8968
8998
  const sendReport = (node) => {
8999
+ if (whitelist.includes(node.name)) return;
8969
9000
  if (!isMarginProperty(node.name)) return;
8970
9001
  context.report({
8971
9002
  node,
@@ -9070,10 +9101,30 @@ var rule11 = createRule({
9070
9101
  },
9071
9102
  type: "suggestion",
9072
9103
  hasSuggestions: true,
9073
- schema: []
9104
+ schema: [
9105
+ {
9106
+ type: "object",
9107
+ properties: {
9108
+ whitelist: {
9109
+ type: "array",
9110
+ items: {
9111
+ type: "string",
9112
+ minLength: 0
9113
+ },
9114
+ uniqueItems: true
9115
+ }
9116
+ },
9117
+ additionalProperties: false
9118
+ }
9119
+ ]
9074
9120
  },
9075
- defaultOptions: [],
9121
+ defaultOptions: [
9122
+ {
9123
+ whitelist: []
9124
+ }
9125
+ ],
9076
9126
  create(context) {
9127
+ const whitelist = context.options[0]?.whitelist ?? [];
9077
9128
  const longhandCache = /* @__PURE__ */ new Map();
9078
9129
  const pandaPropCache = /* @__PURE__ */ new WeakMap();
9079
9130
  const pandaAttributeCache = /* @__PURE__ */ new WeakMap();
@@ -9111,6 +9162,7 @@ var rule11 = createRule({
9111
9162
  return !!result;
9112
9163
  };
9113
9164
  const sendReport = (node) => {
9165
+ if (whitelist.includes(node.name)) return;
9114
9166
  const longhandName = getLonghand(node.name);
9115
9167
  if (!(longhandName in physicalProperties)) return;
9116
9168
  const logical = physicalProperties[longhandName];
@@ -9385,10 +9437,30 @@ var rule14 = createRule({
9385
9437
  },
9386
9438
  type: "suggestion",
9387
9439
  hasSuggestions: true,
9388
- schema: []
9440
+ schema: [
9441
+ {
9442
+ type: "object",
9443
+ properties: {
9444
+ whitelist: {
9445
+ type: "array",
9446
+ items: {
9447
+ type: "string",
9448
+ minLength: 0
9449
+ },
9450
+ uniqueItems: true
9451
+ }
9452
+ },
9453
+ additionalProperties: false
9454
+ }
9455
+ ]
9389
9456
  },
9390
- defaultOptions: [],
9457
+ defaultOptions: [
9458
+ {
9459
+ whitelist: []
9460
+ }
9461
+ ],
9391
9462
  create(context) {
9463
+ const whitelist = context.options[0]?.whitelist ?? [];
9392
9464
  const longhandCache = /* @__PURE__ */ new Map();
9393
9465
  const getLonghand = (name2) => {
9394
9466
  if (longhandCache.has(name2)) {
@@ -9426,6 +9498,7 @@ var rule14 = createRule({
9426
9498
  return !!result;
9427
9499
  };
9428
9500
  const sendReport = (node) => {
9501
+ if (whitelist.includes(node.name)) return;
9429
9502
  const longhand = getLonghand(node.name);
9430
9503
  if (!longhand || longhand === node.name) return;
9431
9504
  const data = {
@@ -9477,10 +9550,30 @@ var rule15 = createRule({
9477
9550
  },
9478
9551
  type: "suggestion",
9479
9552
  hasSuggestions: true,
9480
- schema: []
9553
+ schema: [
9554
+ {
9555
+ type: "object",
9556
+ properties: {
9557
+ whitelist: {
9558
+ type: "array",
9559
+ items: {
9560
+ type: "string",
9561
+ minLength: 0
9562
+ },
9563
+ uniqueItems: true
9564
+ }
9565
+ },
9566
+ additionalProperties: false
9567
+ }
9568
+ ]
9481
9569
  },
9482
- defaultOptions: [],
9570
+ defaultOptions: [
9571
+ {
9572
+ whitelist: []
9573
+ }
9574
+ ],
9483
9575
  create(context) {
9576
+ const whitelist = context.options[0]?.whitelist ?? [];
9484
9577
  const longhandCache = /* @__PURE__ */ new Map();
9485
9578
  const getLonghand = (name2) => {
9486
9579
  if (longhandCache.has(name2)) {
@@ -9527,6 +9620,7 @@ var rule15 = createRule({
9527
9620
  return !!result;
9528
9621
  };
9529
9622
  const sendReport = (node) => {
9623
+ if (whitelist.includes(node.name)) return;
9530
9624
  const longhand = getLonghand(node.name);
9531
9625
  if (longhand) return;
9532
9626
  const shorthands = getShorthands(node.name);
@@ -9695,10 +9789,30 @@ var rule16 = createRule({
9695
9789
  atomic: "Use atomic properties instead of `{{composite}}`. Prefer: \n{{atomics}}"
9696
9790
  },
9697
9791
  type: "suggestion",
9698
- schema: []
9792
+ schema: [
9793
+ {
9794
+ type: "object",
9795
+ properties: {
9796
+ whitelist: {
9797
+ type: "array",
9798
+ items: {
9799
+ type: "string",
9800
+ minLength: 0
9801
+ },
9802
+ uniqueItems: true
9803
+ }
9804
+ },
9805
+ additionalProperties: false
9806
+ }
9807
+ ]
9699
9808
  },
9700
- defaultOptions: [],
9809
+ defaultOptions: [
9810
+ {
9811
+ whitelist: []
9812
+ }
9813
+ ],
9701
9814
  create(context) {
9815
+ const whitelist = context.options[0]?.whitelist ?? [];
9702
9816
  const longhandCache = /* @__PURE__ */ new Map();
9703
9817
  const getLonghand = (name2) => {
9704
9818
  if (longhandCache.has(name2)) {
@@ -9753,6 +9867,7 @@ var rule16 = createRule({
9753
9867
  return !!result;
9754
9868
  };
9755
9869
  const sendReport = (node, composite) => {
9870
+ if (whitelist.includes(node.name)) return;
9756
9871
  const atomics = compositeProperties[composite].map((name2) => `\`${name2}\``).join(",\n");
9757
9872
  context.report({
9758
9873
  node,
@@ -9797,10 +9912,30 @@ var rule17 = createRule({
9797
9912
  composite: "Use composite property instead of `{{atomic}}`. Prefer: `{{composite}}`."
9798
9913
  },
9799
9914
  type: "suggestion",
9800
- schema: []
9915
+ schema: [
9916
+ {
9917
+ type: "object",
9918
+ properties: {
9919
+ whitelist: {
9920
+ type: "array",
9921
+ items: {
9922
+ type: "string",
9923
+ minLength: 0
9924
+ },
9925
+ uniqueItems: true
9926
+ }
9927
+ },
9928
+ additionalProperties: false
9929
+ }
9930
+ ]
9801
9931
  },
9802
- defaultOptions: [],
9932
+ defaultOptions: [
9933
+ {
9934
+ whitelist: []
9935
+ }
9936
+ ],
9803
9937
  create(context) {
9938
+ const whitelist = context.options[0]?.whitelist ?? [];
9804
9939
  const longhandCache = /* @__PURE__ */ new Map();
9805
9940
  const getLonghand = (name2) => {
9806
9941
  if (longhandCache.has(name2)) {
@@ -9852,6 +9987,7 @@ var rule17 = createRule({
9852
9987
  return !!result;
9853
9988
  };
9854
9989
  const sendReport = (node, composite) => {
9990
+ if (whitelist.includes(node.name)) return;
9855
9991
  context.report({
9856
9992
  node,
9857
9993
  messageId: "composite",
package/dist/index.mjs CHANGED
@@ -3,14 +3,14 @@ import {
3
3
  __esm,
4
4
  __toESM,
5
5
  init_esm_shims
6
- } from "./chunk-ZIYNIPDW.mjs";
6
+ } from "./chunk-AZ7XX6PH.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.2.3";
13
+ version = "0.2.4";
14
14
  }
15
15
  });
16
16
 
@@ -8561,6 +8561,14 @@ var init_no_hardcoded_color = __esm({
8561
8561
  properties: {
8562
8562
  noOpacity: {
8563
8563
  type: "boolean"
8564
+ },
8565
+ whitelist: {
8566
+ type: "array",
8567
+ items: {
8568
+ type: "string",
8569
+ minLength: 0
8570
+ },
8571
+ uniqueItems: true
8564
8572
  }
8565
8573
  },
8566
8574
  additionalProperties: false
@@ -8569,12 +8577,14 @@ var init_no_hardcoded_color = __esm({
8569
8577
  },
8570
8578
  defaultOptions: [
8571
8579
  {
8572
- noOpacity: false
8580
+ noOpacity: false,
8581
+ whitelist: []
8573
8582
  }
8574
8583
  ],
8575
8584
  create(context) {
8576
8585
  const noOpacity = context.options[0]?.noOpacity;
8577
- const colorTokenCache = /* @__PURE__ */ new Map();
8586
+ const whitelist = context.options[0]?.whitelist ?? [];
8587
+ const colorTokenCache = new Map(whitelist?.map((item) => [item, true]));
8578
8588
  const colorAttributeCache = /* @__PURE__ */ new Map();
8579
8589
  const isColorToken2 = (token) => {
8580
8590
  if (colorTokenCache.has(token)) {
@@ -9012,10 +9022,30 @@ var init_no_margin_properties = __esm({
9012
9022
  noMargin: "Use flex or grid with the `gap` property to define spacing in parent elements for a more resilient layout."
9013
9023
  },
9014
9024
  type: "suggestion",
9015
- schema: []
9025
+ schema: [
9026
+ {
9027
+ type: "object",
9028
+ properties: {
9029
+ whitelist: {
9030
+ type: "array",
9031
+ items: {
9032
+ type: "string",
9033
+ minLength: 0
9034
+ },
9035
+ uniqueItems: true
9036
+ }
9037
+ },
9038
+ additionalProperties: false
9039
+ }
9040
+ ]
9016
9041
  },
9017
- defaultOptions: [],
9042
+ defaultOptions: [
9043
+ {
9044
+ whitelist: []
9045
+ }
9046
+ ],
9018
9047
  create(context) {
9048
+ const whitelist = context.options[0]?.whitelist ?? [];
9019
9049
  const longhandCache = /* @__PURE__ */ new Map();
9020
9050
  const getLonghand = (name2) => {
9021
9051
  if (longhandCache.has(name2)) {
@@ -9031,6 +9061,7 @@ var init_no_margin_properties = __esm({
9031
9061
  return marginRegex.test(longhand);
9032
9062
  };
9033
9063
  const sendReport = (node) => {
9064
+ if (whitelist.includes(node.name)) return;
9034
9065
  if (!isMarginProperty(node.name)) return;
9035
9066
  context.report({
9036
9067
  node,
@@ -9149,10 +9180,30 @@ var init_no_physical_properties = __esm({
9149
9180
  },
9150
9181
  type: "suggestion",
9151
9182
  hasSuggestions: true,
9152
- schema: []
9183
+ schema: [
9184
+ {
9185
+ type: "object",
9186
+ properties: {
9187
+ whitelist: {
9188
+ type: "array",
9189
+ items: {
9190
+ type: "string",
9191
+ minLength: 0
9192
+ },
9193
+ uniqueItems: true
9194
+ }
9195
+ },
9196
+ additionalProperties: false
9197
+ }
9198
+ ]
9153
9199
  },
9154
- defaultOptions: [],
9200
+ defaultOptions: [
9201
+ {
9202
+ whitelist: []
9203
+ }
9204
+ ],
9155
9205
  create(context) {
9206
+ const whitelist = context.options[0]?.whitelist ?? [];
9156
9207
  const longhandCache = /* @__PURE__ */ new Map();
9157
9208
  const pandaPropCache = /* @__PURE__ */ new WeakMap();
9158
9209
  const pandaAttributeCache = /* @__PURE__ */ new WeakMap();
@@ -9190,6 +9241,7 @@ var init_no_physical_properties = __esm({
9190
9241
  return !!result;
9191
9242
  };
9192
9243
  const sendReport = (node) => {
9244
+ if (whitelist.includes(node.name)) return;
9193
9245
  const longhandName = getLonghand(node.name);
9194
9246
  if (!(longhandName in physicalProperties)) return;
9195
9247
  const logical = physicalProperties[longhandName];
@@ -9491,10 +9543,30 @@ var init_prefer_longhand_properties = __esm({
9491
9543
  },
9492
9544
  type: "suggestion",
9493
9545
  hasSuggestions: true,
9494
- schema: []
9546
+ schema: [
9547
+ {
9548
+ type: "object",
9549
+ properties: {
9550
+ whitelist: {
9551
+ type: "array",
9552
+ items: {
9553
+ type: "string",
9554
+ minLength: 0
9555
+ },
9556
+ uniqueItems: true
9557
+ }
9558
+ },
9559
+ additionalProperties: false
9560
+ }
9561
+ ]
9495
9562
  },
9496
- defaultOptions: [],
9563
+ defaultOptions: [
9564
+ {
9565
+ whitelist: []
9566
+ }
9567
+ ],
9497
9568
  create(context) {
9569
+ const whitelist = context.options[0]?.whitelist ?? [];
9498
9570
  const longhandCache = /* @__PURE__ */ new Map();
9499
9571
  const getLonghand = (name2) => {
9500
9572
  if (longhandCache.has(name2)) {
@@ -9532,6 +9604,7 @@ var init_prefer_longhand_properties = __esm({
9532
9604
  return !!result;
9533
9605
  };
9534
9606
  const sendReport = (node) => {
9607
+ if (whitelist.includes(node.name)) return;
9535
9608
  const longhand = getLonghand(node.name);
9536
9609
  if (!longhand || longhand === node.name) return;
9537
9610
  const data = {
@@ -9592,10 +9665,30 @@ var init_prefer_shorthand_properties = __esm({
9592
9665
  },
9593
9666
  type: "suggestion",
9594
9667
  hasSuggestions: true,
9595
- schema: []
9668
+ schema: [
9669
+ {
9670
+ type: "object",
9671
+ properties: {
9672
+ whitelist: {
9673
+ type: "array",
9674
+ items: {
9675
+ type: "string",
9676
+ minLength: 0
9677
+ },
9678
+ uniqueItems: true
9679
+ }
9680
+ },
9681
+ additionalProperties: false
9682
+ }
9683
+ ]
9596
9684
  },
9597
- defaultOptions: [],
9685
+ defaultOptions: [
9686
+ {
9687
+ whitelist: []
9688
+ }
9689
+ ],
9598
9690
  create(context) {
9691
+ const whitelist = context.options[0]?.whitelist ?? [];
9599
9692
  const longhandCache = /* @__PURE__ */ new Map();
9600
9693
  const getLonghand = (name2) => {
9601
9694
  if (longhandCache.has(name2)) {
@@ -9642,6 +9735,7 @@ var init_prefer_shorthand_properties = __esm({
9642
9735
  return !!result;
9643
9736
  };
9644
9737
  const sendReport = (node) => {
9738
+ if (whitelist.includes(node.name)) return;
9645
9739
  const longhand = getLonghand(node.name);
9646
9740
  if (longhand) return;
9647
9741
  const shorthands = getShorthands(node.name);
@@ -9824,10 +9918,30 @@ var init_prefer_atomic_properties = __esm({
9824
9918
  atomic: "Use atomic properties instead of `{{composite}}`. Prefer: \n{{atomics}}"
9825
9919
  },
9826
9920
  type: "suggestion",
9827
- schema: []
9921
+ schema: [
9922
+ {
9923
+ type: "object",
9924
+ properties: {
9925
+ whitelist: {
9926
+ type: "array",
9927
+ items: {
9928
+ type: "string",
9929
+ minLength: 0
9930
+ },
9931
+ uniqueItems: true
9932
+ }
9933
+ },
9934
+ additionalProperties: false
9935
+ }
9936
+ ]
9828
9937
  },
9829
- defaultOptions: [],
9938
+ defaultOptions: [
9939
+ {
9940
+ whitelist: []
9941
+ }
9942
+ ],
9830
9943
  create(context) {
9944
+ const whitelist = context.options[0]?.whitelist ?? [];
9831
9945
  const longhandCache = /* @__PURE__ */ new Map();
9832
9946
  const getLonghand = (name2) => {
9833
9947
  if (longhandCache.has(name2)) {
@@ -9882,6 +9996,7 @@ var init_prefer_atomic_properties = __esm({
9882
9996
  return !!result;
9883
9997
  };
9884
9998
  const sendReport = (node, composite) => {
9999
+ if (whitelist.includes(node.name)) return;
9885
10000
  const atomics = compositeProperties[composite].map((name2) => `\`${name2}\``).join(",\n");
9886
10001
  context.report({
9887
10002
  node,
@@ -9936,10 +10051,30 @@ var init_prefer_composite_properties = __esm({
9936
10051
  composite: "Use composite property instead of `{{atomic}}`. Prefer: `{{composite}}`."
9937
10052
  },
9938
10053
  type: "suggestion",
9939
- schema: []
10054
+ schema: [
10055
+ {
10056
+ type: "object",
10057
+ properties: {
10058
+ whitelist: {
10059
+ type: "array",
10060
+ items: {
10061
+ type: "string",
10062
+ minLength: 0
10063
+ },
10064
+ uniqueItems: true
10065
+ }
10066
+ },
10067
+ additionalProperties: false
10068
+ }
10069
+ ]
9940
10070
  },
9941
- defaultOptions: [],
10071
+ defaultOptions: [
10072
+ {
10073
+ whitelist: []
10074
+ }
10075
+ ],
9942
10076
  create(context) {
10077
+ const whitelist = context.options[0]?.whitelist ?? [];
9943
10078
  const longhandCache = /* @__PURE__ */ new Map();
9944
10079
  const getLonghand = (name2) => {
9945
10080
  if (longhandCache.has(name2)) {
@@ -9991,6 +10126,7 @@ var init_prefer_composite_properties = __esm({
9991
10126
  return !!result;
9992
10127
  };
9993
10128
  const sendReport = (node, composite) => {
10129
+ if (whitelist.includes(node.name)) return;
9994
10130
  context.report({
9995
10131
  node,
9996
10132
  messageId: "composite",
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  init_esm_shims
3
- } from "../chunk-ZIYNIPDW.mjs";
3
+ } from "../chunk-AZ7XX6PH.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.2.3",
3
+ "version": "0.2.4",
4
4
  "description": "Eslint plugin for Panda CSS",
5
5
  "author": "Abraham Aremu <anubra266@gmail.com>",
6
6
  "main": "dist/index.js",