wrec 0.40.1 → 0.40.3

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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "wrec",
3
3
  "description": "a library that greatly simplifies building web components",
4
4
  "author": "R. Mark Volkmann",
5
- "version": "0.40.1",
5
+ "version": "0.40.3",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",
@@ -49,6 +49,7 @@ function analyzeSourceFile(sourceFile) {
49
49
  if (!declareType) continue;
50
50
  declareLines.push(createDeclareLine(propName, declareType));
51
51
  }
52
+ declareLines.sort((a, b) => a.localeCompare(b));
52
53
 
53
54
  const start = propertiesMember.end;
54
55
  const end = findDeclareBlockEnd(classNode, propertiesMember, sourceFile);
package/scripts/lint.js CHANGED
@@ -801,14 +801,20 @@ function extractTemplateExpressions(
801
801
  while (true) {
802
802
  const match = CSS_PROPERTY_RE.exec(rendered);
803
803
  if (!match) break;
804
- const value = match[2]?.trim();
804
+ const rawValue = match[2] ?? '';
805
+ const value = rawValue.trim();
805
806
  if (value && REFS_TEST_RE.test(value)) {
807
+ const valueOffsetInMatch = match[0].lastIndexOf(rawValue);
808
+ const leadingWhitespace = rawValue.length - rawValue.trimStart().length;
809
+ const valueLocation = resolveLocation(
810
+ match.index + valueOffsetInMatch + leadingWhitespace
811
+ );
806
812
  expressions.push({
807
813
  context: 'instance',
808
814
  eventHandler: false,
809
815
  kind: 'css',
810
816
  text: value,
811
- location: null
817
+ location: valueLocation
812
818
  });
813
819
  }
814
820
  }