@angular-eslint/template-parser 22.0.1-alpha.9 → 22.1.1-alpha.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.
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -4
- package/package.json +3 -2
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,UAAU,EAEX,MAAM,0CAA0C,CAAC;AAElD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAW,YAAY,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EACL,6BAA6B,EAC7B,0BAA0B,EAC3B,MAAM,8BAA8B,CAAC;AAEtC,KAAK,eAAe,GAAG,GAAG,CAAC;AAE3B,UAAU,IAAI;IAEZ,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;IACnB,IAAI,EAAE,eAAe,CAAC;CACvB;AAED,UAAU,WAAW;IACnB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAC9B;AAED,UAAU,KAAM,SAAQ,QAAQ,CAAC,QAAQ;IACvC,IAAI,EAAE,eAAe,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,UAAU,GAAI,SAAQ,IAAI,EAAE,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC;IAC/C,QAAQ,EAAE,KAAK,EAAE,CAAC;IAClB,MAAM,EAAE,KAAK,EAAE,CAAC;IAEhB,aAAa,EAAE,GAAG,EAAE,CAAC;CACtB;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,UAAU,EAEX,MAAM,0CAA0C,CAAC;AAElD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BA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C;IAChD,WAAW,EAAE,WAAW,CAAC;IACzB,QAAQ,EAAE;QACR,6BAA6B,EAAE,OAAO,6BAA6B,CAAC;QACpE,0BAA0B,EAAE,OAAO,0BAA0B,CAAC;KAC/D,CAAC;CACH,CA+DA;AAED,OAAO,EAAE,cAAc,EAAE,CAAC;AAE1B,wBAAgB,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,GAAG,GAAG,CAE/D;AAGD,eAAO,MAAM,OAAO,EAAE,MAA2C,CAAC;AAElE,eAAO,MAAM,IAAI;;;CAGhB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -232,11 +232,21 @@ function getEndSourceSpanFromAST(ast) {
|
|
|
232
232
|
});
|
|
233
233
|
return endSourceSpan;
|
|
234
234
|
}
|
|
235
|
-
function convertNgAstCommentsToTokens(comments) {
|
|
235
|
+
function convertNgAstCommentsToTokens(comments, code) {
|
|
236
236
|
const commentTokens = comments.map((comment) => {
|
|
237
|
+
// As of Angular v22, the compiler collects TypeScript-style comments
|
|
238
|
+
// written inside an element's opening tag alongside classic HTML
|
|
239
|
+
// `<!-- -->` comments. `//` comments must be surfaced as Line comments so
|
|
240
|
+
// that ESLint applies its inline directive semantics (e.g.
|
|
241
|
+
// `eslint-disable-next-line`) correctly, whereas block-style and HTML
|
|
242
|
+
// comments are Block comments. The compiler does not expose a
|
|
243
|
+
// discriminator on the Comment node, so we inspect the raw source text at
|
|
244
|
+
// the start of the comment's span.
|
|
245
|
+
const type = code.startsWith('//', comment.sourceSpan.start.offset)
|
|
246
|
+
? 'Line'
|
|
247
|
+
: 'Block';
|
|
237
248
|
return {
|
|
238
|
-
|
|
239
|
-
type: 'Block',
|
|
249
|
+
type,
|
|
240
250
|
value: comment.value,
|
|
241
251
|
loc: (0, convert_source_span_to_loc_1.convertNodeSourceSpanToLoc)(comment.sourceSpan),
|
|
242
252
|
range: [comment.sourceSpan.start.offset, comment.sourceSpan.end.offset],
|
|
@@ -287,7 +297,7 @@ function parseForESLint(code, options) {
|
|
|
287
297
|
}
|
|
288
298
|
const ast = {
|
|
289
299
|
type: 'Program',
|
|
290
|
-
comments: convertNgAstCommentsToTokens(ngAstCommentNodes),
|
|
300
|
+
comments: convertNgAstCommentsToTokens(ngAstCommentNodes, code),
|
|
291
301
|
tokens: [],
|
|
292
302
|
range: [0, 0],
|
|
293
303
|
loc: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular-eslint/template-parser",
|
|
3
|
-
"version": "22.
|
|
3
|
+
"version": "22.1.1-alpha.0",
|
|
4
4
|
"description": "Angular Template parser for ESLint",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"url": "https://github.com/angular-eslint/angular-eslint.git",
|
|
11
11
|
"directory": "packages/template-parser"
|
|
12
12
|
},
|
|
13
|
+
"bugs": "https://github.com/angular-eslint/angular-eslint/issues",
|
|
13
14
|
"files": [
|
|
14
15
|
"dist",
|
|
15
16
|
"!**/*.tsbuildinfo",
|
|
@@ -19,7 +20,7 @@
|
|
|
19
20
|
],
|
|
20
21
|
"dependencies": {
|
|
21
22
|
"eslint-scope": "9.1.2",
|
|
22
|
-
"@angular-eslint/bundled-angular-compiler": "22.
|
|
23
|
+
"@angular-eslint/bundled-angular-compiler": "22.1.1-alpha.0"
|
|
23
24
|
},
|
|
24
25
|
"peerDependencies": {
|
|
25
26
|
"eslint": "^9.0.0 || ^10.0.0",
|