@pandacss/eslint-plugin 0.0.17 → 0.0.19
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 +28 -6
- package/dist/index.mjs +28 -6
- 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.19";
|
|
7961
7961
|
|
|
7962
7962
|
// src/configs/all.ts
|
|
7963
7963
|
init_cjs_shims();
|
|
@@ -8531,23 +8531,45 @@ var rule6 = createRule({
|
|
|
8531
8531
|
invalidColor: "`{{color}}` is not a valid color token."
|
|
8532
8532
|
},
|
|
8533
8533
|
type: "suggestion",
|
|
8534
|
-
schema: [
|
|
8534
|
+
schema: [
|
|
8535
|
+
{
|
|
8536
|
+
type: "object",
|
|
8537
|
+
properties: {
|
|
8538
|
+
noOpacity: {
|
|
8539
|
+
type: "boolean"
|
|
8540
|
+
}
|
|
8541
|
+
}
|
|
8542
|
+
}
|
|
8543
|
+
]
|
|
8535
8544
|
},
|
|
8536
|
-
defaultOptions: [
|
|
8545
|
+
defaultOptions: [
|
|
8546
|
+
{
|
|
8547
|
+
noOpacity: false
|
|
8548
|
+
}
|
|
8549
|
+
],
|
|
8537
8550
|
create(context) {
|
|
8551
|
+
const noOpacity = context.options[0]?.noOpacity;
|
|
8538
8552
|
const isTokenFn = (value) => {
|
|
8539
8553
|
if (!value)
|
|
8540
8554
|
return false;
|
|
8541
8555
|
const tokens = extractTokens(value);
|
|
8542
8556
|
return tokens.length > 0;
|
|
8543
8557
|
};
|
|
8558
|
+
const testColorToken = (value) => {
|
|
8559
|
+
if (!value)
|
|
8560
|
+
return false;
|
|
8561
|
+
const color = value?.split("/");
|
|
8562
|
+
const isOpacityToken = !!color[1]?.length;
|
|
8563
|
+
const isValidToken = isColorToken(color[0], context);
|
|
8564
|
+
return noOpacity ? isValidToken && !isOpacityToken : isValidToken;
|
|
8565
|
+
};
|
|
8544
8566
|
return {
|
|
8545
8567
|
JSXAttribute(node) {
|
|
8546
8568
|
if (!isJSXIdentifier(node.name))
|
|
8547
8569
|
return;
|
|
8548
8570
|
if (!isPandaProp(node, context) || !node.value)
|
|
8549
8571
|
return;
|
|
8550
|
-
if (isLiteral(node.value) && isColorAttribute(node.name.name, context) && !isTokenFn(node.value.value?.toString()) && !
|
|
8572
|
+
if (isLiteral(node.value) && isColorAttribute(node.name.name, context) && !isTokenFn(node.value.value?.toString()) && !testColorToken(node.value.value?.toString())) {
|
|
8551
8573
|
context.report({
|
|
8552
8574
|
node: node.value,
|
|
8553
8575
|
messageId: "invalidColor",
|
|
@@ -8558,7 +8580,7 @@ var rule6 = createRule({
|
|
|
8558
8580
|
}
|
|
8559
8581
|
if (!isJSXExpressionContainer(node.value))
|
|
8560
8582
|
return;
|
|
8561
|
-
if (isLiteral(node.value.expression) && isColorAttribute(node.name.name, context) && !isTokenFn(node.value.expression.value?.toString()) && !
|
|
8583
|
+
if (isLiteral(node.value.expression) && isColorAttribute(node.name.name, context) && !isTokenFn(node.value.expression.value?.toString()) && !testColorToken(node.value.expression.value?.toString())) {
|
|
8562
8584
|
context.report({
|
|
8563
8585
|
node: node.value.expression,
|
|
8564
8586
|
messageId: "invalidColor",
|
|
@@ -8579,7 +8601,7 @@ var rule6 = createRule({
|
|
|
8579
8601
|
return;
|
|
8580
8602
|
if (isTokenFn(node.value.value?.toString()))
|
|
8581
8603
|
return;
|
|
8582
|
-
if (
|
|
8604
|
+
if (testColorToken(node.value.value?.toString()))
|
|
8583
8605
|
return;
|
|
8584
8606
|
context.report({
|
|
8585
8607
|
node: node.value,
|
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.19";
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
16
|
|
|
@@ -8561,23 +8561,45 @@ var init_no_hardcoded_color = __esm({
|
|
|
8561
8561
|
invalidColor: "`{{color}}` is not a valid color token."
|
|
8562
8562
|
},
|
|
8563
8563
|
type: "suggestion",
|
|
8564
|
-
schema: [
|
|
8564
|
+
schema: [
|
|
8565
|
+
{
|
|
8566
|
+
type: "object",
|
|
8567
|
+
properties: {
|
|
8568
|
+
noOpacity: {
|
|
8569
|
+
type: "boolean"
|
|
8570
|
+
}
|
|
8571
|
+
}
|
|
8572
|
+
}
|
|
8573
|
+
]
|
|
8565
8574
|
},
|
|
8566
|
-
defaultOptions: [
|
|
8575
|
+
defaultOptions: [
|
|
8576
|
+
{
|
|
8577
|
+
noOpacity: false
|
|
8578
|
+
}
|
|
8579
|
+
],
|
|
8567
8580
|
create(context) {
|
|
8581
|
+
const noOpacity = context.options[0]?.noOpacity;
|
|
8568
8582
|
const isTokenFn = (value) => {
|
|
8569
8583
|
if (!value)
|
|
8570
8584
|
return false;
|
|
8571
8585
|
const tokens = extractTokens(value);
|
|
8572
8586
|
return tokens.length > 0;
|
|
8573
8587
|
};
|
|
8588
|
+
const testColorToken = (value) => {
|
|
8589
|
+
if (!value)
|
|
8590
|
+
return false;
|
|
8591
|
+
const color = value?.split("/");
|
|
8592
|
+
const isOpacityToken = !!color[1]?.length;
|
|
8593
|
+
const isValidToken = isColorToken(color[0], context);
|
|
8594
|
+
return noOpacity ? isValidToken && !isOpacityToken : isValidToken;
|
|
8595
|
+
};
|
|
8574
8596
|
return {
|
|
8575
8597
|
JSXAttribute(node) {
|
|
8576
8598
|
if (!isJSXIdentifier(node.name))
|
|
8577
8599
|
return;
|
|
8578
8600
|
if (!isPandaProp(node, context) || !node.value)
|
|
8579
8601
|
return;
|
|
8580
|
-
if (isLiteral(node.value) && isColorAttribute(node.name.name, context) && !isTokenFn(node.value.value?.toString()) && !
|
|
8602
|
+
if (isLiteral(node.value) && isColorAttribute(node.name.name, context) && !isTokenFn(node.value.value?.toString()) && !testColorToken(node.value.value?.toString())) {
|
|
8581
8603
|
context.report({
|
|
8582
8604
|
node: node.value,
|
|
8583
8605
|
messageId: "invalidColor",
|
|
@@ -8588,7 +8610,7 @@ var init_no_hardcoded_color = __esm({
|
|
|
8588
8610
|
}
|
|
8589
8611
|
if (!isJSXExpressionContainer(node.value))
|
|
8590
8612
|
return;
|
|
8591
|
-
if (isLiteral(node.value.expression) && isColorAttribute(node.name.name, context) && !isTokenFn(node.value.expression.value?.toString()) && !
|
|
8613
|
+
if (isLiteral(node.value.expression) && isColorAttribute(node.name.name, context) && !isTokenFn(node.value.expression.value?.toString()) && !testColorToken(node.value.expression.value?.toString())) {
|
|
8592
8614
|
context.report({
|
|
8593
8615
|
node: node.value.expression,
|
|
8594
8616
|
messageId: "invalidColor",
|
|
@@ -8609,7 +8631,7 @@ var init_no_hardcoded_color = __esm({
|
|
|
8609
8631
|
return;
|
|
8610
8632
|
if (isTokenFn(node.value.value?.toString()))
|
|
8611
8633
|
return;
|
|
8612
|
-
if (
|
|
8634
|
+
if (testColorToken(node.value.value?.toString()))
|
|
8613
8635
|
return;
|
|
8614
8636
|
context.report({
|
|
8615
8637
|
node: node.value,
|
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.19",
|
|
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"
|