@pandacss/eslint-plugin 0.0.16 → 0.0.18
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 +11 -5
- package/dist/index.mjs +11 -5
- package/dist/utils/worker.js +8 -2
- package/dist/utils/worker.mjs +8 -2
- 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.0.
|
|
7960
|
+
var version = "0.0.18";
|
|
7961
7961
|
|
|
7962
7962
|
// src/configs/all.ts
|
|
7963
7963
|
init_cjs_shims();
|
|
@@ -8541,13 +8541,19 @@ var rule6 = createRule({
|
|
|
8541
8541
|
const tokens = extractTokens(value);
|
|
8542
8542
|
return tokens.length > 0;
|
|
8543
8543
|
};
|
|
8544
|
+
const testColorToken = (value) => {
|
|
8545
|
+
if (!value)
|
|
8546
|
+
return false;
|
|
8547
|
+
const color = value?.split("/");
|
|
8548
|
+
return isColorToken(color[0], context);
|
|
8549
|
+
};
|
|
8544
8550
|
return {
|
|
8545
8551
|
JSXAttribute(node) {
|
|
8546
8552
|
if (!isJSXIdentifier(node.name))
|
|
8547
8553
|
return;
|
|
8548
8554
|
if (!isPandaProp(node, context) || !node.value)
|
|
8549
8555
|
return;
|
|
8550
|
-
if (isLiteral(node.value) && isColorAttribute(node.name.name, context) && !isTokenFn(node.value.value?.toString()) && !
|
|
8556
|
+
if (isLiteral(node.value) && isColorAttribute(node.name.name, context) && !isTokenFn(node.value.value?.toString()) && !testColorToken(node.value.value?.toString())) {
|
|
8551
8557
|
context.report({
|
|
8552
8558
|
node: node.value,
|
|
8553
8559
|
messageId: "invalidColor",
|
|
@@ -8558,7 +8564,7 @@ var rule6 = createRule({
|
|
|
8558
8564
|
}
|
|
8559
8565
|
if (!isJSXExpressionContainer(node.value))
|
|
8560
8566
|
return;
|
|
8561
|
-
if (isLiteral(node.value.expression) && isColorAttribute(node.name.name, context) && !isTokenFn(node.value.expression.value?.toString()) && !
|
|
8567
|
+
if (isLiteral(node.value.expression) && isColorAttribute(node.name.name, context) && !isTokenFn(node.value.expression.value?.toString()) && !testColorToken(node.value.expression.value?.toString())) {
|
|
8562
8568
|
context.report({
|
|
8563
8569
|
node: node.value.expression,
|
|
8564
8570
|
messageId: "invalidColor",
|
|
@@ -8579,7 +8585,7 @@ var rule6 = createRule({
|
|
|
8579
8585
|
return;
|
|
8580
8586
|
if (isTokenFn(node.value.value?.toString()))
|
|
8581
8587
|
return;
|
|
8582
|
-
if (
|
|
8588
|
+
if (testColorToken(node.value.value?.toString()))
|
|
8583
8589
|
return;
|
|
8584
8590
|
context.report({
|
|
8585
8591
|
node: node.value,
|
|
@@ -9638,7 +9644,7 @@ var recommended_default = {
|
|
|
9638
9644
|
"@pandacss/no-invalid-nesting": "error",
|
|
9639
9645
|
"@pandacss/no-invalid-token-paths": "error",
|
|
9640
9646
|
"@pandacss/no-property-renaming": "warn",
|
|
9641
|
-
"@pandacss/
|
|
9647
|
+
"@pandacss/no-unsafe-token-fn-usage": "warn"
|
|
9642
9648
|
}
|
|
9643
9649
|
};
|
|
9644
9650
|
|
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.0.
|
|
13
|
+
version = "0.0.18";
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
16
|
|
|
@@ -8571,13 +8571,19 @@ var init_no_hardcoded_color = __esm({
|
|
|
8571
8571
|
const tokens = extractTokens(value);
|
|
8572
8572
|
return tokens.length > 0;
|
|
8573
8573
|
};
|
|
8574
|
+
const testColorToken = (value) => {
|
|
8575
|
+
if (!value)
|
|
8576
|
+
return false;
|
|
8577
|
+
const color = value?.split("/");
|
|
8578
|
+
return isColorToken(color[0], context);
|
|
8579
|
+
};
|
|
8574
8580
|
return {
|
|
8575
8581
|
JSXAttribute(node) {
|
|
8576
8582
|
if (!isJSXIdentifier(node.name))
|
|
8577
8583
|
return;
|
|
8578
8584
|
if (!isPandaProp(node, context) || !node.value)
|
|
8579
8585
|
return;
|
|
8580
|
-
if (isLiteral(node.value) && isColorAttribute(node.name.name, context) && !isTokenFn(node.value.value?.toString()) && !
|
|
8586
|
+
if (isLiteral(node.value) && isColorAttribute(node.name.name, context) && !isTokenFn(node.value.value?.toString()) && !testColorToken(node.value.value?.toString())) {
|
|
8581
8587
|
context.report({
|
|
8582
8588
|
node: node.value,
|
|
8583
8589
|
messageId: "invalidColor",
|
|
@@ -8588,7 +8594,7 @@ var init_no_hardcoded_color = __esm({
|
|
|
8588
8594
|
}
|
|
8589
8595
|
if (!isJSXExpressionContainer(node.value))
|
|
8590
8596
|
return;
|
|
8591
|
-
if (isLiteral(node.value.expression) && isColorAttribute(node.name.name, context) && !isTokenFn(node.value.expression.value?.toString()) && !
|
|
8597
|
+
if (isLiteral(node.value.expression) && isColorAttribute(node.name.name, context) && !isTokenFn(node.value.expression.value?.toString()) && !testColorToken(node.value.expression.value?.toString())) {
|
|
8592
8598
|
context.report({
|
|
8593
8599
|
node: node.value.expression,
|
|
8594
8600
|
messageId: "invalidColor",
|
|
@@ -8609,7 +8615,7 @@ var init_no_hardcoded_color = __esm({
|
|
|
8609
8615
|
return;
|
|
8610
8616
|
if (isTokenFn(node.value.value?.toString()))
|
|
8611
8617
|
return;
|
|
8612
|
-
if (
|
|
8618
|
+
if (testColorToken(node.value.value?.toString()))
|
|
8613
8619
|
return;
|
|
8614
8620
|
context.report({
|
|
8615
8621
|
node: node.value,
|
|
@@ -9830,7 +9836,7 @@ var init_recommended = __esm({
|
|
|
9830
9836
|
"@pandacss/no-invalid-nesting": "error",
|
|
9831
9837
|
"@pandacss/no-invalid-token-paths": "error",
|
|
9832
9838
|
"@pandacss/no-property-renaming": "warn",
|
|
9833
|
-
"@pandacss/
|
|
9839
|
+
"@pandacss/no-unsafe-token-fn-usage": "warn"
|
|
9834
9840
|
}
|
|
9835
9841
|
};
|
|
9836
9842
|
}
|
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.31.0/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])",
|
|
@@ -2009,6 +2009,12 @@ var typography = {
|
|
|
2009
2009
|
className: "text-shadow",
|
|
2010
2010
|
values: "shadows"
|
|
2011
2011
|
},
|
|
2012
|
+
textShadowColor: {
|
|
2013
|
+
shorthand: "textShadowColor",
|
|
2014
|
+
className: "text-shadow",
|
|
2015
|
+
values: "colors",
|
|
2016
|
+
transform: createColorMixTransform("--text-shadow-color")
|
|
2017
|
+
},
|
|
2012
2018
|
textOverflow: {
|
|
2013
2019
|
className: "text"
|
|
2014
2020
|
},
|
|
@@ -2542,7 +2548,7 @@ var preset = definePreset({
|
|
|
2542
2548
|
});
|
|
2543
2549
|
var src_default = preset;
|
|
2544
2550
|
|
|
2545
|
-
// ../node_modules/.pnpm/@pandacss+preset-panda@0.
|
|
2551
|
+
// ../node_modules/.pnpm/@pandacss+preset-panda@0.31.0/node_modules/@pandacss/preset-panda/dist/index.mjs
|
|
2546
2552
|
var breakpoints = {
|
|
2547
2553
|
sm: "640px",
|
|
2548
2554
|
md: "768px",
|
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.31.0/node_modules/@pandacss/preset-base/dist/index.mjs
|
|
17
17
|
init_esm_shims();
|
|
18
18
|
var conditions = {
|
|
19
19
|
hover: "&:is(:hover, [data-hover])",
|
|
@@ -1985,6 +1985,12 @@ var typography = {
|
|
|
1985
1985
|
className: "text-shadow",
|
|
1986
1986
|
values: "shadows"
|
|
1987
1987
|
},
|
|
1988
|
+
textShadowColor: {
|
|
1989
|
+
shorthand: "textShadowColor",
|
|
1990
|
+
className: "text-shadow",
|
|
1991
|
+
values: "colors",
|
|
1992
|
+
transform: createColorMixTransform("--text-shadow-color")
|
|
1993
|
+
},
|
|
1988
1994
|
textOverflow: {
|
|
1989
1995
|
className: "text"
|
|
1990
1996
|
},
|
|
@@ -2518,7 +2524,7 @@ var preset = definePreset({
|
|
|
2518
2524
|
});
|
|
2519
2525
|
var src_default = preset;
|
|
2520
2526
|
|
|
2521
|
-
// ../node_modules/.pnpm/@pandacss+preset-panda@0.
|
|
2527
|
+
// ../node_modules/.pnpm/@pandacss+preset-panda@0.31.0/node_modules/@pandacss/preset-panda/dist/index.mjs
|
|
2522
2528
|
init_esm_shims();
|
|
2523
2529
|
var breakpoints = {
|
|
2524
2530
|
sm: "640px",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pandacss/eslint-plugin",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.18",
|
|
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.31.0",
|
|
30
|
+
"@pandacss/generator": "^0.31.0",
|
|
31
|
+
"@pandacss/node": "^0.31.0",
|
|
32
|
+
"@pandacss/shared": "^0.31.0",
|
|
33
33
|
"@typescript-eslint/utils": "^6.19.1",
|
|
34
34
|
"hookable": "^5.5.3",
|
|
35
35
|
"synckit": "^0.9.0"
|