stylelint-config-silverwind 35.0.1 → 35.0.2

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.
Files changed (2) hide show
  1. package/dist/index.js +6 -61
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -8898,7 +8898,7 @@ function resolveId(id2, basedir, {
8898
8898
  });
8899
8899
  }
8900
8900
  async function getCustomPropertiesFromRoot(root2, resolver) {
8901
- let customProperties = Object(null);
8901
+ let customProperties = {};
8902
8902
  let sourceDir = process.cwd();
8903
8903
  if (root2.source && root2.source.input && root2.source.input.file) {
8904
8904
  sourceDir = path$2.dirname(root2.source.input.file);
@@ -8921,60 +8921,6 @@ async function getCustomPropertiesFromRoot(root2, resolver) {
8921
8921
  importPromises.push(promise);
8922
8922
  }
8923
8923
  });
8924
- root2.walkAtRules("property", (atRule2) => {
8925
- console.log(atRule2);
8926
- const nodes = valueParser(atRule2.params).nodes;
8927
- const names = [];
8928
- for (let i2 = 0; i2 < nodes.length; i2++) {
8929
- let node2 = nodes[i2];
8930
- if (node2.type === "word" && node2.value.startsWith("--")) {
8931
- names.push(node2.value);
8932
- while (!(node2.type === "div" && node2.value === ",")) {
8933
- i2++;
8934
- node2 = nodes[i2];
8935
- if (!node2) {
8936
- break;
8937
- }
8938
- }
8939
- }
8940
- }
8941
- const atProperty = {
8942
- inherits: void 0,
8943
- syntax: void 0,
8944
- initialValue: void 0
8945
- };
8946
- atRule2.each((descriptor) => {
8947
- if (descriptor.type !== "decl") {
8948
- return;
8949
- }
8950
- switch (descriptor.prop) {
8951
- case "initial-value":
8952
- atProperty.initialValue = descriptor.value;
8953
- return;
8954
- case "syntax":
8955
- atProperty.syntax = descriptor.value.trim();
8956
- break;
8957
- case "inherits":
8958
- atProperty.inherits = descriptor.value.trim();
8959
- break;
8960
- }
8961
- });
8962
- if (typeof atProperty.inherits === "undefined" || typeof atProperty.syntax === "undefined") {
8963
- return;
8964
- }
8965
- if (atProperty.syntax === "*" || atProperty.syntax === "'*'" || atProperty.syntax === '"*"') {
8966
- names.forEach((name) => {
8967
- customProperties[name] = {};
8968
- });
8969
- return;
8970
- }
8971
- if (typeof atProperty.initialValue === "undefined") {
8972
- return;
8973
- }
8974
- names.forEach((name) => {
8975
- customProperties[name] = {};
8976
- });
8977
- });
8978
8924
  (await Promise.all(importPromises)).forEach((propertiesFromImport) => {
8979
8925
  customProperties = Object.assign(customProperties, propertiesFromImport);
8980
8926
  });
@@ -8982,7 +8928,7 @@ async function getCustomPropertiesFromRoot(root2, resolver) {
8982
8928
  if (!decl.variable || !decl.prop.startsWith("--")) {
8983
8929
  return;
8984
8930
  }
8985
- customProperties[decl.prop] = {};
8931
+ customProperties[decl.prop] = decl.value;
8986
8932
  });
8987
8933
  return customProperties;
8988
8934
  }
@@ -9104,8 +9050,7 @@ const validateValueAST = (ast, { result: result2, customProperties, decl }) => {
9104
9050
  return;
9105
9051
  }
9106
9052
  stylelint.utils.report({
9107
- message: messages$1d.unexpected,
9108
- messageArgs: [propertyName, decl.prop],
9053
+ message: messages$1d.unexpected(propertyName, decl.prop),
9109
9054
  node: decl,
9110
9055
  result: result2,
9111
9056
  ruleName: ruleName$1d,
@@ -9115,8 +9060,8 @@ const validateValueAST = (ast, { result: result2, customProperties, decl }) => {
9115
9060
  });
9116
9061
  };
9117
9062
  const isVarFunction = (node2) => node2.type === "function" && node2.value === "var" && node2.nodes[0].value.startsWith("--");
9118
- const validateResult = (root2, result2, customProperties) => {
9119
- root2.walkDecls((decl) => {
9063
+ const validateResult = (result2, customProperties) => {
9064
+ result2.root.walkDecls((decl) => {
9120
9065
  if (hasCustomPropertyReference(decl)) {
9121
9066
  validateDecl(decl, { result: result2, customProperties });
9122
9067
  }
@@ -9143,7 +9088,7 @@ const ruleFunction = (method, opts) => {
9143
9088
  await customPropertiesPromise,
9144
9089
  await getCustomPropertiesFromRoot(root2, resolver)
9145
9090
  );
9146
- validateResult(root2, result2, customProperties);
9091
+ validateResult(result2, customProperties);
9147
9092
  }
9148
9093
  };
9149
9094
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stylelint-config-silverwind",
3
- "version": "35.0.1",
3
+ "version": "35.0.2",
4
4
  "description": "Extensive stylelint configuration",
5
5
  "author": "silverwind <me@silverwind.io>",
6
6
  "repository": "silverwind/stylelint-config-silverwind",
@@ -25,7 +25,7 @@
25
25
  "stylelint": "17.0.0",
26
26
  "stylelint-declaration-block-no-ignored-properties": "2.8.0",
27
27
  "stylelint-declaration-strict-value": "1.10.11",
28
- "stylelint-value-no-unknown-custom-properties": "6.1.0",
28
+ "stylelint-value-no-unknown-custom-properties": "6.0.1",
29
29
  "typescript": "5.9.3",
30
30
  "typescript-config-silverwind": "14.0.0",
31
31
  "updates": "17.0.7",