canicode 0.10.4 → 0.10.5
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/cli/index.js +14 -4
- package/dist/cli/index.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +14 -4
- package/dist/index.js.map +1 -1
- package/dist/mcp/server.js +14 -4
- package/dist/mcp/server.js.map +1 -1
- package/package.json +1 -1
package/dist/mcp/server.js
CHANGED
|
@@ -1773,7 +1773,7 @@ function computeApplyContext(violation, instanceContext) {
|
|
|
1773
1773
|
}
|
|
1774
1774
|
|
|
1775
1775
|
// package.json
|
|
1776
|
-
var version = "0.10.
|
|
1776
|
+
var version = "0.10.5";
|
|
1777
1777
|
|
|
1778
1778
|
// src/core/engine/scoring.ts
|
|
1779
1779
|
function computeTotalScorePerCategory(configs) {
|
|
@@ -4856,12 +4856,22 @@ function hasStateInComponentMaster(node, context, statePattern) {
|
|
|
4856
4856
|
if (!master) return false;
|
|
4857
4857
|
return hasStateInVariantProps(master, statePattern);
|
|
4858
4858
|
}
|
|
4859
|
+
var VARIANT_POSITION_NAME_RE = /^[\w ]+=[^,]+(,\s*[\w ]+=[^,]+)*$/;
|
|
4860
|
+
function hasUsablePropDefs(propDefs) {
|
|
4861
|
+
return propDefs != null && typeof propDefs === "object";
|
|
4862
|
+
}
|
|
4859
4863
|
function canDetermineVariants(node, context) {
|
|
4860
|
-
if (node.
|
|
4861
|
-
if (node.
|
|
4864
|
+
if (hasUsablePropDefs(node.componentPropertyDefinitions)) return true;
|
|
4865
|
+
if (node.type === "COMPONENT") {
|
|
4866
|
+
return !VARIANT_POSITION_NAME_RE.test(node.name);
|
|
4867
|
+
}
|
|
4862
4868
|
if (node.componentId !== void 0) {
|
|
4863
4869
|
const defs = context.file.componentDefinitions;
|
|
4864
|
-
|
|
4870
|
+
const master = defs?.[node.componentId];
|
|
4871
|
+
if (master) {
|
|
4872
|
+
if (hasUsablePropDefs(master.componentPropertyDefinitions)) return true;
|
|
4873
|
+
return !VARIANT_POSITION_NAME_RE.test(master.name);
|
|
4874
|
+
}
|
|
4865
4875
|
}
|
|
4866
4876
|
return false;
|
|
4867
4877
|
}
|