@pandacss/eslint-plugin 0.3.0 → 0.3.2

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.
@@ -3812,12 +3812,12 @@ var fixturePreset = {
3812
3812
  // ../fixture/src/create-context.ts
3813
3813
  var import_config = require("@pandacss/config");
3814
3814
  var import_generator = require("@pandacss/generator");
3815
- var import_node = require("@pandacss/node");
3816
- var import_shared = require("@pandacss/shared");
3815
+ var import_shared2 = require("@pandacss/shared");
3817
3816
 
3818
- // ../node_modules/.pnpm/@pandacss+dev@0.40.1_typescript@5.7.3/node_modules/@pandacss/dev/dist/index.mjs
3817
+ // ../node_modules/.pnpm/@pandacss+dev@1.8.2_typescript@5.7.3/node_modules/@pandacss/dev/dist/index.mjs
3818
+ var import_shared = require("@pandacss/shared");
3819
3819
  function defineConfig(config2) {
3820
- return config2;
3820
+ return Object.assign(config2, { name: "__panda.config__" });
3821
3821
  }
3822
3822
 
3823
3823
  // ../sandbox/v9/panda.config.ts
@@ -3948,8 +3948,8 @@ var fixtureDefaults = {
3948
3948
  config,
3949
3949
  path: "",
3950
3950
  hooks: {},
3951
- serialized: (0, import_shared.stringifyJson)(config),
3952
- deserialize: () => (0, import_shared.parseJson)((0, import_shared.stringifyJson)(config))
3951
+ serialized: (0, import_shared2.stringifyJson)(config),
3952
+ deserialize: () => (0, import_shared2.parseJson)((0, import_shared2.stringifyJson)(config))
3953
3953
  };
3954
3954
  var createGeneratorContext = (userConfig) => {
3955
3955
  const resolvedConfig = userConfig ? (0, import_config.mergeConfigs)([fixtureDefaults.config, userConfig]) : fixtureDefaults.config;
@@ -3981,7 +3981,6 @@ async function getContext(opts) {
3981
3981
  return ctx;
3982
3982
  } else {
3983
3983
  const configPath = (0, import_config3.findConfig)({ cwd: opts.configPath ?? opts.currentFile });
3984
- const cwd = import_path.default.dirname(configPath);
3985
3984
  if (!contextCache[configPath]) {
3986
3985
  contextCache[configPath] = _getContext(configPath);
3987
3986
  }
@@ -3990,7 +3989,9 @@ async function getContext(opts) {
3990
3989
  }
3991
3990
  async function filterInvalidTokens(ctx, paths) {
3992
3991
  const invalid = paths.filter((path2) => !ctx.utility.tokens.view.get(path2));
3993
- console.error("filterInvalidTokens", { paths, invalid });
3992
+ if (invalid.length > 0) {
3993
+ console.error("filterInvalidTokens", { paths, invalid });
3994
+ }
3994
3995
  return invalid;
3995
3996
  }
3996
3997
  async function filterDeprecatedTokens(ctx, tokens3) {
@@ -4021,16 +4022,19 @@ async function isValidFile(ctx, fileName) {
4021
4022
  async function resolveShorthands(ctx, name) {
4022
4023
  return ctx.utility.getPropShorthandsMap().get(name);
4023
4024
  }
4025
+ var reverseLonghandCache = /* @__PURE__ */ new WeakMap();
4024
4026
  async function resolveLongHand(ctx, name) {
4025
- const reverseShorthandsMap = /* @__PURE__ */ new Map();
4026
- const shorthands = ctx.utility.getPropShorthandsMap();
4027
- for (const [key, values] of shorthands) {
4028
- for (const value of values) {
4029
- reverseShorthandsMap.set(value, key);
4027
+ let reverseMap = reverseLonghandCache.get(ctx);
4028
+ if (!reverseMap) {
4029
+ reverseMap = /* @__PURE__ */ new Map();
4030
+ for (const [key, values] of ctx.utility.getPropShorthandsMap()) {
4031
+ for (const value of values) {
4032
+ reverseMap.set(value, key);
4033
+ }
4030
4034
  }
4035
+ reverseLonghandCache.set(ctx, reverseMap);
4031
4036
  }
4032
- const result = reverseShorthandsMap.get(name);
4033
- return result;
4037
+ return reverseMap.get(name);
4034
4038
  }
4035
4039
  async function isValidProperty(ctx, name, patternName) {
4036
4040
  const isValid = ctx.isValidProperty(name);
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  init_esm_shims
3
- } from "../chunk-Q5KKF6BL.mjs";
3
+ } from "../chunk-KBOB3H6E.mjs";
4
4
 
5
5
  // src/utils/worker.ts
6
6
  init_esm_shims();
@@ -3793,16 +3793,16 @@ var fixturePreset = {
3793
3793
  init_esm_shims();
3794
3794
  import { mergeConfigs } from "@pandacss/config";
3795
3795
  import { Generator } from "@pandacss/generator";
3796
- import { PandaContext } from "@pandacss/node";
3797
3796
  import { stringifyJson, parseJson } from "@pandacss/shared";
3798
3797
 
3799
3798
  // ../sandbox/v9/panda.config.ts
3800
3799
  init_esm_shims();
3801
3800
 
3802
- // ../node_modules/.pnpm/@pandacss+dev@0.40.1_typescript@5.7.3/node_modules/@pandacss/dev/dist/index.mjs
3801
+ // ../node_modules/.pnpm/@pandacss+dev@1.8.2_typescript@5.7.3/node_modules/@pandacss/dev/dist/index.mjs
3803
3802
  init_esm_shims();
3803
+ import { PandaError } from "@pandacss/shared";
3804
3804
  function defineConfig(config2) {
3805
- return config2;
3805
+ return Object.assign(config2, { name: "__panda.config__" });
3806
3806
  }
3807
3807
 
3808
3808
  // ../sandbox/v9/panda.config.ts
@@ -3969,7 +3969,6 @@ async function getContext(opts) {
3969
3969
  return ctx;
3970
3970
  } else {
3971
3971
  const configPath = findConfig({ cwd: opts.configPath ?? opts.currentFile });
3972
- const cwd = path.dirname(configPath);
3973
3972
  if (!contextCache[configPath]) {
3974
3973
  contextCache[configPath] = _getContext(configPath);
3975
3974
  }
@@ -3978,7 +3977,9 @@ async function getContext(opts) {
3978
3977
  }
3979
3978
  async function filterInvalidTokens(ctx, paths) {
3980
3979
  const invalid = paths.filter((path2) => !ctx.utility.tokens.view.get(path2));
3981
- console.error("filterInvalidTokens", { paths, invalid });
3980
+ if (invalid.length > 0) {
3981
+ console.error("filterInvalidTokens", { paths, invalid });
3982
+ }
3982
3983
  return invalid;
3983
3984
  }
3984
3985
  async function filterDeprecatedTokens(ctx, tokens3) {
@@ -4009,16 +4010,19 @@ async function isValidFile(ctx, fileName) {
4009
4010
  async function resolveShorthands(ctx, name) {
4010
4011
  return ctx.utility.getPropShorthandsMap().get(name);
4011
4012
  }
4013
+ var reverseLonghandCache = /* @__PURE__ */ new WeakMap();
4012
4014
  async function resolveLongHand(ctx, name) {
4013
- const reverseShorthandsMap = /* @__PURE__ */ new Map();
4014
- const shorthands = ctx.utility.getPropShorthandsMap();
4015
- for (const [key, values] of shorthands) {
4016
- for (const value of values) {
4017
- reverseShorthandsMap.set(value, key);
4015
+ let reverseMap = reverseLonghandCache.get(ctx);
4016
+ if (!reverseMap) {
4017
+ reverseMap = /* @__PURE__ */ new Map();
4018
+ for (const [key, values] of ctx.utility.getPropShorthandsMap()) {
4019
+ for (const value of values) {
4020
+ reverseMap.set(value, key);
4021
+ }
4018
4022
  }
4023
+ reverseLonghandCache.set(ctx, reverseMap);
4019
4024
  }
4020
- const result = reverseShorthandsMap.get(name);
4021
- return result;
4025
+ return reverseMap.get(name);
4022
4026
  }
4023
4027
  async function isValidProperty(ctx, name, patternName) {
4024
4028
  const isValid = ctx.isValidProperty(name);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pandacss/eslint-plugin",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "description": "Eslint plugin for Panda CSS",
5
5
  "author": "Abraham Aremu <anubra266@gmail.com>",
6
6
  "main": "dist/index.js",
@@ -26,10 +26,11 @@
26
26
  "dist"
27
27
  ],
28
28
  "dependencies": {
29
- "@pandacss/config": "^0.53.2",
30
- "@pandacss/generator": "^0.53.2",
31
- "@pandacss/node": "^0.53.2",
32
- "@pandacss/shared": "^0.53.2",
29
+ "@pandacss/config": "^1.8.2",
30
+ "@pandacss/generator": "^1.8.2",
31
+ "@pandacss/node": "^1.8.2",
32
+ "@pandacss/shared": "^1.8.2",
33
+ "@typescript-eslint/scope-manager": "^8.24.0",
33
34
  "@typescript-eslint/utils": "^8.21.0",
34
35
  "hookable": "^5.5.3",
35
36
  "micromatch": "^4.0.8",
@@ -1,42 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __esm = (fn, res) => function __init() {
8
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
9
- };
10
- var __commonJS = (cb, mod) => function __require() {
11
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
12
- };
13
- var __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from === "object" || typeof from === "function") {
15
- for (let key of __getOwnPropNames(from))
16
- if (!__hasOwnProp.call(to, key) && key !== except)
17
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
- }
19
- return to;
20
- };
21
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
- // If the importer is in node compatibility mode or this is not an ESM
23
- // file that has been converted to a CommonJS file using a Babel-
24
- // compatible transform (i.e. "__esModule" has not been set), then set
25
- // "default" to the CommonJS "module.exports" for node compatibility.
26
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
- mod
28
- ));
29
-
30
- // ../node_modules/.pnpm/tsup@8.3.6_postcss@8.4.49_typescript@5.7.3/node_modules/tsup/assets/esm_shims.js
31
- var init_esm_shims = __esm({
32
- "../node_modules/.pnpm/tsup@8.3.6_postcss@8.4.49_typescript@5.7.3/node_modules/tsup/assets/esm_shims.js"() {
33
- "use strict";
34
- }
35
- });
36
-
37
- export {
38
- __esm,
39
- __commonJS,
40
- __toESM,
41
- init_esm_shims
42
- };