@pandacss/eslint-plugin 0.0.0-dev-20240209200922 → 0.0.0-dev-20240209204008
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 -10
- package/dist/index.mjs +13 -10
- 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.0-dev-
|
|
7960
|
+
var version = "0.0.0-dev-20240209204008";
|
|
7961
7961
|
|
|
7962
7962
|
// src/configs/all.ts
|
|
7963
7963
|
init_cjs_shims();
|
|
@@ -8583,6 +8583,7 @@ var no_hardcoded_color_default = rule6;
|
|
|
8583
8583
|
|
|
8584
8584
|
// src/rules/no-important.ts
|
|
8585
8585
|
init_cjs_shims();
|
|
8586
|
+
var import_shared2 = require("@pandacss/shared");
|
|
8586
8587
|
var exclamationRegex = /\s*!$/;
|
|
8587
8588
|
var importantRegex = /\s*!important\s*$/;
|
|
8588
8589
|
var RULE_NAME7 = "no-important";
|
|
@@ -8603,9 +8604,10 @@ var rule7 = createRule({
|
|
|
8603
8604
|
defaultOptions: [],
|
|
8604
8605
|
create(context) {
|
|
8605
8606
|
const removeQuotes = ([start, end]) => [start + 1, end - 1];
|
|
8606
|
-
const hasImportantKeyword = (
|
|
8607
|
-
if (!
|
|
8607
|
+
const hasImportantKeyword = (_value) => {
|
|
8608
|
+
if (!_value)
|
|
8608
8609
|
return false;
|
|
8610
|
+
const value = (0, import_shared2.getArbitraryValue)(_value);
|
|
8609
8611
|
return exclamationRegex.test(value) || importantRegex.test(value);
|
|
8610
8612
|
};
|
|
8611
8613
|
const removeImportantKeyword = (input) => {
|
|
@@ -8853,6 +8855,7 @@ var no_property_renaming_default = rule9;
|
|
|
8853
8855
|
// src/rules/no-unsafe-token-fn-usage.ts
|
|
8854
8856
|
init_cjs_shims();
|
|
8855
8857
|
var import_utils14 = require("@typescript-eslint/utils");
|
|
8858
|
+
var import_shared3 = require("@pandacss/shared");
|
|
8856
8859
|
var RULE_NAME10 = "no-unsafe-token-fn-usage";
|
|
8857
8860
|
var rule10 = createRule({
|
|
8858
8861
|
name: RULE_NAME10,
|
|
@@ -8882,10 +8885,10 @@ var rule10 = createRule({
|
|
|
8882
8885
|
return;
|
|
8883
8886
|
const value = node.arguments[0];
|
|
8884
8887
|
if (isLiteral(value)) {
|
|
8885
|
-
sendReport(node, tokenWrap(value.value?.toString()));
|
|
8888
|
+
sendReport(node, tokenWrap((0, import_shared3.getArbitraryValue)(value.value?.toString() ?? "")));
|
|
8886
8889
|
}
|
|
8887
8890
|
if (isTemplateLiteral(value)) {
|
|
8888
|
-
sendReport(node, tokenWrap(value.quasis[0].value.raw));
|
|
8891
|
+
sendReport(node, tokenWrap((0, import_shared3.getArbitraryValue)(value.quasis[0].value.raw)));
|
|
8889
8892
|
}
|
|
8890
8893
|
};
|
|
8891
8894
|
const isCompositeValue = (input) => {
|
|
@@ -8897,19 +8900,19 @@ var rule10 = createRule({
|
|
|
8897
8900
|
const handleLiteral = (node) => {
|
|
8898
8901
|
if (!isLiteral(node))
|
|
8899
8902
|
return;
|
|
8900
|
-
|
|
8903
|
+
const value = (0, import_shared3.getArbitraryValue)(node.value?.toString() ?? "");
|
|
8904
|
+
if (isCompositeValue(value))
|
|
8901
8905
|
return;
|
|
8902
|
-
sendReport(node);
|
|
8906
|
+
sendReport(node, value);
|
|
8903
8907
|
};
|
|
8904
8908
|
const handleTemplateLiteral = (node) => {
|
|
8905
8909
|
if (!isTemplateLiteral(node))
|
|
8906
8910
|
return;
|
|
8907
8911
|
if (node.expressions.length > 0)
|
|
8908
8912
|
return;
|
|
8909
|
-
sendReport(node, node.quasis[0].value.raw);
|
|
8913
|
+
sendReport(node, (0, import_shared3.getArbitraryValue)(node.quasis[0].value.raw));
|
|
8910
8914
|
};
|
|
8911
|
-
const sendReport = (node,
|
|
8912
|
-
const value = _value ?? node.value?.toString();
|
|
8915
|
+
const sendReport = (node, value) => {
|
|
8913
8916
|
const tkImports = extractTokens(value);
|
|
8914
8917
|
const token = tkImports[0].replace(/^[^.]*\./, "");
|
|
8915
8918
|
return context.report({
|
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.0-dev-
|
|
13
|
+
version = "0.0.0-dev-20240209204008";
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
16
|
|
|
@@ -8614,6 +8614,7 @@ var init_no_hardcoded_color = __esm({
|
|
|
8614
8614
|
});
|
|
8615
8615
|
|
|
8616
8616
|
// src/rules/no-important.ts
|
|
8617
|
+
import { getArbitraryValue as getArbitraryValue2 } from "@pandacss/shared";
|
|
8617
8618
|
var exclamationRegex, importantRegex, RULE_NAME7, rule7, no_important_default;
|
|
8618
8619
|
var init_no_important = __esm({
|
|
8619
8620
|
"src/rules/no-important.ts"() {
|
|
@@ -8642,9 +8643,10 @@ var init_no_important = __esm({
|
|
|
8642
8643
|
defaultOptions: [],
|
|
8643
8644
|
create(context) {
|
|
8644
8645
|
const removeQuotes = ([start, end]) => [start + 1, end - 1];
|
|
8645
|
-
const hasImportantKeyword = (
|
|
8646
|
-
if (!
|
|
8646
|
+
const hasImportantKeyword = (_value) => {
|
|
8647
|
+
if (!_value)
|
|
8647
8648
|
return false;
|
|
8649
|
+
const value = getArbitraryValue2(_value);
|
|
8648
8650
|
return exclamationRegex.test(value) || importantRegex.test(value);
|
|
8649
8651
|
};
|
|
8650
8652
|
const removeImportantKeyword = (input) => {
|
|
@@ -8911,6 +8913,7 @@ var init_no_property_renaming = __esm({
|
|
|
8911
8913
|
|
|
8912
8914
|
// src/rules/no-unsafe-token-fn-usage.ts
|
|
8913
8915
|
import "@typescript-eslint/utils";
|
|
8916
|
+
import { getArbitraryValue as getArbitraryValue3 } from "@pandacss/shared";
|
|
8914
8917
|
var RULE_NAME10, rule10, no_unsafe_token_fn_usage_default;
|
|
8915
8918
|
var init_no_unsafe_token_fn_usage = __esm({
|
|
8916
8919
|
"src/rules/no-unsafe-token-fn-usage.ts"() {
|
|
@@ -8948,10 +8951,10 @@ var init_no_unsafe_token_fn_usage = __esm({
|
|
|
8948
8951
|
return;
|
|
8949
8952
|
const value = node.arguments[0];
|
|
8950
8953
|
if (isLiteral(value)) {
|
|
8951
|
-
sendReport(node, tokenWrap(value.value?.toString()));
|
|
8954
|
+
sendReport(node, tokenWrap(getArbitraryValue3(value.value?.toString() ?? "")));
|
|
8952
8955
|
}
|
|
8953
8956
|
if (isTemplateLiteral(value)) {
|
|
8954
|
-
sendReport(node, tokenWrap(value.quasis[0].value.raw));
|
|
8957
|
+
sendReport(node, tokenWrap(getArbitraryValue3(value.quasis[0].value.raw)));
|
|
8955
8958
|
}
|
|
8956
8959
|
};
|
|
8957
8960
|
const isCompositeValue = (input) => {
|
|
@@ -8963,19 +8966,19 @@ var init_no_unsafe_token_fn_usage = __esm({
|
|
|
8963
8966
|
const handleLiteral = (node) => {
|
|
8964
8967
|
if (!isLiteral(node))
|
|
8965
8968
|
return;
|
|
8966
|
-
|
|
8969
|
+
const value = getArbitraryValue3(node.value?.toString() ?? "");
|
|
8970
|
+
if (isCompositeValue(value))
|
|
8967
8971
|
return;
|
|
8968
|
-
sendReport(node);
|
|
8972
|
+
sendReport(node, value);
|
|
8969
8973
|
};
|
|
8970
8974
|
const handleTemplateLiteral = (node) => {
|
|
8971
8975
|
if (!isTemplateLiteral(node))
|
|
8972
8976
|
return;
|
|
8973
8977
|
if (node.expressions.length > 0)
|
|
8974
8978
|
return;
|
|
8975
|
-
sendReport(node, node.quasis[0].value.raw);
|
|
8979
|
+
sendReport(node, getArbitraryValue3(node.quasis[0].value.raw));
|
|
8976
8980
|
};
|
|
8977
|
-
const sendReport = (node,
|
|
8978
|
-
const value = _value ?? node.value?.toString();
|
|
8981
|
+
const sendReport = (node, value) => {
|
|
8979
8982
|
const tkImports = extractTokens(value);
|
|
8980
8983
|
const token = tkImports[0].replace(/^[^.]*\./, "");
|
|
8981
8984
|
return context.report({
|
package/package.json
CHANGED