@angular-eslint/test-utils 18.3.1-alpha.8 → 18.3.1

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.
@@ -105,26 +105,35 @@ function parseInvalidSource(source, specialChar = '~', otherChars = []) {
105
105
  }
106
106
  let col = 0;
107
107
  let line = 0;
108
+ let sourceLine = 0;
109
+ let isAnnotationLine = false;
108
110
  let lastCol = 0;
109
111
  let lastLine = 0;
110
112
  let startPosition;
111
- for (const currentChar of replacedSource) {
113
+ for (const currentChar of source) {
112
114
  if (currentChar === '\n') {
115
+ if (isAnnotationLine)
116
+ isAnnotationLine = false;
117
+ else
118
+ sourceLine = line;
113
119
  col = 0;
114
120
  line++;
115
121
  continue;
116
122
  }
117
123
  col++;
124
+ if (otherChars.includes(currentChar))
125
+ isAnnotationLine = true;
118
126
  if (currentChar !== specialChar)
119
127
  continue;
128
+ isAnnotationLine = true;
120
129
  if (!startPosition) {
121
130
  startPosition = {
122
131
  character: col - 1,
123
- line: line - 1,
132
+ line: sourceLine,
124
133
  };
125
134
  }
126
135
  lastCol = col;
127
- lastLine = line - 1;
136
+ lastLine = sourceLine;
128
137
  }
129
138
  const endPosition = {
130
139
  character: lastCol,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular-eslint/test-utils",
3
- "version": "18.3.1-alpha.8",
3
+ "version": "18.3.1",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -17,12 +17,12 @@
17
17
  "LICENSE"
18
18
  ],
19
19
  "peerDependencies": {
20
- "@angular-eslint/template-parser": "18.3.0",
21
20
  "@typescript-eslint/parser": "^7.11.0 || ^8.0.0",
22
21
  "@typescript-eslint/rule-tester": "^7.11.0 || ^8.0.0",
23
22
  "@typescript-eslint/utils": "^7.11.0 || ^8.0.0",
24
23
  "eslint": "^8.57.0 || ^9.0.0",
25
- "typescript": "*"
24
+ "typescript": "*",
25
+ "@angular-eslint/template-parser": "18.3.1"
26
26
  },
27
27
  "peerDependenciesMeta": {
28
28
  "@angular-eslint/template-parser": {
@@ -36,4 +36,4 @@
36
36
  "access": "public"
37
37
  },
38
38
  "gitHead": "e2006e5e9c99e5a943d1a999e0efa5247d29ec24"
39
- }
39
+ }