@pandacss/eslint-plugin 0.0.15 → 0.0.17
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 +139 -111
- package/dist/index.mjs +156 -118
- 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.17";
|
|
7961
7961
|
|
|
7962
7962
|
// src/configs/all.ts
|
|
7963
7963
|
init_cjs_shims();
|
|
@@ -8839,6 +8839,52 @@ var rule9 = createRule({
|
|
|
8839
8839
|
});
|
|
8840
8840
|
var no_invalid_token_paths_default = rule9;
|
|
8841
8841
|
|
|
8842
|
+
// src/rules/no-margin-properties.ts
|
|
8843
|
+
init_cjs_shims();
|
|
8844
|
+
var RULE_NAME10 = "no-margin-properties";
|
|
8845
|
+
var rule10 = createRule({
|
|
8846
|
+
name: RULE_NAME10,
|
|
8847
|
+
meta: {
|
|
8848
|
+
docs: {
|
|
8849
|
+
description: "Discourage using margin properties for spacing; prefer defining spacing in parent elements with `flex` or `grid` using the `gap` property for a more resilient layout. Margins make components less reusable in other contexts."
|
|
8850
|
+
},
|
|
8851
|
+
messages: {
|
|
8852
|
+
noMargin: "Use flex or grid with the `gap` property to define spacing in parent elements for a more resilient layout."
|
|
8853
|
+
},
|
|
8854
|
+
type: "suggestion",
|
|
8855
|
+
schema: []
|
|
8856
|
+
},
|
|
8857
|
+
defaultOptions: [],
|
|
8858
|
+
create(context) {
|
|
8859
|
+
const getLonghand = (name2) => resolveLonghand(name2, context) ?? name2;
|
|
8860
|
+
const sendReport = (node) => {
|
|
8861
|
+
if (!getLonghand(node.name).toLowerCase().includes("margin"))
|
|
8862
|
+
return;
|
|
8863
|
+
return context.report({
|
|
8864
|
+
node,
|
|
8865
|
+
messageId: "noMargin"
|
|
8866
|
+
});
|
|
8867
|
+
};
|
|
8868
|
+
return {
|
|
8869
|
+
JSXAttribute(node) {
|
|
8870
|
+
if (!isJSXIdentifier(node.name))
|
|
8871
|
+
return;
|
|
8872
|
+
if (!isPandaProp(node, context))
|
|
8873
|
+
return;
|
|
8874
|
+
sendReport(node.name);
|
|
8875
|
+
},
|
|
8876
|
+
Property(node) {
|
|
8877
|
+
if (!isIdentifier(node.key))
|
|
8878
|
+
return;
|
|
8879
|
+
if (!isPandaAttribute(node, context))
|
|
8880
|
+
return;
|
|
8881
|
+
sendReport(node.key);
|
|
8882
|
+
}
|
|
8883
|
+
};
|
|
8884
|
+
}
|
|
8885
|
+
});
|
|
8886
|
+
var no_margin_properties_default = rule10;
|
|
8887
|
+
|
|
8842
8888
|
// src/rules/no-physical-properties.ts
|
|
8843
8889
|
init_cjs_shims();
|
|
8844
8890
|
|
|
@@ -8880,9 +8926,9 @@ var physicalProperties = {
|
|
|
8880
8926
|
};
|
|
8881
8927
|
|
|
8882
8928
|
// src/rules/no-physical-properties.ts
|
|
8883
|
-
var
|
|
8884
|
-
var
|
|
8885
|
-
name:
|
|
8929
|
+
var RULE_NAME11 = "no-physical-properties";
|
|
8930
|
+
var rule11 = createRule({
|
|
8931
|
+
name: RULE_NAME11,
|
|
8886
8932
|
meta: {
|
|
8887
8933
|
docs: {
|
|
8888
8934
|
description: "Encourage the use of [logical properties](https://mdn.io/logical-properties-basic-concepts) over physical proeprties, to foster a responsive and adaptable user interface."
|
|
@@ -8898,21 +8944,23 @@ var rule10 = createRule({
|
|
|
8898
8944
|
defaultOptions: [],
|
|
8899
8945
|
create(context) {
|
|
8900
8946
|
const getLonghand = (name2) => resolveLonghand(name2, context) ?? name2;
|
|
8901
|
-
const sendReport = (node
|
|
8902
|
-
|
|
8903
|
-
|
|
8947
|
+
const sendReport = (node) => {
|
|
8948
|
+
if (!(getLonghand(node.name) in physicalProperties))
|
|
8949
|
+
return;
|
|
8950
|
+
const logical = physicalProperties[getLonghand(node.name)];
|
|
8951
|
+
const longhand = resolveLonghand(node.name, context);
|
|
8904
8952
|
return context.report({
|
|
8905
8953
|
node,
|
|
8906
8954
|
messageId: "physical",
|
|
8907
8955
|
data: {
|
|
8908
|
-
physical: `\`${
|
|
8956
|
+
physical: `\`${node.name}\`${longhand ? ` - \`${longhand}\`` : ""}`,
|
|
8909
8957
|
logical
|
|
8910
8958
|
},
|
|
8911
8959
|
suggest: [
|
|
8912
8960
|
{
|
|
8913
8961
|
messageId: "replace",
|
|
8914
8962
|
data: {
|
|
8915
|
-
physical:
|
|
8963
|
+
physical: node.name,
|
|
8916
8964
|
logical
|
|
8917
8965
|
},
|
|
8918
8966
|
fix: (fixer) => {
|
|
@@ -8928,29 +8976,25 @@ var rule10 = createRule({
|
|
|
8928
8976
|
return;
|
|
8929
8977
|
if (!isPandaProp(node, context))
|
|
8930
8978
|
return;
|
|
8931
|
-
|
|
8932
|
-
sendReport(node.name, node.name.name);
|
|
8933
|
-
}
|
|
8979
|
+
sendReport(node.name);
|
|
8934
8980
|
},
|
|
8935
8981
|
Property(node) {
|
|
8936
8982
|
if (!isIdentifier(node.key))
|
|
8937
8983
|
return;
|
|
8938
8984
|
if (!isPandaAttribute(node, context))
|
|
8939
8985
|
return;
|
|
8940
|
-
|
|
8941
|
-
sendReport(node.key, node.key.name);
|
|
8942
|
-
}
|
|
8986
|
+
sendReport(node.key);
|
|
8943
8987
|
}
|
|
8944
8988
|
};
|
|
8945
8989
|
}
|
|
8946
8990
|
});
|
|
8947
|
-
var no_physical_properties_default =
|
|
8991
|
+
var no_physical_properties_default = rule11;
|
|
8948
8992
|
|
|
8949
8993
|
// src/rules/no-property-renaming.ts
|
|
8950
8994
|
init_cjs_shims();
|
|
8951
|
-
var
|
|
8952
|
-
var
|
|
8953
|
-
name:
|
|
8995
|
+
var RULE_NAME12 = "no-property-renaming";
|
|
8996
|
+
var rule12 = createRule({
|
|
8997
|
+
name: RULE_NAME12,
|
|
8954
8998
|
meta: {
|
|
8955
8999
|
docs: {
|
|
8956
9000
|
description: "Ensure user does not rename a property for a pattern or style prop. \nIt doesn't get tracked."
|
|
@@ -8973,6 +9017,14 @@ var rule11 = createRule({
|
|
|
8973
9017
|
}
|
|
8974
9018
|
});
|
|
8975
9019
|
};
|
|
9020
|
+
const handleReport = (node, value, attr) => {
|
|
9021
|
+
if (isIdentifier(value) && attr !== value.name) {
|
|
9022
|
+
return sendReport(node, attr, value.name);
|
|
9023
|
+
}
|
|
9024
|
+
if (isMemberExpression(value) && isIdentifier(value.property) && attr !== value.property.name) {
|
|
9025
|
+
return sendReport(node, attr, value.property.name);
|
|
9026
|
+
}
|
|
9027
|
+
};
|
|
8976
9028
|
return {
|
|
8977
9029
|
JSXAttribute(node) {
|
|
8978
9030
|
if (!node.value)
|
|
@@ -8983,12 +9035,7 @@ var rule11 = createRule({
|
|
|
8983
9035
|
return;
|
|
8984
9036
|
const attr = node.name.name.toString();
|
|
8985
9037
|
const expression = node.value.expression;
|
|
8986
|
-
|
|
8987
|
-
return sendReport(node, attr, expression.name);
|
|
8988
|
-
}
|
|
8989
|
-
if (isMemberExpression(expression) && isIdentifier(expression.property) && attr !== expression.property.name) {
|
|
8990
|
-
return sendReport(node, attr, expression.property.name);
|
|
8991
|
-
}
|
|
9038
|
+
handleReport(node, expression, attr);
|
|
8992
9039
|
},
|
|
8993
9040
|
Property(node) {
|
|
8994
9041
|
if (!isIdentifier(node.key))
|
|
@@ -8999,25 +9046,20 @@ var rule11 = createRule({
|
|
|
8999
9046
|
return;
|
|
9000
9047
|
const attr = node.key.name.toString();
|
|
9001
9048
|
const value = node.value;
|
|
9002
|
-
|
|
9003
|
-
return sendReport(node, attr, value.name);
|
|
9004
|
-
}
|
|
9005
|
-
if (isMemberExpression(value) && isIdentifier(value.property) && attr !== value.property.name) {
|
|
9006
|
-
return sendReport(node, attr, value.property.name);
|
|
9007
|
-
}
|
|
9049
|
+
handleReport(node, value, attr);
|
|
9008
9050
|
}
|
|
9009
9051
|
};
|
|
9010
9052
|
}
|
|
9011
9053
|
});
|
|
9012
|
-
var no_property_renaming_default =
|
|
9054
|
+
var no_property_renaming_default = rule12;
|
|
9013
9055
|
|
|
9014
9056
|
// src/rules/no-unsafe-token-fn-usage.ts
|
|
9015
9057
|
init_cjs_shims();
|
|
9016
|
-
var
|
|
9058
|
+
var import_utils17 = require("@typescript-eslint/utils");
|
|
9017
9059
|
var import_shared3 = require("@pandacss/shared");
|
|
9018
|
-
var
|
|
9019
|
-
var
|
|
9020
|
-
name:
|
|
9060
|
+
var RULE_NAME13 = "no-unsafe-token-fn-usage";
|
|
9061
|
+
var rule13 = createRule({
|
|
9062
|
+
name: RULE_NAME13,
|
|
9021
9063
|
meta: {
|
|
9022
9064
|
docs: {
|
|
9023
9065
|
description: "Prevent users from using the token function in situations where they could simply use the raw design token."
|
|
@@ -9113,13 +9155,13 @@ var rule12 = createRule({
|
|
|
9113
9155
|
};
|
|
9114
9156
|
}
|
|
9115
9157
|
});
|
|
9116
|
-
var no_unsafe_token_fn_usage_default =
|
|
9158
|
+
var no_unsafe_token_fn_usage_default = rule13;
|
|
9117
9159
|
|
|
9118
9160
|
// src/rules/prefer-longhand-properties.ts
|
|
9119
9161
|
init_cjs_shims();
|
|
9120
|
-
var
|
|
9121
|
-
var
|
|
9122
|
-
name:
|
|
9162
|
+
var RULE_NAME14 = "prefer-longhand-properties";
|
|
9163
|
+
var rule14 = createRule({
|
|
9164
|
+
name: RULE_NAME14,
|
|
9123
9165
|
meta: {
|
|
9124
9166
|
docs: {
|
|
9125
9167
|
description: "Discourage the use of shorthand properties and promote the preference for longhand properties in the codebase."
|
|
@@ -9134,10 +9176,12 @@ var rule13 = createRule({
|
|
|
9134
9176
|
},
|
|
9135
9177
|
defaultOptions: [],
|
|
9136
9178
|
create(context) {
|
|
9137
|
-
const sendReport = (node
|
|
9138
|
-
const longhand = resolveLonghand(
|
|
9179
|
+
const sendReport = (node) => {
|
|
9180
|
+
const longhand = resolveLonghand(node.name, context);
|
|
9181
|
+
if (!longhand)
|
|
9182
|
+
return;
|
|
9139
9183
|
const data = {
|
|
9140
|
-
shorthand:
|
|
9184
|
+
shorthand: node.name,
|
|
9141
9185
|
longhand
|
|
9142
9186
|
};
|
|
9143
9187
|
return context.report({
|
|
@@ -9161,31 +9205,25 @@ var rule13 = createRule({
|
|
|
9161
9205
|
return;
|
|
9162
9206
|
if (!isPandaProp(node, context))
|
|
9163
9207
|
return;
|
|
9164
|
-
|
|
9165
|
-
if (!longhand)
|
|
9166
|
-
return;
|
|
9167
|
-
sendReport(node.name, node.name.name);
|
|
9208
|
+
sendReport(node.name);
|
|
9168
9209
|
},
|
|
9169
9210
|
Property(node) {
|
|
9170
9211
|
if (!isIdentifier(node.key))
|
|
9171
9212
|
return;
|
|
9172
9213
|
if (!isPandaAttribute(node, context))
|
|
9173
9214
|
return;
|
|
9174
|
-
|
|
9175
|
-
if (!longhand)
|
|
9176
|
-
return;
|
|
9177
|
-
sendReport(node.key, node.key.name);
|
|
9215
|
+
sendReport(node.key);
|
|
9178
9216
|
}
|
|
9179
9217
|
};
|
|
9180
9218
|
}
|
|
9181
9219
|
});
|
|
9182
|
-
var prefer_longhand_properties_default =
|
|
9220
|
+
var prefer_longhand_properties_default = rule14;
|
|
9183
9221
|
|
|
9184
9222
|
// src/rules/prefer-shorthand-properties.ts
|
|
9185
9223
|
init_cjs_shims();
|
|
9186
|
-
var
|
|
9187
|
-
var
|
|
9188
|
-
name:
|
|
9224
|
+
var RULE_NAME15 = "prefer-shorthand-properties";
|
|
9225
|
+
var rule15 = createRule({
|
|
9226
|
+
name: RULE_NAME15,
|
|
9189
9227
|
meta: {
|
|
9190
9228
|
docs: {
|
|
9191
9229
|
description: "Discourage the use of longhand properties and promote the preference for shorthand properties in the codebase."
|
|
@@ -9200,13 +9238,16 @@ var rule14 = createRule({
|
|
|
9200
9238
|
},
|
|
9201
9239
|
defaultOptions: [],
|
|
9202
9240
|
create(context) {
|
|
9203
|
-
const sendReport = (node
|
|
9204
|
-
const
|
|
9241
|
+
const sendReport = (node) => {
|
|
9242
|
+
const longhand = resolveLonghand(node.name, context);
|
|
9243
|
+
if (longhand)
|
|
9244
|
+
return;
|
|
9245
|
+
const shorthands = resolveShorthands(node.name, context);
|
|
9205
9246
|
if (!shorthands)
|
|
9206
9247
|
return;
|
|
9207
9248
|
const shorthand = shorthands.map((s) => `\`${s}\``)?.join(", ");
|
|
9208
9249
|
const data = {
|
|
9209
|
-
longhand:
|
|
9250
|
+
longhand: node.name,
|
|
9210
9251
|
shorthand
|
|
9211
9252
|
};
|
|
9212
9253
|
return context.report({
|
|
@@ -9230,25 +9271,19 @@ var rule14 = createRule({
|
|
|
9230
9271
|
return;
|
|
9231
9272
|
if (!isPandaProp(node, context))
|
|
9232
9273
|
return;
|
|
9233
|
-
|
|
9234
|
-
if (longhand)
|
|
9235
|
-
return;
|
|
9236
|
-
sendReport(node.name, node.name.name);
|
|
9274
|
+
sendReport(node.name);
|
|
9237
9275
|
},
|
|
9238
9276
|
Property(node) {
|
|
9239
9277
|
if (!isIdentifier(node.key))
|
|
9240
9278
|
return;
|
|
9241
9279
|
if (!isPandaAttribute(node, context))
|
|
9242
9280
|
return;
|
|
9243
|
-
|
|
9244
|
-
if (longhand)
|
|
9245
|
-
return;
|
|
9246
|
-
sendReport(node.key, node.key.name);
|
|
9281
|
+
sendReport(node.key);
|
|
9247
9282
|
}
|
|
9248
9283
|
};
|
|
9249
9284
|
}
|
|
9250
9285
|
});
|
|
9251
|
-
var prefer_shorthand_properties_default =
|
|
9286
|
+
var prefer_shorthand_properties_default = rule15;
|
|
9252
9287
|
|
|
9253
9288
|
// src/rules/prefer-atomic-properties.ts
|
|
9254
9289
|
init_cjs_shims();
|
|
@@ -9368,9 +9403,9 @@ var compositeProperties = {
|
|
|
9368
9403
|
};
|
|
9369
9404
|
|
|
9370
9405
|
// src/rules/prefer-atomic-properties.ts
|
|
9371
|
-
var
|
|
9372
|
-
var
|
|
9373
|
-
name:
|
|
9406
|
+
var RULE_NAME16 = "prefer-atomic-properties";
|
|
9407
|
+
var rule16 = createRule({
|
|
9408
|
+
name: RULE_NAME16,
|
|
9374
9409
|
meta: {
|
|
9375
9410
|
docs: {
|
|
9376
9411
|
description: "Encourage the use of atomic properties instead of composite properties in the codebase."
|
|
@@ -9390,14 +9425,16 @@ var rule15 = createRule({
|
|
|
9390
9425
|
if (isValidProperty(longhand, context) && Object.hasOwn(compositeProperties, longhand))
|
|
9391
9426
|
return longhand;
|
|
9392
9427
|
};
|
|
9393
|
-
const sendReport = (node
|
|
9394
|
-
const cmp = resolveCompositeProperty(
|
|
9395
|
-
|
|
9428
|
+
const sendReport = (node) => {
|
|
9429
|
+
const cmp = resolveCompositeProperty(node.name);
|
|
9430
|
+
if (!cmp)
|
|
9431
|
+
return;
|
|
9432
|
+
const atomics = compositeProperties[cmp].map((name2) => `\`${name2}\``).join(",\n");
|
|
9396
9433
|
return context.report({
|
|
9397
9434
|
node,
|
|
9398
9435
|
messageId: "atomic",
|
|
9399
9436
|
data: {
|
|
9400
|
-
composite:
|
|
9437
|
+
composite: node.name,
|
|
9401
9438
|
atomics
|
|
9402
9439
|
}
|
|
9403
9440
|
});
|
|
@@ -9408,31 +9445,25 @@ var rule15 = createRule({
|
|
|
9408
9445
|
return;
|
|
9409
9446
|
if (!isPandaProp(node, context))
|
|
9410
9447
|
return;
|
|
9411
|
-
|
|
9412
|
-
if (!cmp)
|
|
9413
|
-
return;
|
|
9414
|
-
sendReport(node, node.name.name);
|
|
9448
|
+
sendReport(node.name);
|
|
9415
9449
|
},
|
|
9416
9450
|
Property(node) {
|
|
9417
9451
|
if (!isIdentifier(node.key))
|
|
9418
9452
|
return;
|
|
9419
9453
|
if (!isPandaAttribute(node, context))
|
|
9420
9454
|
return;
|
|
9421
|
-
|
|
9422
|
-
if (!cmp)
|
|
9423
|
-
return;
|
|
9424
|
-
sendReport(node.key, node.key.name);
|
|
9455
|
+
sendReport(node.key);
|
|
9425
9456
|
}
|
|
9426
9457
|
};
|
|
9427
9458
|
}
|
|
9428
9459
|
});
|
|
9429
|
-
var prefer_atomic_properties_default =
|
|
9460
|
+
var prefer_atomic_properties_default = rule16;
|
|
9430
9461
|
|
|
9431
9462
|
// src/rules/prefer-composite-properties.ts
|
|
9432
9463
|
init_cjs_shims();
|
|
9433
|
-
var
|
|
9434
|
-
var
|
|
9435
|
-
name:
|
|
9464
|
+
var RULE_NAME17 = "prefer-composite-properties";
|
|
9465
|
+
var rule17 = createRule({
|
|
9466
|
+
name: RULE_NAME17,
|
|
9436
9467
|
meta: {
|
|
9437
9468
|
docs: {
|
|
9438
9469
|
description: "Encourage the use of composite properties instead of atomic properties in the codebase."
|
|
@@ -9451,14 +9482,16 @@ var rule16 = createRule({
|
|
|
9451
9482
|
return;
|
|
9452
9483
|
return Object.keys(compositeProperties).find((cpd) => compositeProperties[cpd].includes(longhand));
|
|
9453
9484
|
};
|
|
9454
|
-
const sendReport = (node
|
|
9455
|
-
const cmp = resolveCompositeProperty(
|
|
9485
|
+
const sendReport = (node) => {
|
|
9486
|
+
const cmp = resolveCompositeProperty(node.name);
|
|
9487
|
+
if (!cmp)
|
|
9488
|
+
return;
|
|
9456
9489
|
return context.report({
|
|
9457
9490
|
node,
|
|
9458
9491
|
messageId: "composite",
|
|
9459
9492
|
data: {
|
|
9460
9493
|
composite: cmp,
|
|
9461
|
-
atomic:
|
|
9494
|
+
atomic: node.name
|
|
9462
9495
|
}
|
|
9463
9496
|
});
|
|
9464
9497
|
};
|
|
@@ -9468,31 +9501,25 @@ var rule16 = createRule({
|
|
|
9468
9501
|
return;
|
|
9469
9502
|
if (!isPandaProp(node, context))
|
|
9470
9503
|
return;
|
|
9471
|
-
|
|
9472
|
-
if (!atm)
|
|
9473
|
-
return;
|
|
9474
|
-
sendReport(node, node.name.name);
|
|
9504
|
+
sendReport(node.name);
|
|
9475
9505
|
},
|
|
9476
9506
|
Property(node) {
|
|
9477
9507
|
if (!isIdentifier(node.key))
|
|
9478
9508
|
return;
|
|
9479
9509
|
if (!isPandaAttribute(node, context))
|
|
9480
9510
|
return;
|
|
9481
|
-
|
|
9482
|
-
if (!atm)
|
|
9483
|
-
return;
|
|
9484
|
-
sendReport(node.key, node.key.name);
|
|
9511
|
+
sendReport(node.key);
|
|
9485
9512
|
}
|
|
9486
9513
|
};
|
|
9487
9514
|
}
|
|
9488
9515
|
});
|
|
9489
|
-
var prefer_composite_properties_default =
|
|
9516
|
+
var prefer_composite_properties_default = rule17;
|
|
9490
9517
|
|
|
9491
9518
|
// src/rules/prefer-unified-property-style.ts
|
|
9492
9519
|
init_cjs_shims();
|
|
9493
|
-
var
|
|
9494
|
-
var
|
|
9495
|
-
name:
|
|
9520
|
+
var RULE_NAME18 = "prefer-unified-property-style";
|
|
9521
|
+
var rule18 = createRule({
|
|
9522
|
+
name: RULE_NAME18,
|
|
9496
9523
|
meta: {
|
|
9497
9524
|
docs: {
|
|
9498
9525
|
description: "Discourage against mixing atomic and composite forms of the same property in a style declaration. Atomic styles give more consistent results"
|
|
@@ -9559,7 +9586,7 @@ var rule17 = createRule({
|
|
|
9559
9586
|
};
|
|
9560
9587
|
}
|
|
9561
9588
|
});
|
|
9562
|
-
var prefer_unified_property_style_default =
|
|
9589
|
+
var prefer_unified_property_style_default = rule18;
|
|
9563
9590
|
|
|
9564
9591
|
// src/rules/index.ts
|
|
9565
9592
|
var rules = {
|
|
@@ -9572,14 +9599,15 @@ var rules = {
|
|
|
9572
9599
|
[RULE_NAME7]: no_important_default,
|
|
9573
9600
|
[RULE_NAME9]: no_invalid_token_paths_default,
|
|
9574
9601
|
[RULE_NAME8]: no_invalid_nesting_default,
|
|
9575
|
-
[
|
|
9576
|
-
[
|
|
9577
|
-
[RULE_NAME12]:
|
|
9578
|
-
[RULE_NAME13]:
|
|
9579
|
-
[RULE_NAME14]:
|
|
9580
|
-
[RULE_NAME15]:
|
|
9581
|
-
[RULE_NAME16]:
|
|
9582
|
-
[RULE_NAME17]:
|
|
9602
|
+
[RULE_NAME10]: no_margin_properties_default,
|
|
9603
|
+
[RULE_NAME11]: no_physical_properties_default,
|
|
9604
|
+
[RULE_NAME12]: no_property_renaming_default,
|
|
9605
|
+
[RULE_NAME13]: no_unsafe_token_fn_usage_default,
|
|
9606
|
+
[RULE_NAME14]: prefer_longhand_properties_default,
|
|
9607
|
+
[RULE_NAME15]: prefer_shorthand_properties_default,
|
|
9608
|
+
[RULE_NAME16]: prefer_atomic_properties_default,
|
|
9609
|
+
[RULE_NAME17]: prefer_composite_properties_default,
|
|
9610
|
+
[RULE_NAME18]: prefer_unified_property_style_default
|
|
9583
9611
|
};
|
|
9584
9612
|
|
|
9585
9613
|
// src/configs/all.ts
|
|
@@ -9610,7 +9638,7 @@ var recommended_default = {
|
|
|
9610
9638
|
"@pandacss/no-invalid-nesting": "error",
|
|
9611
9639
|
"@pandacss/no-invalid-token-paths": "error",
|
|
9612
9640
|
"@pandacss/no-property-renaming": "warn",
|
|
9613
|
-
"@pandacss/
|
|
9641
|
+
"@pandacss/no-unsafe-token-fn-usage": "warn"
|
|
9614
9642
|
}
|
|
9615
9643
|
};
|
|
9616
9644
|
|
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.17";
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
16
|
|
|
@@ -8898,6 +8898,61 @@ var init_no_invalid_token_paths = __esm({
|
|
|
8898
8898
|
}
|
|
8899
8899
|
});
|
|
8900
8900
|
|
|
8901
|
+
// src/rules/no-margin-properties.ts
|
|
8902
|
+
var RULE_NAME10, rule10, no_margin_properties_default;
|
|
8903
|
+
var init_no_margin_properties = __esm({
|
|
8904
|
+
"src/rules/no-margin-properties.ts"() {
|
|
8905
|
+
"use strict";
|
|
8906
|
+
init_esm_shims();
|
|
8907
|
+
init_helpers();
|
|
8908
|
+
init_utils();
|
|
8909
|
+
init_nodes();
|
|
8910
|
+
RULE_NAME10 = "no-margin-properties";
|
|
8911
|
+
rule10 = createRule({
|
|
8912
|
+
name: RULE_NAME10,
|
|
8913
|
+
meta: {
|
|
8914
|
+
docs: {
|
|
8915
|
+
description: "Discourage using margin properties for spacing; prefer defining spacing in parent elements with `flex` or `grid` using the `gap` property for a more resilient layout. Margins make components less reusable in other contexts."
|
|
8916
|
+
},
|
|
8917
|
+
messages: {
|
|
8918
|
+
noMargin: "Use flex or grid with the `gap` property to define spacing in parent elements for a more resilient layout."
|
|
8919
|
+
},
|
|
8920
|
+
type: "suggestion",
|
|
8921
|
+
schema: []
|
|
8922
|
+
},
|
|
8923
|
+
defaultOptions: [],
|
|
8924
|
+
create(context) {
|
|
8925
|
+
const getLonghand = (name2) => resolveLonghand(name2, context) ?? name2;
|
|
8926
|
+
const sendReport = (node) => {
|
|
8927
|
+
if (!getLonghand(node.name).toLowerCase().includes("margin"))
|
|
8928
|
+
return;
|
|
8929
|
+
return context.report({
|
|
8930
|
+
node,
|
|
8931
|
+
messageId: "noMargin"
|
|
8932
|
+
});
|
|
8933
|
+
};
|
|
8934
|
+
return {
|
|
8935
|
+
JSXAttribute(node) {
|
|
8936
|
+
if (!isJSXIdentifier(node.name))
|
|
8937
|
+
return;
|
|
8938
|
+
if (!isPandaProp(node, context))
|
|
8939
|
+
return;
|
|
8940
|
+
sendReport(node.name);
|
|
8941
|
+
},
|
|
8942
|
+
Property(node) {
|
|
8943
|
+
if (!isIdentifier(node.key))
|
|
8944
|
+
return;
|
|
8945
|
+
if (!isPandaAttribute(node, context))
|
|
8946
|
+
return;
|
|
8947
|
+
sendReport(node.key);
|
|
8948
|
+
}
|
|
8949
|
+
};
|
|
8950
|
+
}
|
|
8951
|
+
});
|
|
8952
|
+
no_margin_properties_default = rule10;
|
|
8953
|
+
}
|
|
8954
|
+
});
|
|
8955
|
+
|
|
8901
8956
|
// src/utils/physical-properties.ts
|
|
8902
8957
|
var physicalProperties;
|
|
8903
8958
|
var init_physical_properties = __esm({
|
|
@@ -8942,7 +8997,7 @@ var init_physical_properties = __esm({
|
|
|
8942
8997
|
});
|
|
8943
8998
|
|
|
8944
8999
|
// src/rules/no-physical-properties.ts
|
|
8945
|
-
var
|
|
9000
|
+
var RULE_NAME11, rule11, no_physical_properties_default;
|
|
8946
9001
|
var init_no_physical_properties = __esm({
|
|
8947
9002
|
"src/rules/no-physical-properties.ts"() {
|
|
8948
9003
|
"use strict";
|
|
@@ -8951,9 +9006,9 @@ var init_no_physical_properties = __esm({
|
|
|
8951
9006
|
init_utils();
|
|
8952
9007
|
init_nodes();
|
|
8953
9008
|
init_physical_properties();
|
|
8954
|
-
|
|
8955
|
-
|
|
8956
|
-
name:
|
|
9009
|
+
RULE_NAME11 = "no-physical-properties";
|
|
9010
|
+
rule11 = createRule({
|
|
9011
|
+
name: RULE_NAME11,
|
|
8957
9012
|
meta: {
|
|
8958
9013
|
docs: {
|
|
8959
9014
|
description: "Encourage the use of [logical properties](https://mdn.io/logical-properties-basic-concepts) over physical proeprties, to foster a responsive and adaptable user interface."
|
|
@@ -8969,21 +9024,23 @@ var init_no_physical_properties = __esm({
|
|
|
8969
9024
|
defaultOptions: [],
|
|
8970
9025
|
create(context) {
|
|
8971
9026
|
const getLonghand = (name2) => resolveLonghand(name2, context) ?? name2;
|
|
8972
|
-
const sendReport = (node
|
|
8973
|
-
|
|
8974
|
-
|
|
9027
|
+
const sendReport = (node) => {
|
|
9028
|
+
if (!(getLonghand(node.name) in physicalProperties))
|
|
9029
|
+
return;
|
|
9030
|
+
const logical = physicalProperties[getLonghand(node.name)];
|
|
9031
|
+
const longhand = resolveLonghand(node.name, context);
|
|
8975
9032
|
return context.report({
|
|
8976
9033
|
node,
|
|
8977
9034
|
messageId: "physical",
|
|
8978
9035
|
data: {
|
|
8979
|
-
physical: `\`${
|
|
9036
|
+
physical: `\`${node.name}\`${longhand ? ` - \`${longhand}\`` : ""}`,
|
|
8980
9037
|
logical
|
|
8981
9038
|
},
|
|
8982
9039
|
suggest: [
|
|
8983
9040
|
{
|
|
8984
9041
|
messageId: "replace",
|
|
8985
9042
|
data: {
|
|
8986
|
-
physical:
|
|
9043
|
+
physical: node.name,
|
|
8987
9044
|
logical
|
|
8988
9045
|
},
|
|
8989
9046
|
fix: (fixer) => {
|
|
@@ -8999,28 +9056,24 @@ var init_no_physical_properties = __esm({
|
|
|
8999
9056
|
return;
|
|
9000
9057
|
if (!isPandaProp(node, context))
|
|
9001
9058
|
return;
|
|
9002
|
-
|
|
9003
|
-
sendReport(node.name, node.name.name);
|
|
9004
|
-
}
|
|
9059
|
+
sendReport(node.name);
|
|
9005
9060
|
},
|
|
9006
9061
|
Property(node) {
|
|
9007
9062
|
if (!isIdentifier(node.key))
|
|
9008
9063
|
return;
|
|
9009
9064
|
if (!isPandaAttribute(node, context))
|
|
9010
9065
|
return;
|
|
9011
|
-
|
|
9012
|
-
sendReport(node.key, node.key.name);
|
|
9013
|
-
}
|
|
9066
|
+
sendReport(node.key);
|
|
9014
9067
|
}
|
|
9015
9068
|
};
|
|
9016
9069
|
}
|
|
9017
9070
|
});
|
|
9018
|
-
no_physical_properties_default =
|
|
9071
|
+
no_physical_properties_default = rule11;
|
|
9019
9072
|
}
|
|
9020
9073
|
});
|
|
9021
9074
|
|
|
9022
9075
|
// src/rules/no-property-renaming.ts
|
|
9023
|
-
var
|
|
9076
|
+
var RULE_NAME12, rule12, no_property_renaming_default;
|
|
9024
9077
|
var init_no_property_renaming = __esm({
|
|
9025
9078
|
"src/rules/no-property-renaming.ts"() {
|
|
9026
9079
|
"use strict";
|
|
@@ -9028,9 +9081,9 @@ var init_no_property_renaming = __esm({
|
|
|
9028
9081
|
init_utils();
|
|
9029
9082
|
init_helpers();
|
|
9030
9083
|
init_nodes();
|
|
9031
|
-
|
|
9032
|
-
|
|
9033
|
-
name:
|
|
9084
|
+
RULE_NAME12 = "no-property-renaming";
|
|
9085
|
+
rule12 = createRule({
|
|
9086
|
+
name: RULE_NAME12,
|
|
9034
9087
|
meta: {
|
|
9035
9088
|
docs: {
|
|
9036
9089
|
description: "Ensure user does not rename a property for a pattern or style prop. \nIt doesn't get tracked."
|
|
@@ -9053,6 +9106,14 @@ var init_no_property_renaming = __esm({
|
|
|
9053
9106
|
}
|
|
9054
9107
|
});
|
|
9055
9108
|
};
|
|
9109
|
+
const handleReport = (node, value, attr) => {
|
|
9110
|
+
if (isIdentifier(value) && attr !== value.name) {
|
|
9111
|
+
return sendReport(node, attr, value.name);
|
|
9112
|
+
}
|
|
9113
|
+
if (isMemberExpression(value) && isIdentifier(value.property) && attr !== value.property.name) {
|
|
9114
|
+
return sendReport(node, attr, value.property.name);
|
|
9115
|
+
}
|
|
9116
|
+
};
|
|
9056
9117
|
return {
|
|
9057
9118
|
JSXAttribute(node) {
|
|
9058
9119
|
if (!node.value)
|
|
@@ -9063,12 +9124,7 @@ var init_no_property_renaming = __esm({
|
|
|
9063
9124
|
return;
|
|
9064
9125
|
const attr = node.name.name.toString();
|
|
9065
9126
|
const expression = node.value.expression;
|
|
9066
|
-
|
|
9067
|
-
return sendReport(node, attr, expression.name);
|
|
9068
|
-
}
|
|
9069
|
-
if (isMemberExpression(expression) && isIdentifier(expression.property) && attr !== expression.property.name) {
|
|
9070
|
-
return sendReport(node, attr, expression.property.name);
|
|
9071
|
-
}
|
|
9127
|
+
handleReport(node, expression, attr);
|
|
9072
9128
|
},
|
|
9073
9129
|
Property(node) {
|
|
9074
9130
|
if (!isIdentifier(node.key))
|
|
@@ -9079,24 +9135,19 @@ var init_no_property_renaming = __esm({
|
|
|
9079
9135
|
return;
|
|
9080
9136
|
const attr = node.key.name.toString();
|
|
9081
9137
|
const value = node.value;
|
|
9082
|
-
|
|
9083
|
-
return sendReport(node, attr, value.name);
|
|
9084
|
-
}
|
|
9085
|
-
if (isMemberExpression(value) && isIdentifier(value.property) && attr !== value.property.name) {
|
|
9086
|
-
return sendReport(node, attr, value.property.name);
|
|
9087
|
-
}
|
|
9138
|
+
handleReport(node, value, attr);
|
|
9088
9139
|
}
|
|
9089
9140
|
};
|
|
9090
9141
|
}
|
|
9091
9142
|
});
|
|
9092
|
-
no_property_renaming_default =
|
|
9143
|
+
no_property_renaming_default = rule12;
|
|
9093
9144
|
}
|
|
9094
9145
|
});
|
|
9095
9146
|
|
|
9096
9147
|
// src/rules/no-unsafe-token-fn-usage.ts
|
|
9097
9148
|
import "@typescript-eslint/utils";
|
|
9098
9149
|
import { getArbitraryValue as getArbitraryValue3 } from "@pandacss/shared";
|
|
9099
|
-
var
|
|
9150
|
+
var RULE_NAME13, rule13, no_unsafe_token_fn_usage_default;
|
|
9100
9151
|
var init_no_unsafe_token_fn_usage = __esm({
|
|
9101
9152
|
"src/rules/no-unsafe-token-fn-usage.ts"() {
|
|
9102
9153
|
"use strict";
|
|
@@ -9104,9 +9155,9 @@ var init_no_unsafe_token_fn_usage = __esm({
|
|
|
9104
9155
|
init_helpers();
|
|
9105
9156
|
init_utils();
|
|
9106
9157
|
init_nodes();
|
|
9107
|
-
|
|
9108
|
-
|
|
9109
|
-
name:
|
|
9158
|
+
RULE_NAME13 = "no-unsafe-token-fn-usage";
|
|
9159
|
+
rule13 = createRule({
|
|
9160
|
+
name: RULE_NAME13,
|
|
9110
9161
|
meta: {
|
|
9111
9162
|
docs: {
|
|
9112
9163
|
description: "Prevent users from using the token function in situations where they could simply use the raw design token."
|
|
@@ -9202,12 +9253,12 @@ var init_no_unsafe_token_fn_usage = __esm({
|
|
|
9202
9253
|
};
|
|
9203
9254
|
}
|
|
9204
9255
|
});
|
|
9205
|
-
no_unsafe_token_fn_usage_default =
|
|
9256
|
+
no_unsafe_token_fn_usage_default = rule13;
|
|
9206
9257
|
}
|
|
9207
9258
|
});
|
|
9208
9259
|
|
|
9209
9260
|
// src/rules/prefer-longhand-properties.ts
|
|
9210
|
-
var
|
|
9261
|
+
var RULE_NAME14, rule14, prefer_longhand_properties_default;
|
|
9211
9262
|
var init_prefer_longhand_properties = __esm({
|
|
9212
9263
|
"src/rules/prefer-longhand-properties.ts"() {
|
|
9213
9264
|
"use strict";
|
|
@@ -9215,9 +9266,9 @@ var init_prefer_longhand_properties = __esm({
|
|
|
9215
9266
|
init_helpers();
|
|
9216
9267
|
init_utils();
|
|
9217
9268
|
init_nodes();
|
|
9218
|
-
|
|
9219
|
-
|
|
9220
|
-
name:
|
|
9269
|
+
RULE_NAME14 = "prefer-longhand-properties";
|
|
9270
|
+
rule14 = createRule({
|
|
9271
|
+
name: RULE_NAME14,
|
|
9221
9272
|
meta: {
|
|
9222
9273
|
docs: {
|
|
9223
9274
|
description: "Discourage the use of shorthand properties and promote the preference for longhand properties in the codebase."
|
|
@@ -9232,10 +9283,12 @@ var init_prefer_longhand_properties = __esm({
|
|
|
9232
9283
|
},
|
|
9233
9284
|
defaultOptions: [],
|
|
9234
9285
|
create(context) {
|
|
9235
|
-
const sendReport = (node
|
|
9236
|
-
const longhand = resolveLonghand(
|
|
9286
|
+
const sendReport = (node) => {
|
|
9287
|
+
const longhand = resolveLonghand(node.name, context);
|
|
9288
|
+
if (!longhand)
|
|
9289
|
+
return;
|
|
9237
9290
|
const data = {
|
|
9238
|
-
shorthand:
|
|
9291
|
+
shorthand: node.name,
|
|
9239
9292
|
longhand
|
|
9240
9293
|
};
|
|
9241
9294
|
return context.report({
|
|
@@ -9259,30 +9312,24 @@ var init_prefer_longhand_properties = __esm({
|
|
|
9259
9312
|
return;
|
|
9260
9313
|
if (!isPandaProp(node, context))
|
|
9261
9314
|
return;
|
|
9262
|
-
|
|
9263
|
-
if (!longhand)
|
|
9264
|
-
return;
|
|
9265
|
-
sendReport(node.name, node.name.name);
|
|
9315
|
+
sendReport(node.name);
|
|
9266
9316
|
},
|
|
9267
9317
|
Property(node) {
|
|
9268
9318
|
if (!isIdentifier(node.key))
|
|
9269
9319
|
return;
|
|
9270
9320
|
if (!isPandaAttribute(node, context))
|
|
9271
9321
|
return;
|
|
9272
|
-
|
|
9273
|
-
if (!longhand)
|
|
9274
|
-
return;
|
|
9275
|
-
sendReport(node.key, node.key.name);
|
|
9322
|
+
sendReport(node.key);
|
|
9276
9323
|
}
|
|
9277
9324
|
};
|
|
9278
9325
|
}
|
|
9279
9326
|
});
|
|
9280
|
-
prefer_longhand_properties_default =
|
|
9327
|
+
prefer_longhand_properties_default = rule14;
|
|
9281
9328
|
}
|
|
9282
9329
|
});
|
|
9283
9330
|
|
|
9284
9331
|
// src/rules/prefer-shorthand-properties.ts
|
|
9285
|
-
var
|
|
9332
|
+
var RULE_NAME15, rule15, prefer_shorthand_properties_default;
|
|
9286
9333
|
var init_prefer_shorthand_properties = __esm({
|
|
9287
9334
|
"src/rules/prefer-shorthand-properties.ts"() {
|
|
9288
9335
|
"use strict";
|
|
@@ -9290,9 +9337,9 @@ var init_prefer_shorthand_properties = __esm({
|
|
|
9290
9337
|
init_helpers();
|
|
9291
9338
|
init_utils();
|
|
9292
9339
|
init_nodes();
|
|
9293
|
-
|
|
9294
|
-
|
|
9295
|
-
name:
|
|
9340
|
+
RULE_NAME15 = "prefer-shorthand-properties";
|
|
9341
|
+
rule15 = createRule({
|
|
9342
|
+
name: RULE_NAME15,
|
|
9296
9343
|
meta: {
|
|
9297
9344
|
docs: {
|
|
9298
9345
|
description: "Discourage the use of longhand properties and promote the preference for shorthand properties in the codebase."
|
|
@@ -9307,13 +9354,16 @@ var init_prefer_shorthand_properties = __esm({
|
|
|
9307
9354
|
},
|
|
9308
9355
|
defaultOptions: [],
|
|
9309
9356
|
create(context) {
|
|
9310
|
-
const sendReport = (node
|
|
9311
|
-
const
|
|
9357
|
+
const sendReport = (node) => {
|
|
9358
|
+
const longhand = resolveLonghand(node.name, context);
|
|
9359
|
+
if (longhand)
|
|
9360
|
+
return;
|
|
9361
|
+
const shorthands = resolveShorthands(node.name, context);
|
|
9312
9362
|
if (!shorthands)
|
|
9313
9363
|
return;
|
|
9314
9364
|
const shorthand = shorthands.map((s) => `\`${s}\``)?.join(", ");
|
|
9315
9365
|
const data = {
|
|
9316
|
-
longhand:
|
|
9366
|
+
longhand: node.name,
|
|
9317
9367
|
shorthand
|
|
9318
9368
|
};
|
|
9319
9369
|
return context.report({
|
|
@@ -9337,25 +9387,19 @@ var init_prefer_shorthand_properties = __esm({
|
|
|
9337
9387
|
return;
|
|
9338
9388
|
if (!isPandaProp(node, context))
|
|
9339
9389
|
return;
|
|
9340
|
-
|
|
9341
|
-
if (longhand)
|
|
9342
|
-
return;
|
|
9343
|
-
sendReport(node.name, node.name.name);
|
|
9390
|
+
sendReport(node.name);
|
|
9344
9391
|
},
|
|
9345
9392
|
Property(node) {
|
|
9346
9393
|
if (!isIdentifier(node.key))
|
|
9347
9394
|
return;
|
|
9348
9395
|
if (!isPandaAttribute(node, context))
|
|
9349
9396
|
return;
|
|
9350
|
-
|
|
9351
|
-
if (longhand)
|
|
9352
|
-
return;
|
|
9353
|
-
sendReport(node.key, node.key.name);
|
|
9397
|
+
sendReport(node.key);
|
|
9354
9398
|
}
|
|
9355
9399
|
};
|
|
9356
9400
|
}
|
|
9357
9401
|
});
|
|
9358
|
-
prefer_shorthand_properties_default =
|
|
9402
|
+
prefer_shorthand_properties_default = rule15;
|
|
9359
9403
|
}
|
|
9360
9404
|
});
|
|
9361
9405
|
|
|
@@ -9480,7 +9524,7 @@ var init_composite_properties = __esm({
|
|
|
9480
9524
|
});
|
|
9481
9525
|
|
|
9482
9526
|
// src/rules/prefer-atomic-properties.ts
|
|
9483
|
-
var
|
|
9527
|
+
var RULE_NAME16, rule16, prefer_atomic_properties_default;
|
|
9484
9528
|
var init_prefer_atomic_properties = __esm({
|
|
9485
9529
|
"src/rules/prefer-atomic-properties.ts"() {
|
|
9486
9530
|
"use strict";
|
|
@@ -9489,9 +9533,9 @@ var init_prefer_atomic_properties = __esm({
|
|
|
9489
9533
|
init_utils();
|
|
9490
9534
|
init_composite_properties();
|
|
9491
9535
|
init_nodes();
|
|
9492
|
-
|
|
9493
|
-
|
|
9494
|
-
name:
|
|
9536
|
+
RULE_NAME16 = "prefer-atomic-properties";
|
|
9537
|
+
rule16 = createRule({
|
|
9538
|
+
name: RULE_NAME16,
|
|
9495
9539
|
meta: {
|
|
9496
9540
|
docs: {
|
|
9497
9541
|
description: "Encourage the use of atomic properties instead of composite properties in the codebase."
|
|
@@ -9511,14 +9555,16 @@ var init_prefer_atomic_properties = __esm({
|
|
|
9511
9555
|
if (isValidProperty(longhand, context) && Object.hasOwn(compositeProperties, longhand))
|
|
9512
9556
|
return longhand;
|
|
9513
9557
|
};
|
|
9514
|
-
const sendReport = (node
|
|
9515
|
-
const cmp = resolveCompositeProperty(
|
|
9516
|
-
|
|
9558
|
+
const sendReport = (node) => {
|
|
9559
|
+
const cmp = resolveCompositeProperty(node.name);
|
|
9560
|
+
if (!cmp)
|
|
9561
|
+
return;
|
|
9562
|
+
const atomics = compositeProperties[cmp].map((name2) => `\`${name2}\``).join(",\n");
|
|
9517
9563
|
return context.report({
|
|
9518
9564
|
node,
|
|
9519
9565
|
messageId: "atomic",
|
|
9520
9566
|
data: {
|
|
9521
|
-
composite:
|
|
9567
|
+
composite: node.name,
|
|
9522
9568
|
atomics
|
|
9523
9569
|
}
|
|
9524
9570
|
});
|
|
@@ -9529,30 +9575,24 @@ var init_prefer_atomic_properties = __esm({
|
|
|
9529
9575
|
return;
|
|
9530
9576
|
if (!isPandaProp(node, context))
|
|
9531
9577
|
return;
|
|
9532
|
-
|
|
9533
|
-
if (!cmp)
|
|
9534
|
-
return;
|
|
9535
|
-
sendReport(node, node.name.name);
|
|
9578
|
+
sendReport(node.name);
|
|
9536
9579
|
},
|
|
9537
9580
|
Property(node) {
|
|
9538
9581
|
if (!isIdentifier(node.key))
|
|
9539
9582
|
return;
|
|
9540
9583
|
if (!isPandaAttribute(node, context))
|
|
9541
9584
|
return;
|
|
9542
|
-
|
|
9543
|
-
if (!cmp)
|
|
9544
|
-
return;
|
|
9545
|
-
sendReport(node.key, node.key.name);
|
|
9585
|
+
sendReport(node.key);
|
|
9546
9586
|
}
|
|
9547
9587
|
};
|
|
9548
9588
|
}
|
|
9549
9589
|
});
|
|
9550
|
-
prefer_atomic_properties_default =
|
|
9590
|
+
prefer_atomic_properties_default = rule16;
|
|
9551
9591
|
}
|
|
9552
9592
|
});
|
|
9553
9593
|
|
|
9554
9594
|
// src/rules/prefer-composite-properties.ts
|
|
9555
|
-
var
|
|
9595
|
+
var RULE_NAME17, rule17, prefer_composite_properties_default;
|
|
9556
9596
|
var init_prefer_composite_properties = __esm({
|
|
9557
9597
|
"src/rules/prefer-composite-properties.ts"() {
|
|
9558
9598
|
"use strict";
|
|
@@ -9561,9 +9601,9 @@ var init_prefer_composite_properties = __esm({
|
|
|
9561
9601
|
init_utils();
|
|
9562
9602
|
init_composite_properties();
|
|
9563
9603
|
init_nodes();
|
|
9564
|
-
|
|
9565
|
-
|
|
9566
|
-
name:
|
|
9604
|
+
RULE_NAME17 = "prefer-composite-properties";
|
|
9605
|
+
rule17 = createRule({
|
|
9606
|
+
name: RULE_NAME17,
|
|
9567
9607
|
meta: {
|
|
9568
9608
|
docs: {
|
|
9569
9609
|
description: "Encourage the use of composite properties instead of atomic properties in the codebase."
|
|
@@ -9582,14 +9622,16 @@ var init_prefer_composite_properties = __esm({
|
|
|
9582
9622
|
return;
|
|
9583
9623
|
return Object.keys(compositeProperties).find((cpd) => compositeProperties[cpd].includes(longhand));
|
|
9584
9624
|
};
|
|
9585
|
-
const sendReport = (node
|
|
9586
|
-
const cmp = resolveCompositeProperty(
|
|
9625
|
+
const sendReport = (node) => {
|
|
9626
|
+
const cmp = resolveCompositeProperty(node.name);
|
|
9627
|
+
if (!cmp)
|
|
9628
|
+
return;
|
|
9587
9629
|
return context.report({
|
|
9588
9630
|
node,
|
|
9589
9631
|
messageId: "composite",
|
|
9590
9632
|
data: {
|
|
9591
9633
|
composite: cmp,
|
|
9592
|
-
atomic:
|
|
9634
|
+
atomic: node.name
|
|
9593
9635
|
}
|
|
9594
9636
|
});
|
|
9595
9637
|
};
|
|
@@ -9599,30 +9641,24 @@ var init_prefer_composite_properties = __esm({
|
|
|
9599
9641
|
return;
|
|
9600
9642
|
if (!isPandaProp(node, context))
|
|
9601
9643
|
return;
|
|
9602
|
-
|
|
9603
|
-
if (!atm)
|
|
9604
|
-
return;
|
|
9605
|
-
sendReport(node, node.name.name);
|
|
9644
|
+
sendReport(node.name);
|
|
9606
9645
|
},
|
|
9607
9646
|
Property(node) {
|
|
9608
9647
|
if (!isIdentifier(node.key))
|
|
9609
9648
|
return;
|
|
9610
9649
|
if (!isPandaAttribute(node, context))
|
|
9611
9650
|
return;
|
|
9612
|
-
|
|
9613
|
-
if (!atm)
|
|
9614
|
-
return;
|
|
9615
|
-
sendReport(node.key, node.key.name);
|
|
9651
|
+
sendReport(node.key);
|
|
9616
9652
|
}
|
|
9617
9653
|
};
|
|
9618
9654
|
}
|
|
9619
9655
|
});
|
|
9620
|
-
prefer_composite_properties_default =
|
|
9656
|
+
prefer_composite_properties_default = rule17;
|
|
9621
9657
|
}
|
|
9622
9658
|
});
|
|
9623
9659
|
|
|
9624
9660
|
// src/rules/prefer-unified-property-style.ts
|
|
9625
|
-
var
|
|
9661
|
+
var RULE_NAME18, rule18, prefer_unified_property_style_default;
|
|
9626
9662
|
var init_prefer_unified_property_style = __esm({
|
|
9627
9663
|
"src/rules/prefer-unified-property-style.ts"() {
|
|
9628
9664
|
"use strict";
|
|
@@ -9631,9 +9667,9 @@ var init_prefer_unified_property_style = __esm({
|
|
|
9631
9667
|
init_utils();
|
|
9632
9668
|
init_composite_properties();
|
|
9633
9669
|
init_nodes();
|
|
9634
|
-
|
|
9635
|
-
|
|
9636
|
-
name:
|
|
9670
|
+
RULE_NAME18 = "prefer-unified-property-style";
|
|
9671
|
+
rule18 = createRule({
|
|
9672
|
+
name: RULE_NAME18,
|
|
9637
9673
|
meta: {
|
|
9638
9674
|
docs: {
|
|
9639
9675
|
description: "Discourage against mixing atomic and composite forms of the same property in a style declaration. Atomic styles give more consistent results"
|
|
@@ -9700,7 +9736,7 @@ var init_prefer_unified_property_style = __esm({
|
|
|
9700
9736
|
};
|
|
9701
9737
|
}
|
|
9702
9738
|
});
|
|
9703
|
-
prefer_unified_property_style_default =
|
|
9739
|
+
prefer_unified_property_style_default = rule18;
|
|
9704
9740
|
}
|
|
9705
9741
|
});
|
|
9706
9742
|
|
|
@@ -9719,6 +9755,7 @@ var init_rules = __esm({
|
|
|
9719
9755
|
init_no_important();
|
|
9720
9756
|
init_no_invalid_nesting();
|
|
9721
9757
|
init_no_invalid_token_paths();
|
|
9758
|
+
init_no_margin_properties();
|
|
9722
9759
|
init_no_physical_properties();
|
|
9723
9760
|
init_no_property_renaming();
|
|
9724
9761
|
init_no_unsafe_token_fn_usage();
|
|
@@ -9737,14 +9774,15 @@ var init_rules = __esm({
|
|
|
9737
9774
|
[RULE_NAME7]: no_important_default,
|
|
9738
9775
|
[RULE_NAME9]: no_invalid_token_paths_default,
|
|
9739
9776
|
[RULE_NAME8]: no_invalid_nesting_default,
|
|
9740
|
-
[
|
|
9741
|
-
[
|
|
9742
|
-
[RULE_NAME12]:
|
|
9743
|
-
[RULE_NAME13]:
|
|
9744
|
-
[RULE_NAME14]:
|
|
9745
|
-
[RULE_NAME15]:
|
|
9746
|
-
[RULE_NAME16]:
|
|
9747
|
-
[RULE_NAME17]:
|
|
9777
|
+
[RULE_NAME10]: no_margin_properties_default,
|
|
9778
|
+
[RULE_NAME11]: no_physical_properties_default,
|
|
9779
|
+
[RULE_NAME12]: no_property_renaming_default,
|
|
9780
|
+
[RULE_NAME13]: no_unsafe_token_fn_usage_default,
|
|
9781
|
+
[RULE_NAME14]: prefer_longhand_properties_default,
|
|
9782
|
+
[RULE_NAME15]: prefer_shorthand_properties_default,
|
|
9783
|
+
[RULE_NAME16]: prefer_atomic_properties_default,
|
|
9784
|
+
[RULE_NAME17]: prefer_composite_properties_default,
|
|
9785
|
+
[RULE_NAME18]: prefer_unified_property_style_default
|
|
9748
9786
|
};
|
|
9749
9787
|
}
|
|
9750
9788
|
});
|
|
@@ -9792,7 +9830,7 @@ var init_recommended = __esm({
|
|
|
9792
9830
|
"@pandacss/no-invalid-nesting": "error",
|
|
9793
9831
|
"@pandacss/no-invalid-token-paths": "error",
|
|
9794
9832
|
"@pandacss/no-property-renaming": "warn",
|
|
9795
|
-
"@pandacss/
|
|
9833
|
+
"@pandacss/no-unsafe-token-fn-usage": "warn"
|
|
9796
9834
|
}
|
|
9797
9835
|
};
|
|
9798
9836
|
}
|