stylelint-config-silverwind 34.1.4 → 35.0.0

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 +67 -9
  2. package/package.json +10 -10
package/dist/index.js CHANGED
@@ -2074,8 +2074,8 @@ var hasRequiredSymbols;
2074
2074
  function requireSymbols() {
2075
2075
  if (hasRequiredSymbols) return symbols;
2076
2076
  hasRequiredSymbols = 1;
2077
- symbols.isClean = Symbol("isClean");
2078
- symbols.my = Symbol("my");
2077
+ symbols.isClean = /* @__PURE__ */ Symbol("isClean");
2078
+ symbols.my = /* @__PURE__ */ Symbol("my");
2079
2079
  return symbols;
2080
2080
  }
2081
2081
  var node$3;
@@ -5008,7 +5008,7 @@ function requireInput() {
5008
5008
  let CssSyntaxError = requireCssSyntaxError();
5009
5009
  let PreviousMap = requirePreviousMap();
5010
5010
  let terminalHighlight = requireTerminalHighlight();
5011
- let lineToIndexCache = Symbol("lineToIndexCache");
5011
+ let lineToIndexCache = /* @__PURE__ */ Symbol("lineToIndexCache");
5012
5012
  let sourceMapAvailable = Boolean(SourceMapConsumer && SourceMapGenerator);
5013
5013
  let pathAvailable = Boolean(resolve2 && isAbsolute);
5014
5014
  function getLineToIndex(input2) {
@@ -8898,7 +8898,7 @@ function resolveId(id2, basedir, {
8898
8898
  });
8899
8899
  }
8900
8900
  async function getCustomPropertiesFromRoot(root2, resolver) {
8901
- let customProperties = {};
8901
+ let customProperties = Object(null);
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,6 +8921,60 @@ 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
+ });
8924
8978
  (await Promise.all(importPromises)).forEach((propertiesFromImport) => {
8925
8979
  customProperties = Object.assign(customProperties, propertiesFromImport);
8926
8980
  });
@@ -8928,7 +8982,7 @@ async function getCustomPropertiesFromRoot(root2, resolver) {
8928
8982
  if (!decl.variable || !decl.prop.startsWith("--")) {
8929
8983
  return;
8930
8984
  }
8931
- customProperties[decl.prop] = decl.value;
8985
+ customProperties[decl.prop] = {};
8932
8986
  });
8933
8987
  return customProperties;
8934
8988
  }
@@ -9050,7 +9104,8 @@ const validateValueAST = (ast, { result: result2, customProperties, decl }) => {
9050
9104
  return;
9051
9105
  }
9052
9106
  stylelint.utils.report({
9053
- message: messages$1d.unexpected(propertyName, decl.prop),
9107
+ message: messages$1d.unexpected,
9108
+ messageArgs: [propertyName, decl.prop],
9054
9109
  node: decl,
9055
9110
  result: result2,
9056
9111
  ruleName: ruleName$1d,
@@ -9060,8 +9115,8 @@ const validateValueAST = (ast, { result: result2, customProperties, decl }) => {
9060
9115
  });
9061
9116
  };
9062
9117
  const isVarFunction = (node2) => node2.type === "function" && node2.value === "var" && node2.nodes[0].value.startsWith("--");
9063
- const validateResult = (result2, customProperties) => {
9064
- result2.root.walkDecls((decl) => {
9118
+ const validateResult = (root2, result2, customProperties) => {
9119
+ root2.walkDecls((decl) => {
9065
9120
  if (hasCustomPropertyReference(decl)) {
9066
9121
  validateDecl(decl, { result: result2, customProperties });
9067
9122
  }
@@ -9088,7 +9143,7 @@ const ruleFunction = (method, opts) => {
9088
9143
  await customPropertiesPromise,
9089
9144
  await getCustomPropertiesFromRoot(root2, resolver)
9090
9145
  );
9091
- validateResult(result2, customProperties);
9146
+ validateResult(root2, result2, customProperties);
9092
9147
  }
9093
9148
  };
9094
9149
  };
@@ -18065,6 +18120,9 @@ function rule$H(primary, secondaryOptions = {}) {
18065
18120
  if (ruleNode.params) {
18066
18121
  ruleLevel += 1;
18067
18122
  }
18123
+ if (selector2.match(/:\w+\(\s*\r?\n/)) {
18124
+ ruleLevel += 1;
18125
+ }
18068
18126
  checkMultilineBit(selector2, ruleLevel, ruleNode);
18069
18127
  }
18070
18128
  function checkAtRuleParams(atRule2, ruleLevel) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stylelint-config-silverwind",
3
- "version": "34.1.4",
3
+ "version": "35.0.0",
4
4
  "description": "Extensive stylelint configuration",
5
5
  "author": "silverwind <me@silverwind.io>",
6
6
  "repository": "silverwind/stylelint-config-silverwind",
@@ -14,24 +14,24 @@
14
14
  "dist"
15
15
  ],
16
16
  "dependencies": {
17
- "stylelint-config-recommended": "17.0.0"
17
+ "stylelint-config-recommended": "18.0.0"
18
18
  },
19
19
  "devDependencies": {
20
20
  "@silverwind/postcss-html": "1.8.3",
21
21
  "@stylelint-types/stylelint-stylistic": "3.1.3",
22
- "@stylistic/stylelint-plugin": "4.0.0",
23
- "eslint": "9.39.1",
24
- "eslint-config-silverwind": "112.0.3",
25
- "stylelint": "16.26.1",
22
+ "@stylistic/stylelint-plugin": "4.0.1",
23
+ "eslint": "9.39.2",
24
+ "eslint-config-silverwind": "117.0.1",
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.0.1",
28
+ "stylelint-value-no-unknown-custom-properties": "6.1.0",
29
29
  "typescript": "5.9.3",
30
30
  "typescript-config-silverwind": "14.0.0",
31
- "updates": "16.9.2",
31
+ "updates": "17.0.7",
32
32
  "versions": "14.0.3",
33
- "vite": "7.2.6",
34
- "vite-config-silverwind": "6.0.5"
33
+ "vite": "7.3.1",
34
+ "vite-config-silverwind": "6.0.8"
35
35
  },
36
36
  "peerDependencies": {
37
37
  "stylelint": "*"