@angular-eslint/template-parser 17.0.0-alpha.0 → 17.0.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.
@@ -0,0 +1,6 @@
1
+ import type { ParseSourceSpan, TmplAstElement } from '@angular-eslint/bundled-angular-compiler';
2
+ import type { TSESLint, TSESTree } from '@typescript-eslint/utils';
3
+ export declare function convertNodeSourceSpanToLoc(sourceSpan: ParseSourceSpan): TSESTree.SourceLocation;
4
+ export declare function convertElementSourceSpanToLoc(context: Readonly<TSESLint.RuleContext<string, readonly unknown[]>>, node: TmplAstElement & {
5
+ type: string;
6
+ }): TSESTree.SourceLocation;
@@ -0,0 +1,44 @@
1
+ import type { ParseError } from '@angular-eslint/bundled-angular-compiler';
2
+ import type { TSESTree } from '@typescript-eslint/types';
3
+ import { ScopeManager } from 'eslint-scope';
4
+ import { convertElementSourceSpanToLoc, convertNodeSourceSpanToLoc } from './convert-source-span-to-loc';
5
+ type NodeOrTokenType = any;
6
+ interface Node {
7
+ [key: string]: any;
8
+ type: NodeOrTokenType;
9
+ }
10
+ interface VisitorKeys {
11
+ [nodeName: string]: string[];
12
+ }
13
+ interface Token extends TSESTree.BaseNode {
14
+ type: NodeOrTokenType;
15
+ value: string;
16
+ }
17
+ interface AST extends Node, Omit<Token, 'parent'> {
18
+ comments: Token[];
19
+ tokens: Token[];
20
+ templateNodes: any[];
21
+ }
22
+ export declare class TemplateParseError extends Error {
23
+ readonly fileName: string;
24
+ readonly index: number;
25
+ readonly lineNumber: number;
26
+ readonly column: number;
27
+ constructor(message: string, fileName: string, index: number, lineNumber: number, column: number);
28
+ }
29
+ export declare function createTemplateParseError(parseError: ParseError): TemplateParseError;
30
+ export interface ParserOptions {
31
+ filePath: string;
32
+ suppressParseErrors?: boolean;
33
+ }
34
+ declare function parseForESLint(code: string, options: ParserOptions): {
35
+ ast: AST;
36
+ scopeManager: ScopeManager;
37
+ visitorKeys: VisitorKeys;
38
+ services: {
39
+ convertElementSourceSpanToLoc: typeof convertElementSourceSpanToLoc;
40
+ convertNodeSourceSpanToLoc: typeof convertNodeSourceSpanToLoc;
41
+ };
42
+ };
43
+ export { parseForESLint };
44
+ export declare function parse(code: string, options: ParserOptions): AST;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular-eslint/template-parser",
3
- "version": "17.0.0-alpha.0",
3
+ "version": "17.0.1-alpha.0+4eddce1",
4
4
  "description": "Angular Template parser for ESLint",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -17,12 +17,12 @@
17
17
  "LICENSE"
18
18
  ],
19
19
  "dependencies": {
20
- "@angular-eslint/bundled-angular-compiler": "17.0.0-alpha.0",
20
+ "@angular-eslint/bundled-angular-compiler": "17.0.1-alpha.0+4eddce1",
21
21
  "eslint-scope": "^7.0.0"
22
22
  },
23
23
  "peerDependencies": {
24
24
  "eslint": "^7.20.0 || ^8.0.0",
25
25
  "typescript": "*"
26
26
  },
27
- "gitHead": "e0478be1ae5b9010ad1d74eac4d06511250bf13f"
27
+ "gitHead": "4eddce1ede6e3baccb297dcbb5b980af95126f64"
28
28
  }