@pandacss/eslint-plugin 0.0.18 → 0.0.20
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 +21 -4
- package/dist/index.mjs +21 -4
- package/package.json +1 -1
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.20";
|
|
7961
7961
|
|
|
7962
7962
|
// src/configs/all.ts
|
|
7963
7963
|
init_cjs_shims();
|
|
@@ -8531,10 +8531,24 @@ 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;
|
|
@@ -8545,7 +8559,9 @@ var rule6 = createRule({
|
|
|
8545
8559
|
if (!value)
|
|
8546
8560
|
return false;
|
|
8547
8561
|
const color = value?.split("/");
|
|
8548
|
-
|
|
8562
|
+
const isOpacityToken = !!color[1]?.length;
|
|
8563
|
+
const isValidToken = isColorToken(color[0], context);
|
|
8564
|
+
return noOpacity ? isValidToken && !isOpacityToken : isValidToken;
|
|
8549
8565
|
};
|
|
8550
8566
|
return {
|
|
8551
8567
|
JSXAttribute(node) {
|
|
@@ -9641,6 +9657,7 @@ var recommended_default = {
|
|
|
9641
9657
|
"@pandacss/no-config-function-in-source": "error",
|
|
9642
9658
|
"@pandacss/no-debug": "warn",
|
|
9643
9659
|
"@pandacss/no-dynamic-styling": "warn",
|
|
9660
|
+
"@pandacss/no-hardcoded-color": "warn",
|
|
9644
9661
|
"@pandacss/no-invalid-nesting": "error",
|
|
9645
9662
|
"@pandacss/no-invalid-token-paths": "error",
|
|
9646
9663
|
"@pandacss/no-property-renaming": "warn",
|
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.20";
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
16
|
|
|
@@ -8561,10 +8561,24 @@ 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;
|
|
@@ -8575,7 +8589,9 @@ var init_no_hardcoded_color = __esm({
|
|
|
8575
8589
|
if (!value)
|
|
8576
8590
|
return false;
|
|
8577
8591
|
const color = value?.split("/");
|
|
8578
|
-
|
|
8592
|
+
const isOpacityToken = !!color[1]?.length;
|
|
8593
|
+
const isValidToken = isColorToken(color[0], context);
|
|
8594
|
+
return noOpacity ? isValidToken && !isOpacityToken : isValidToken;
|
|
8579
8595
|
};
|
|
8580
8596
|
return {
|
|
8581
8597
|
JSXAttribute(node) {
|
|
@@ -9833,6 +9849,7 @@ var init_recommended = __esm({
|
|
|
9833
9849
|
"@pandacss/no-config-function-in-source": "error",
|
|
9834
9850
|
"@pandacss/no-debug": "warn",
|
|
9835
9851
|
"@pandacss/no-dynamic-styling": "warn",
|
|
9852
|
+
"@pandacss/no-hardcoded-color": "warn",
|
|
9836
9853
|
"@pandacss/no-invalid-nesting": "error",
|
|
9837
9854
|
"@pandacss/no-invalid-token-paths": "error",
|
|
9838
9855
|
"@pandacss/no-property-renaming": "warn",
|