@pandacss/eslint-plugin 0.1.5 → 0.1.7
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 +13 -2
- package/dist/index.mjs +14 -3
- package/dist/utils/worker.js +2 -25
- package/dist/utils/worker.mjs +3 -26
- package/package.json +5 -5
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.
|
|
7960
|
+
var version = "0.1.7";
|
|
7961
7961
|
|
|
7962
7962
|
// src/configs/all.ts
|
|
7963
7963
|
init_cjs_shims();
|
|
@@ -7979,7 +7979,14 @@ var createRule = import_utils.ESLintUtils.RuleCreator(
|
|
|
7979
7979
|
);
|
|
7980
7980
|
var isBase = process.env.NODE_ENV !== "test" || importMetaUrl.endsWith("dist/index.js");
|
|
7981
7981
|
var distDir = (0, import_node_url.fileURLToPath)(new URL(isBase ? "./" : "../../dist", importMetaUrl));
|
|
7982
|
-
var
|
|
7982
|
+
var _syncAction = (0, import_synckit.createSyncFn)((0, import_node_path.join)(distDir, "utils/worker.mjs"));
|
|
7983
|
+
var syncAction = (...args) => {
|
|
7984
|
+
try {
|
|
7985
|
+
return _syncAction(...args);
|
|
7986
|
+
} catch (error) {
|
|
7987
|
+
return;
|
|
7988
|
+
}
|
|
7989
|
+
};
|
|
7983
7990
|
|
|
7984
7991
|
// src/utils/helpers.ts
|
|
7985
7992
|
init_cjs_shims();
|
|
@@ -8799,6 +8806,8 @@ var rule9 = createRule({
|
|
|
8799
8806
|
const sendReport = (node, _value) => {
|
|
8800
8807
|
const value = _value ?? node.value?.toString();
|
|
8801
8808
|
const tokens = getInvalidTokens(value, context);
|
|
8809
|
+
if (!tokens)
|
|
8810
|
+
return;
|
|
8802
8811
|
if (tokens.length > 0) {
|
|
8803
8812
|
tokens.forEach((token) => {
|
|
8804
8813
|
context.report({
|
|
@@ -8840,6 +8849,8 @@ var rule9 = createRule({
|
|
|
8840
8849
|
const quasis = node.quasi.quasis[0];
|
|
8841
8850
|
const styles = quasis.value.raw;
|
|
8842
8851
|
const tokens = getInvalidTokens(styles, context);
|
|
8852
|
+
if (!tokens)
|
|
8853
|
+
return;
|
|
8843
8854
|
tokens.forEach((token, i, arr) => {
|
|
8844
8855
|
if (arr.indexOf(token) < i)
|
|
8845
8856
|
return;
|
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.
|
|
13
|
+
version = "0.1.7";
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
16
|
|
|
@@ -19,7 +19,7 @@ import { ESLintUtils } from "@typescript-eslint/utils";
|
|
|
19
19
|
import { createSyncFn } from "synckit";
|
|
20
20
|
import { join } from "node:path";
|
|
21
21
|
import { fileURLToPath } from "node:url";
|
|
22
|
-
var createRule, isBase, distDir, syncAction;
|
|
22
|
+
var createRule, isBase, distDir, _syncAction, syncAction;
|
|
23
23
|
var init_utils = __esm({
|
|
24
24
|
"src/utils/index.ts"() {
|
|
25
25
|
"use strict";
|
|
@@ -29,7 +29,14 @@ var init_utils = __esm({
|
|
|
29
29
|
);
|
|
30
30
|
isBase = process.env.NODE_ENV !== "test" || import.meta.url.endsWith("dist/index.js");
|
|
31
31
|
distDir = fileURLToPath(new URL(isBase ? "./" : "../../dist", import.meta.url));
|
|
32
|
-
|
|
32
|
+
_syncAction = createSyncFn(join(distDir, "utils/worker.mjs"));
|
|
33
|
+
syncAction = (...args) => {
|
|
34
|
+
try {
|
|
35
|
+
return _syncAction(...args);
|
|
36
|
+
} catch (error) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
};
|
|
33
40
|
}
|
|
34
41
|
});
|
|
35
42
|
|
|
@@ -8856,6 +8863,8 @@ var init_no_invalid_token_paths = __esm({
|
|
|
8856
8863
|
const sendReport = (node, _value) => {
|
|
8857
8864
|
const value = _value ?? node.value?.toString();
|
|
8858
8865
|
const tokens = getInvalidTokens(value, context);
|
|
8866
|
+
if (!tokens)
|
|
8867
|
+
return;
|
|
8859
8868
|
if (tokens.length > 0) {
|
|
8860
8869
|
tokens.forEach((token) => {
|
|
8861
8870
|
context.report({
|
|
@@ -8897,6 +8906,8 @@ var init_no_invalid_token_paths = __esm({
|
|
|
8897
8906
|
const quasis = node.quasi.quasis[0];
|
|
8898
8907
|
const styles = quasis.value.raw;
|
|
8899
8908
|
const tokens = getInvalidTokens(styles, context);
|
|
8909
|
+
if (!tokens)
|
|
8910
|
+
return;
|
|
8900
8911
|
tokens.forEach((token, i, arr) => {
|
|
8901
8912
|
if (arr.indexOf(token) < i)
|
|
8902
8913
|
return;
|
package/dist/utils/worker.js
CHANGED
|
@@ -38,7 +38,7 @@ module.exports = __toCommonJS(worker_exports);
|
|
|
38
38
|
var import_node2 = require("@pandacss/node");
|
|
39
39
|
var import_synckit = require("synckit");
|
|
40
40
|
|
|
41
|
-
// ../node_modules/.pnpm/@pandacss+preset-base@0.
|
|
41
|
+
// ../node_modules/.pnpm/@pandacss+preset-base@0.40.1/node_modules/@pandacss/preset-base/dist/index.mjs
|
|
42
42
|
var conditions = {
|
|
43
43
|
hover: "&:is(:hover, [data-hover])",
|
|
44
44
|
focus: "&:is(:focus, [data-focus])",
|
|
@@ -2908,7 +2908,7 @@ var preset = definePreset({
|
|
|
2908
2908
|
});
|
|
2909
2909
|
var src_default = preset;
|
|
2910
2910
|
|
|
2911
|
-
// ../node_modules/.pnpm/@pandacss+preset-panda@0.
|
|
2911
|
+
// ../node_modules/.pnpm/@pandacss+preset-panda@0.40.1/node_modules/@pandacss/preset-panda/dist/index.mjs
|
|
2912
2912
|
var breakpoints = {
|
|
2913
2913
|
sm: "640px",
|
|
2914
2914
|
md: "768px",
|
|
@@ -3869,27 +3869,6 @@ async function getContext(opts) {
|
|
|
3869
3869
|
return await promise;
|
|
3870
3870
|
}
|
|
3871
3871
|
}
|
|
3872
|
-
async function getExtendWarnings() {
|
|
3873
|
-
if (!configPath)
|
|
3874
|
-
return [];
|
|
3875
|
-
const cwd = import_path.default.dirname(configPath);
|
|
3876
|
-
const { config: config2 } = await (0, import_config3.bundleConfig)({ cwd, file: configPath });
|
|
3877
|
-
if (!config2.presets || config2.presets.length === 0)
|
|
3878
|
-
return [];
|
|
3879
|
-
if (config2.eject)
|
|
3880
|
-
return [];
|
|
3881
|
-
const warnings = /* @__PURE__ */ new Set();
|
|
3882
|
-
if (config2.theme && !config2.theme.extend) {
|
|
3883
|
-
warnings.add("theme");
|
|
3884
|
-
}
|
|
3885
|
-
if (config2.conditions && !config2.conditions.extend) {
|
|
3886
|
-
warnings.add("conditions");
|
|
3887
|
-
}
|
|
3888
|
-
if (config2.patterns && !config2.patterns.extend) {
|
|
3889
|
-
warnings.add("patterns");
|
|
3890
|
-
}
|
|
3891
|
-
return Array.from(warnings);
|
|
3892
|
-
}
|
|
3893
3872
|
async function filterInvalidTokens(ctx, paths) {
|
|
3894
3873
|
return paths.filter((path2) => !ctx.utility.tokens.view.get(path2));
|
|
3895
3874
|
}
|
|
@@ -3970,8 +3949,6 @@ async function runAsync(action, opts, ...args) {
|
|
|
3970
3949
|
return isColorToken(ctx, ...args);
|
|
3971
3950
|
case "filterInvalidTokens":
|
|
3972
3951
|
return filterInvalidTokens(ctx, ...args);
|
|
3973
|
-
case "getExtendWarnings":
|
|
3974
|
-
return getExtendWarnings();
|
|
3975
3952
|
}
|
|
3976
3953
|
}
|
|
3977
3954
|
function run(action, opts, ...args) {
|
package/dist/utils/worker.mjs
CHANGED
|
@@ -13,7 +13,7 @@ init_esm_shims();
|
|
|
13
13
|
// ../fixture/src/config.ts
|
|
14
14
|
init_esm_shims();
|
|
15
15
|
|
|
16
|
-
// ../node_modules/.pnpm/@pandacss+preset-base@0.
|
|
16
|
+
// ../node_modules/.pnpm/@pandacss+preset-base@0.40.1/node_modules/@pandacss/preset-base/dist/index.mjs
|
|
17
17
|
init_esm_shims();
|
|
18
18
|
var conditions = {
|
|
19
19
|
hover: "&:is(:hover, [data-hover])",
|
|
@@ -2884,7 +2884,7 @@ var preset = definePreset({
|
|
|
2884
2884
|
});
|
|
2885
2885
|
var src_default = preset;
|
|
2886
2886
|
|
|
2887
|
-
// ../node_modules/.pnpm/@pandacss+preset-panda@0.
|
|
2887
|
+
// ../node_modules/.pnpm/@pandacss+preset-panda@0.40.1/node_modules/@pandacss/preset-panda/dist/index.mjs
|
|
2888
2888
|
init_esm_shims();
|
|
2889
2889
|
var breakpoints = {
|
|
2890
2890
|
sm: "640px",
|
|
@@ -3830,7 +3830,7 @@ init_esm_shims();
|
|
|
3830
3830
|
|
|
3831
3831
|
// src/utils/worker.ts
|
|
3832
3832
|
import { resolveTsPathPattern } from "@pandacss/config/ts-path";
|
|
3833
|
-
import { findConfig
|
|
3833
|
+
import { findConfig } from "@pandacss/config";
|
|
3834
3834
|
import path from "path";
|
|
3835
3835
|
var promise;
|
|
3836
3836
|
var configPath;
|
|
@@ -3853,27 +3853,6 @@ async function getContext(opts) {
|
|
|
3853
3853
|
return await promise;
|
|
3854
3854
|
}
|
|
3855
3855
|
}
|
|
3856
|
-
async function getExtendWarnings() {
|
|
3857
|
-
if (!configPath)
|
|
3858
|
-
return [];
|
|
3859
|
-
const cwd = path.dirname(configPath);
|
|
3860
|
-
const { config: config2 } = await bundleConfig({ cwd, file: configPath });
|
|
3861
|
-
if (!config2.presets || config2.presets.length === 0)
|
|
3862
|
-
return [];
|
|
3863
|
-
if (config2.eject)
|
|
3864
|
-
return [];
|
|
3865
|
-
const warnings = /* @__PURE__ */ new Set();
|
|
3866
|
-
if (config2.theme && !config2.theme.extend) {
|
|
3867
|
-
warnings.add("theme");
|
|
3868
|
-
}
|
|
3869
|
-
if (config2.conditions && !config2.conditions.extend) {
|
|
3870
|
-
warnings.add("conditions");
|
|
3871
|
-
}
|
|
3872
|
-
if (config2.patterns && !config2.patterns.extend) {
|
|
3873
|
-
warnings.add("patterns");
|
|
3874
|
-
}
|
|
3875
|
-
return Array.from(warnings);
|
|
3876
|
-
}
|
|
3877
3856
|
async function filterInvalidTokens(ctx, paths) {
|
|
3878
3857
|
return paths.filter((path2) => !ctx.utility.tokens.view.get(path2));
|
|
3879
3858
|
}
|
|
@@ -3954,8 +3933,6 @@ async function runAsync(action, opts, ...args) {
|
|
|
3954
3933
|
return isColorToken(ctx, ...args);
|
|
3955
3934
|
case "filterInvalidTokens":
|
|
3956
3935
|
return filterInvalidTokens(ctx, ...args);
|
|
3957
|
-
case "getExtendWarnings":
|
|
3958
|
-
return getExtendWarnings();
|
|
3959
3936
|
}
|
|
3960
3937
|
}
|
|
3961
3938
|
function run(action, opts, ...args) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pandacss/eslint-plugin",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
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,10 @@
|
|
|
26
26
|
"dist"
|
|
27
27
|
],
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@pandacss/config": "^0.
|
|
30
|
-
"@pandacss/generator": "^0.
|
|
31
|
-
"@pandacss/node": "^0.
|
|
32
|
-
"@pandacss/shared": "^0.
|
|
29
|
+
"@pandacss/config": "^0.40.0",
|
|
30
|
+
"@pandacss/generator": "^0.40.0",
|
|
31
|
+
"@pandacss/node": "^0.40.0",
|
|
32
|
+
"@pandacss/shared": "^0.40.0",
|
|
33
33
|
"@typescript-eslint/utils": "^6.19.1",
|
|
34
34
|
"hookable": "^5.5.3",
|
|
35
35
|
"synckit": "^0.9.0"
|