@pandacss/eslint-plugin 0.0.6 → 0.0.9
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/{chunk-6BVJTDXV.mjs → chunk-HALLAYDZ.mjs} +2 -2
- package/dist/index.js +51 -36
- package/dist/index.mjs +60 -45
- package/dist/utils/worker.js +254 -120
- package/dist/utils/worker.mjs +256 -122
- package/package.json +5 -5
|
@@ -27,9 +27,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
27
27
|
mod
|
|
28
28
|
));
|
|
29
29
|
|
|
30
|
-
// ../node_modules/.pnpm/tsup@8.0.1_postcss@8.4.
|
|
30
|
+
// ../node_modules/.pnpm/tsup@8.0.1_postcss@8.4.34_typescript@5.3.3/node_modules/tsup/assets/esm_shims.js
|
|
31
31
|
var init_esm_shims = __esm({
|
|
32
|
-
"../node_modules/.pnpm/tsup@8.0.1_postcss@8.4.
|
|
32
|
+
"../node_modules/.pnpm/tsup@8.0.1_postcss@8.4.34_typescript@5.3.3/node_modules/tsup/assets/esm_shims.js"() {
|
|
33
33
|
"use strict";
|
|
34
34
|
}
|
|
35
35
|
});
|
package/dist/index.js
CHANGED
|
@@ -28,10 +28,10 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
mod
|
|
29
29
|
));
|
|
30
30
|
|
|
31
|
-
// ../node_modules/.pnpm/tsup@8.0.1_postcss@8.4.
|
|
31
|
+
// ../node_modules/.pnpm/tsup@8.0.1_postcss@8.4.34_typescript@5.3.3/node_modules/tsup/assets/cjs_shims.js
|
|
32
32
|
var getImportMetaUrl, importMetaUrl;
|
|
33
33
|
var init_cjs_shims = __esm({
|
|
34
|
-
"../node_modules/.pnpm/tsup@8.0.1_postcss@8.4.
|
|
34
|
+
"../node_modules/.pnpm/tsup@8.0.1_postcss@8.4.34_typescript@5.3.3/node_modules/tsup/assets/cjs_shims.js"() {
|
|
35
35
|
"use strict";
|
|
36
36
|
getImportMetaUrl = () => typeof document === "undefined" ? new URL("file:" + __filename).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
|
|
37
37
|
importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
|
|
@@ -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.9";
|
|
7961
7961
|
|
|
7962
7962
|
// src/configs/all.ts
|
|
7963
7963
|
init_cjs_shims();
|
|
@@ -7992,6 +7992,7 @@ var import_utils2 = require("@typescript-eslint/utils");
|
|
|
7992
7992
|
var isIdentifier = (0, import_ast_utils.isNodeOfType)(import_utils2.AST_NODE_TYPES.Identifier);
|
|
7993
7993
|
var isLiteral = (0, import_ast_utils.isNodeOfType)(import_utils2.AST_NODE_TYPES.Literal);
|
|
7994
7994
|
var isTemplateLiteral = (0, import_ast_utils.isNodeOfType)(import_utils2.AST_NODE_TYPES.TemplateLiteral);
|
|
7995
|
+
var isObjectExpression = (0, import_ast_utils.isNodeOfType)(import_utils2.AST_NODE_TYPES.ObjectExpression);
|
|
7995
7996
|
var isMemberExpression = (0, import_ast_utils.isNodeOfType)(import_utils2.AST_NODE_TYPES.MemberExpression);
|
|
7996
7997
|
var isVariableDeclarator = (0, import_ast_utils.isNodeOfType)(import_utils2.AST_NODE_TYPES.VariableDeclarator);
|
|
7997
7998
|
var isVariableDeclaration = (0, import_ast_utils.isNodeOfType)(import_utils2.AST_NODE_TYPES.VariableDeclaration);
|
|
@@ -8099,17 +8100,14 @@ var isLocalStyledFactory = (node, context) => {
|
|
|
8099
8100
|
var isValidFile = (context) => {
|
|
8100
8101
|
return syncAction("isValidFile", getSyncOpts(context));
|
|
8101
8102
|
};
|
|
8102
|
-
var isValidProperty = (name2, context) => {
|
|
8103
|
-
return syncAction("isValidProperty", getSyncOpts(context), name2);
|
|
8103
|
+
var isValidProperty = (name2, context, calleName) => {
|
|
8104
|
+
return syncAction("isValidProperty", getSyncOpts(context), name2, calleName);
|
|
8104
8105
|
};
|
|
8105
8106
|
var isPandaImport = (node, context) => {
|
|
8106
8107
|
const imports = getImports(context);
|
|
8107
8108
|
return imports.some((imp) => imp.mod === node.source.value);
|
|
8108
8109
|
};
|
|
8109
8110
|
var isPandaProp = (node, context) => {
|
|
8110
|
-
const prop = node.name.name;
|
|
8111
|
-
if (typeof prop !== "string" || !isValidProperty(prop, context))
|
|
8112
|
-
return;
|
|
8113
8111
|
const jsxAncestor = getAncestor(isJSXOpeningElement, node);
|
|
8114
8112
|
if (!jsxAncestor)
|
|
8115
8113
|
return;
|
|
@@ -8119,33 +8117,46 @@ var isPandaProp = (node, context) => {
|
|
|
8119
8117
|
return;
|
|
8120
8118
|
if (!isPandaIsh(jsxAncestor.name.name, context) && !isLocalStyledFactory(jsxAncestor, context))
|
|
8121
8119
|
return;
|
|
8120
|
+
const prop = node.name.name;
|
|
8121
|
+
if (typeof prop !== "string" || !isValidProperty(prop, context, jsxAncestor.name.name))
|
|
8122
|
+
return;
|
|
8122
8123
|
return true;
|
|
8123
8124
|
};
|
|
8124
|
-
var
|
|
8125
|
+
var isInPandaFunction = (node, context) => {
|
|
8125
8126
|
const callAncestor = getAncestor(isCallExpression, node);
|
|
8126
|
-
if (!callAncestor)
|
|
8127
|
-
const jsxExprAncestor = getAncestor(isJSXExpressionContainer, node);
|
|
8128
|
-
const jsxAttrAncestor = getAncestor(isJSXAttribute, node);
|
|
8129
|
-
if (!jsxExprAncestor || !jsxAttrAncestor)
|
|
8130
|
-
return;
|
|
8131
|
-
if (!isPandaProp(jsxAttrAncestor, context))
|
|
8132
|
-
return;
|
|
8133
|
-
if (!isValidStyledProp(jsxAttrAncestor.name, context))
|
|
8134
|
-
return;
|
|
8135
|
-
return true;
|
|
8136
|
-
}
|
|
8137
|
-
if (!isIdentifier(node.key))
|
|
8138
|
-
return;
|
|
8139
|
-
const attr = node.key.name;
|
|
8140
|
-
if (!isValidProperty(attr, context))
|
|
8127
|
+
if (!callAncestor)
|
|
8141
8128
|
return;
|
|
8129
|
+
let calleeName;
|
|
8142
8130
|
if (isIdentifier(callAncestor.callee)) {
|
|
8143
|
-
|
|
8131
|
+
calleeName = callAncestor.callee.name;
|
|
8144
8132
|
}
|
|
8145
8133
|
if (isMemberExpression(callAncestor.callee) && isIdentifier(callAncestor.callee.object)) {
|
|
8146
|
-
|
|
8134
|
+
calleeName = callAncestor.callee.object.name;
|
|
8147
8135
|
}
|
|
8148
|
-
|
|
8136
|
+
if (!calleeName)
|
|
8137
|
+
return;
|
|
8138
|
+
if (!isPandaIsh(calleeName, context))
|
|
8139
|
+
return;
|
|
8140
|
+
if (!isIdentifier(node.key))
|
|
8141
|
+
return;
|
|
8142
|
+
const attr = node.key.name;
|
|
8143
|
+
if (!isValidProperty(attr, context, calleeName))
|
|
8144
|
+
return;
|
|
8145
|
+
return true;
|
|
8146
|
+
};
|
|
8147
|
+
var isPandaAttribute = (node, context) => {
|
|
8148
|
+
const callAncestor = getAncestor(isCallExpression, node);
|
|
8149
|
+
if (callAncestor)
|
|
8150
|
+
return isInPandaFunction(node, context);
|
|
8151
|
+
const jsxExprAncestor = getAncestor(isJSXExpressionContainer, node);
|
|
8152
|
+
const jsxAttrAncestor = getAncestor(isJSXAttribute, node);
|
|
8153
|
+
if (!jsxExprAncestor || !jsxAttrAncestor)
|
|
8154
|
+
return;
|
|
8155
|
+
if (!isPandaProp(jsxAttrAncestor, context))
|
|
8156
|
+
return;
|
|
8157
|
+
if (!isValidStyledProp(jsxAttrAncestor.name, context))
|
|
8158
|
+
return;
|
|
8159
|
+
return true;
|
|
8149
8160
|
};
|
|
8150
8161
|
var resolveLonghand = (name2, context) => {
|
|
8151
8162
|
return syncAction("resolveLongHand", getSyncOpts(context), name2);
|
|
@@ -8181,7 +8192,7 @@ var getInvalidTokens = (value, context) => {
|
|
|
8181
8192
|
const tokens = extractTokens(value);
|
|
8182
8193
|
if (!tokens.length)
|
|
8183
8194
|
return [];
|
|
8184
|
-
return syncAction("
|
|
8195
|
+
return syncAction("filterInvalidTokens", getSyncOpts(context), tokens);
|
|
8185
8196
|
};
|
|
8186
8197
|
var getTokenImport = (context) => {
|
|
8187
8198
|
const imports = _getImports(context);
|
|
@@ -8379,6 +8390,8 @@ var rule4 = createRule({
|
|
|
8379
8390
|
return;
|
|
8380
8391
|
if (isJSXExpressionContainer(node.value) && isTemplateLiteral(node.value.expression) && node.value.expression.expressions.length === 0)
|
|
8381
8392
|
return;
|
|
8393
|
+
if (isObjectExpression(node.value))
|
|
8394
|
+
return;
|
|
8382
8395
|
if (!isPandaProp(node, context))
|
|
8383
8396
|
return;
|
|
8384
8397
|
context.report({
|
|
@@ -8393,6 +8406,8 @@ var rule4 = createRule({
|
|
|
8393
8406
|
return;
|
|
8394
8407
|
if (isTemplateLiteral(node.value) && node.value.expressions.length === 0)
|
|
8395
8408
|
return;
|
|
8409
|
+
if (isObjectExpression(node.value))
|
|
8410
|
+
return;
|
|
8396
8411
|
if (!isPandaAttribute(node, context))
|
|
8397
8412
|
return;
|
|
8398
8413
|
context.report({
|
|
@@ -8738,7 +8753,7 @@ var rule8 = createRule({
|
|
|
8738
8753
|
});
|
|
8739
8754
|
var no_property_renaming_default = rule8;
|
|
8740
8755
|
|
|
8741
|
-
// src/rules/
|
|
8756
|
+
// src/rules/prefer-longhand-properties.ts
|
|
8742
8757
|
init_cjs_shims();
|
|
8743
8758
|
var RULE_NAME9 = "no-shorthand-prop";
|
|
8744
8759
|
var rule9 = createRule({
|
|
@@ -8802,7 +8817,7 @@ var rule9 = createRule({
|
|
|
8802
8817
|
};
|
|
8803
8818
|
}
|
|
8804
8819
|
});
|
|
8805
|
-
var
|
|
8820
|
+
var prefer_longhand_properties_default = rule9;
|
|
8806
8821
|
|
|
8807
8822
|
// src/rules/no-unsafe-token-fn-usage.ts
|
|
8808
8823
|
init_cjs_shims();
|
|
@@ -8910,9 +8925,9 @@ var no_unsafe_token_fn_usage_default = rule10;
|
|
|
8910
8925
|
// src/rules/prefer-atomic-properties.ts
|
|
8911
8926
|
init_cjs_shims();
|
|
8912
8927
|
|
|
8913
|
-
// src/utils/
|
|
8928
|
+
// src/utils/composite-properties.ts
|
|
8914
8929
|
init_cjs_shims();
|
|
8915
|
-
var
|
|
8930
|
+
var compositeProperties = {
|
|
8916
8931
|
animation: [
|
|
8917
8932
|
"animationName",
|
|
8918
8933
|
"animationDuration",
|
|
@@ -9041,15 +9056,15 @@ var rule11 = createRule({
|
|
|
9041
9056
|
defaultOptions: [],
|
|
9042
9057
|
create(context) {
|
|
9043
9058
|
const resolveCompositeProperty = (name2) => {
|
|
9044
|
-
if (Object.hasOwn(
|
|
9059
|
+
if (Object.hasOwn(compositeProperties, name2))
|
|
9045
9060
|
return name2;
|
|
9046
9061
|
const longhand = resolveShorthand(name2, context);
|
|
9047
|
-
if (isValidProperty(longhand, context) && Object.hasOwn(
|
|
9062
|
+
if (isValidProperty(longhand, context) && Object.hasOwn(compositeProperties, longhand))
|
|
9048
9063
|
return longhand;
|
|
9049
9064
|
};
|
|
9050
9065
|
const sendReport = (node, name2) => {
|
|
9051
9066
|
const cpd = resolveCompositeProperty(name2);
|
|
9052
|
-
const atomics =
|
|
9067
|
+
const atomics = compositeProperties[cpd].map((name3) => `\`${name3}\``).join(",\n");
|
|
9053
9068
|
return context.report({
|
|
9054
9069
|
node,
|
|
9055
9070
|
messageId: "atomic",
|
|
@@ -9095,7 +9110,7 @@ var rules = {
|
|
|
9095
9110
|
[RULE_NAME6]: no_hardcoded_color_default,
|
|
9096
9111
|
[RULE_NAME7]: no_invalid_token_paths_default,
|
|
9097
9112
|
[RULE_NAME8]: no_property_renaming_default,
|
|
9098
|
-
[RULE_NAME9]:
|
|
9113
|
+
[RULE_NAME9]: prefer_longhand_properties_default,
|
|
9099
9114
|
[RULE_NAME10]: no_unsafe_token_fn_usage_default,
|
|
9100
9115
|
[RULE_NAME11]: prefer_atomic_properties_default
|
|
9101
9116
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -3,14 +3,14 @@ import {
|
|
|
3
3
|
__esm,
|
|
4
4
|
__toESM,
|
|
5
5
|
init_esm_shims
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-HALLAYDZ.mjs";
|
|
7
7
|
|
|
8
8
|
// package.json
|
|
9
9
|
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.9";
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
16
|
|
|
@@ -7950,7 +7950,7 @@ var require_dist3 = __commonJS({
|
|
|
7950
7950
|
// src/utils/nodes.ts
|
|
7951
7951
|
import { isNodeOfType } from "@typescript-eslint/utils/ast-utils";
|
|
7952
7952
|
import { AST_NODE_TYPES } from "@typescript-eslint/utils";
|
|
7953
|
-
var isIdentifier, isLiteral, isTemplateLiteral, isMemberExpression, isVariableDeclarator, isVariableDeclaration, isJSXMemberExpression, isJSXOpeningElement, isJSXExpressionContainer, isJSXAttribute, isJSXIdentifier, isCallExpression, isImportDeclaration, isImportSpecifier;
|
|
7953
|
+
var isIdentifier, isLiteral, isTemplateLiteral, isObjectExpression, isMemberExpression, isVariableDeclarator, isVariableDeclaration, isJSXMemberExpression, isJSXOpeningElement, isJSXExpressionContainer, isJSXAttribute, isJSXIdentifier, isCallExpression, isImportDeclaration, isImportSpecifier;
|
|
7954
7954
|
var init_nodes = __esm({
|
|
7955
7955
|
"src/utils/nodes.ts"() {
|
|
7956
7956
|
"use strict";
|
|
@@ -7958,6 +7958,7 @@ var init_nodes = __esm({
|
|
|
7958
7958
|
isIdentifier = isNodeOfType(AST_NODE_TYPES.Identifier);
|
|
7959
7959
|
isLiteral = isNodeOfType(AST_NODE_TYPES.Literal);
|
|
7960
7960
|
isTemplateLiteral = isNodeOfType(AST_NODE_TYPES.TemplateLiteral);
|
|
7961
|
+
isObjectExpression = isNodeOfType(AST_NODE_TYPES.ObjectExpression);
|
|
7961
7962
|
isMemberExpression = isNodeOfType(AST_NODE_TYPES.MemberExpression);
|
|
7962
7963
|
isVariableDeclarator = isNodeOfType(AST_NODE_TYPES.VariableDeclarator);
|
|
7963
7964
|
isVariableDeclaration = isNodeOfType(AST_NODE_TYPES.VariableDeclaration);
|
|
@@ -7973,7 +7974,7 @@ var init_nodes = __esm({
|
|
|
7973
7974
|
});
|
|
7974
7975
|
|
|
7975
7976
|
// src/utils/helpers.ts
|
|
7976
|
-
var import_scope_manager, getAncestor, getSyncOpts, getImportSpecifiers, _getImports, getImports, isValidStyledProp, isPandaIsh, findDeclaration, isLocalStyledFactory, isValidFile, isValidProperty, isPandaImport, isPandaProp, isPandaAttribute, resolveLonghand, resolveShorthand, isColorAttribute, isColorToken, extractTokens, getInvalidTokens, getTokenImport;
|
|
7977
|
+
var import_scope_manager, getAncestor, getSyncOpts, getImportSpecifiers, _getImports, getImports, isValidStyledProp, isPandaIsh, findDeclaration, isLocalStyledFactory, isValidFile, isValidProperty, isPandaImport, isPandaProp, isInPandaFunction, isPandaAttribute, resolveLonghand, resolveShorthand, isColorAttribute, isColorToken, extractTokens, getInvalidTokens, getTokenImport;
|
|
7977
7978
|
var init_helpers = __esm({
|
|
7978
7979
|
"src/utils/helpers.ts"() {
|
|
7979
7980
|
"use strict";
|
|
@@ -8075,17 +8076,14 @@ var init_helpers = __esm({
|
|
|
8075
8076
|
isValidFile = (context) => {
|
|
8076
8077
|
return syncAction("isValidFile", getSyncOpts(context));
|
|
8077
8078
|
};
|
|
8078
|
-
isValidProperty = (name2, context) => {
|
|
8079
|
-
return syncAction("isValidProperty", getSyncOpts(context), name2);
|
|
8079
|
+
isValidProperty = (name2, context, calleName) => {
|
|
8080
|
+
return syncAction("isValidProperty", getSyncOpts(context), name2, calleName);
|
|
8080
8081
|
};
|
|
8081
8082
|
isPandaImport = (node, context) => {
|
|
8082
8083
|
const imports = getImports(context);
|
|
8083
8084
|
return imports.some((imp) => imp.mod === node.source.value);
|
|
8084
8085
|
};
|
|
8085
8086
|
isPandaProp = (node, context) => {
|
|
8086
|
-
const prop = node.name.name;
|
|
8087
|
-
if (typeof prop !== "string" || !isValidProperty(prop, context))
|
|
8088
|
-
return;
|
|
8089
8087
|
const jsxAncestor = getAncestor(isJSXOpeningElement, node);
|
|
8090
8088
|
if (!jsxAncestor)
|
|
8091
8089
|
return;
|
|
@@ -8095,33 +8093,46 @@ var init_helpers = __esm({
|
|
|
8095
8093
|
return;
|
|
8096
8094
|
if (!isPandaIsh(jsxAncestor.name.name, context) && !isLocalStyledFactory(jsxAncestor, context))
|
|
8097
8095
|
return;
|
|
8096
|
+
const prop = node.name.name;
|
|
8097
|
+
if (typeof prop !== "string" || !isValidProperty(prop, context, jsxAncestor.name.name))
|
|
8098
|
+
return;
|
|
8098
8099
|
return true;
|
|
8099
8100
|
};
|
|
8100
|
-
|
|
8101
|
+
isInPandaFunction = (node, context) => {
|
|
8101
8102
|
const callAncestor = getAncestor(isCallExpression, node);
|
|
8102
|
-
if (!callAncestor)
|
|
8103
|
-
const jsxExprAncestor = getAncestor(isJSXExpressionContainer, node);
|
|
8104
|
-
const jsxAttrAncestor = getAncestor(isJSXAttribute, node);
|
|
8105
|
-
if (!jsxExprAncestor || !jsxAttrAncestor)
|
|
8106
|
-
return;
|
|
8107
|
-
if (!isPandaProp(jsxAttrAncestor, context))
|
|
8108
|
-
return;
|
|
8109
|
-
if (!isValidStyledProp(jsxAttrAncestor.name, context))
|
|
8110
|
-
return;
|
|
8111
|
-
return true;
|
|
8112
|
-
}
|
|
8113
|
-
if (!isIdentifier(node.key))
|
|
8114
|
-
return;
|
|
8115
|
-
const attr = node.key.name;
|
|
8116
|
-
if (!isValidProperty(attr, context))
|
|
8103
|
+
if (!callAncestor)
|
|
8117
8104
|
return;
|
|
8105
|
+
let calleeName;
|
|
8118
8106
|
if (isIdentifier(callAncestor.callee)) {
|
|
8119
|
-
|
|
8107
|
+
calleeName = callAncestor.callee.name;
|
|
8120
8108
|
}
|
|
8121
8109
|
if (isMemberExpression(callAncestor.callee) && isIdentifier(callAncestor.callee.object)) {
|
|
8122
|
-
|
|
8110
|
+
calleeName = callAncestor.callee.object.name;
|
|
8123
8111
|
}
|
|
8124
|
-
|
|
8112
|
+
if (!calleeName)
|
|
8113
|
+
return;
|
|
8114
|
+
if (!isPandaIsh(calleeName, context))
|
|
8115
|
+
return;
|
|
8116
|
+
if (!isIdentifier(node.key))
|
|
8117
|
+
return;
|
|
8118
|
+
const attr = node.key.name;
|
|
8119
|
+
if (!isValidProperty(attr, context, calleeName))
|
|
8120
|
+
return;
|
|
8121
|
+
return true;
|
|
8122
|
+
};
|
|
8123
|
+
isPandaAttribute = (node, context) => {
|
|
8124
|
+
const callAncestor = getAncestor(isCallExpression, node);
|
|
8125
|
+
if (callAncestor)
|
|
8126
|
+
return isInPandaFunction(node, context);
|
|
8127
|
+
const jsxExprAncestor = getAncestor(isJSXExpressionContainer, node);
|
|
8128
|
+
const jsxAttrAncestor = getAncestor(isJSXAttribute, node);
|
|
8129
|
+
if (!jsxExprAncestor || !jsxAttrAncestor)
|
|
8130
|
+
return;
|
|
8131
|
+
if (!isPandaProp(jsxAttrAncestor, context))
|
|
8132
|
+
return;
|
|
8133
|
+
if (!isValidStyledProp(jsxAttrAncestor.name, context))
|
|
8134
|
+
return;
|
|
8135
|
+
return true;
|
|
8125
8136
|
};
|
|
8126
8137
|
resolveLonghand = (name2, context) => {
|
|
8127
8138
|
return syncAction("resolveLongHand", getSyncOpts(context), name2);
|
|
@@ -8157,7 +8168,7 @@ var init_helpers = __esm({
|
|
|
8157
8168
|
const tokens = extractTokens(value);
|
|
8158
8169
|
if (!tokens.length)
|
|
8159
8170
|
return [];
|
|
8160
|
-
return syncAction("
|
|
8171
|
+
return syncAction("filterInvalidTokens", getSyncOpts(context), tokens);
|
|
8161
8172
|
};
|
|
8162
8173
|
getTokenImport = (context) => {
|
|
8163
8174
|
const imports = _getImports(context);
|
|
@@ -8391,6 +8402,8 @@ var init_no_dynamic_styling = __esm({
|
|
|
8391
8402
|
return;
|
|
8392
8403
|
if (isJSXExpressionContainer(node.value) && isTemplateLiteral(node.value.expression) && node.value.expression.expressions.length === 0)
|
|
8393
8404
|
return;
|
|
8405
|
+
if (isObjectExpression(node.value))
|
|
8406
|
+
return;
|
|
8394
8407
|
if (!isPandaProp(node, context))
|
|
8395
8408
|
return;
|
|
8396
8409
|
context.report({
|
|
@@ -8405,6 +8418,8 @@ var init_no_dynamic_styling = __esm({
|
|
|
8405
8418
|
return;
|
|
8406
8419
|
if (isTemplateLiteral(node.value) && node.value.expressions.length === 0)
|
|
8407
8420
|
return;
|
|
8421
|
+
if (isObjectExpression(node.value))
|
|
8422
|
+
return;
|
|
8408
8423
|
if (!isPandaAttribute(node, context))
|
|
8409
8424
|
return;
|
|
8410
8425
|
context.report({
|
|
@@ -8788,10 +8803,10 @@ var init_no_property_renaming = __esm({
|
|
|
8788
8803
|
}
|
|
8789
8804
|
});
|
|
8790
8805
|
|
|
8791
|
-
// src/rules/
|
|
8792
|
-
var RULE_NAME9, rule9,
|
|
8793
|
-
var
|
|
8794
|
-
"src/rules/
|
|
8806
|
+
// src/rules/prefer-longhand-properties.ts
|
|
8807
|
+
var RULE_NAME9, rule9, prefer_longhand_properties_default;
|
|
8808
|
+
var init_prefer_longhand_properties = __esm({
|
|
8809
|
+
"src/rules/prefer-longhand-properties.ts"() {
|
|
8795
8810
|
"use strict";
|
|
8796
8811
|
init_esm_shims();
|
|
8797
8812
|
init_helpers();
|
|
@@ -8859,7 +8874,7 @@ var init_no_shorthand_prop = __esm({
|
|
|
8859
8874
|
};
|
|
8860
8875
|
}
|
|
8861
8876
|
});
|
|
8862
|
-
|
|
8877
|
+
prefer_longhand_properties_default = rule9;
|
|
8863
8878
|
}
|
|
8864
8879
|
});
|
|
8865
8880
|
|
|
@@ -8975,13 +8990,13 @@ var init_no_unsafe_token_fn_usage = __esm({
|
|
|
8975
8990
|
}
|
|
8976
8991
|
});
|
|
8977
8992
|
|
|
8978
|
-
// src/utils/
|
|
8979
|
-
var
|
|
8980
|
-
var
|
|
8981
|
-
"src/utils/
|
|
8993
|
+
// src/utils/composite-properties.ts
|
|
8994
|
+
var compositeProperties;
|
|
8995
|
+
var init_composite_properties = __esm({
|
|
8996
|
+
"src/utils/composite-properties.ts"() {
|
|
8982
8997
|
"use strict";
|
|
8983
8998
|
init_esm_shims();
|
|
8984
|
-
|
|
8999
|
+
compositeProperties = {
|
|
8985
9000
|
animation: [
|
|
8986
9001
|
"animationName",
|
|
8987
9002
|
"animationDuration",
|
|
@@ -9103,7 +9118,7 @@ var init_prefer_atomic_properties = __esm({
|
|
|
9103
9118
|
init_esm_shims();
|
|
9104
9119
|
init_helpers();
|
|
9105
9120
|
init_utils();
|
|
9106
|
-
|
|
9121
|
+
init_composite_properties();
|
|
9107
9122
|
init_nodes();
|
|
9108
9123
|
RULE_NAME11 = "prefer-atomic-properties";
|
|
9109
9124
|
rule11 = createRule({
|
|
@@ -9121,15 +9136,15 @@ var init_prefer_atomic_properties = __esm({
|
|
|
9121
9136
|
defaultOptions: [],
|
|
9122
9137
|
create(context) {
|
|
9123
9138
|
const resolveCompositeProperty = (name2) => {
|
|
9124
|
-
if (Object.hasOwn(
|
|
9139
|
+
if (Object.hasOwn(compositeProperties, name2))
|
|
9125
9140
|
return name2;
|
|
9126
9141
|
const longhand = resolveShorthand(name2, context);
|
|
9127
|
-
if (isValidProperty(longhand, context) && Object.hasOwn(
|
|
9142
|
+
if (isValidProperty(longhand, context) && Object.hasOwn(compositeProperties, longhand))
|
|
9128
9143
|
return longhand;
|
|
9129
9144
|
};
|
|
9130
9145
|
const sendReport = (node, name2) => {
|
|
9131
9146
|
const cpd = resolveCompositeProperty(name2);
|
|
9132
|
-
const atomics =
|
|
9147
|
+
const atomics = compositeProperties[cpd].map((name3) => `\`${name3}\``).join(",\n");
|
|
9133
9148
|
return context.report({
|
|
9134
9149
|
node,
|
|
9135
9150
|
messageId: "atomic",
|
|
@@ -9181,7 +9196,7 @@ var init_rules = __esm({
|
|
|
9181
9196
|
init_no_hardcoded_color();
|
|
9182
9197
|
init_no_invalid_token_paths();
|
|
9183
9198
|
init_no_property_renaming();
|
|
9184
|
-
|
|
9199
|
+
init_prefer_longhand_properties();
|
|
9185
9200
|
init_no_unsafe_token_fn_usage();
|
|
9186
9201
|
init_prefer_atomic_properties();
|
|
9187
9202
|
rules = {
|
|
@@ -9193,7 +9208,7 @@ var init_rules = __esm({
|
|
|
9193
9208
|
[RULE_NAME6]: no_hardcoded_color_default,
|
|
9194
9209
|
[RULE_NAME7]: no_invalid_token_paths_default,
|
|
9195
9210
|
[RULE_NAME8]: no_property_renaming_default,
|
|
9196
|
-
[RULE_NAME9]:
|
|
9211
|
+
[RULE_NAME9]: prefer_longhand_properties_default,
|
|
9197
9212
|
[RULE_NAME10]: no_unsafe_token_fn_usage_default,
|
|
9198
9213
|
[RULE_NAME11]: prefer_atomic_properties_default
|
|
9199
9214
|
};
|