@angular-eslint/template-parser 17.5.3-alpha.0 → 17.5.3-alpha.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.
package/README.md CHANGED
@@ -1 +1,5 @@
1
1
  # @angular-eslint/template-parser
2
+
3
+ Please see https://github.com/angular-eslint/angular-eslint for full usage instructions and guidance.
4
+
5
+ The `@angular-eslint/template-parser` package is a custom parser for ESLint which allows you to write lint rules and run linting using ESLint on Angular templates.
@@ -37,7 +37,7 @@ function tryToFindTheVoidNodeThatMatchesTheSourceSpan(context, node) {
37
37
  // Previously, `codelyzer` used `TemplateParser` to parse a template into an AST tree.
38
38
  // The `TemplateParser` used `HtmlParser`, because `HtmlParser` still sets the end span
39
39
  // for void elements.
40
- const { rootNodes } = getHtmlParser().parse(context.getSourceCode().getText(), context.getFilename());
40
+ const { rootNodes } = getHtmlParser().parse(context.sourceCode.getText(), context.filename);
41
41
  return lookupTheVoidNode(rootNodes, node.sourceSpan);
42
42
  }
43
43
  function lookupTheVoidNode(rootNodes, sourceSpan) {
package/dist/index.d.ts CHANGED
@@ -42,4 +42,9 @@ declare function parseForESLint(code: string, options: ParserOptions): {
42
42
  };
43
43
  export { parseForESLint };
44
44
  export declare function parse(code: string, options: ParserOptions): AST;
45
+ export declare const version: string;
46
+ export declare const meta: {
47
+ name: string;
48
+ version: string;
49
+ };
45
50
  //# sourceMappingURL=index.d.ts.map
@@ -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,EAAS,YAAY,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EACL,6BAA6B,EAC7B,0BAA0B,EAC3B,MAAM,8BAA8B,CAAC;AAEtC,KAAK,eAAe,GAAG,GAAG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rB,kBAAkB,CAOpB;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,iBAAS,cAAc,CACrB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,aAAa,GACrB;IACD,GAAG,EAAE,GAAG,CAAC;IACT,YAAY,EAAE,YAAY,CAAC;IAC3B,WAAW,EAAE,WAAW,CAAC;IACzB,QAAQ,EAAE;QACR,6BAA6B,EAAE,OAAO,6BAA6B,CAAC;QACpE,0BAA0B,EAAE,OAAO,0BAA0B,CAAC;KAC/D,CAAC;CACH,CA4DA;AAED,OAAO,EAAE,cAAc,EAAE,CAAC;AAE1B,wBAAgB,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,GAAG,GAAG,CAE/D;AAID,eAAO,MAAM,OAAO,EAAE,MAA2C,CAAC;AAElE,eAAO,MAAM,IAAI;;;CAGhB,CAAC"}
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.parse = exports.parseForESLint = exports.createTemplateParseError = exports.TemplateParseError = void 0;
3
+ exports.meta = exports.version = exports.parse = exports.parseForESLint = exports.createTemplateParseError = exports.TemplateParseError = void 0;
4
4
  const bundled_angular_compiler_1 = require("@angular-eslint/bundled-angular-compiler");
5
5
  const eslint_scope_1 = require("eslint-scope");
6
6
  const convert_source_span_to_loc_1 = require("./convert-source-span-to-loc");
@@ -218,7 +218,7 @@ function parseForESLint(code, options) {
218
218
  end: (0, convert_source_span_to_loc_1.convertNodeSourceSpanToLoc)(endSourceSpan).end,
219
219
  };
220
220
  }
221
- // TODO: Stop suppressing parse errors by default in v18
221
+ // TODO: Investigate no longer suppressing parse errors by default in v19
222
222
  const suppressParseErrors = options.suppressParseErrors ?? true;
223
223
  if (!suppressParseErrors && angularCompilerResult.errors?.length) {
224
224
  throw createTemplateParseError(angularCompilerResult.errors[0]);
@@ -238,3 +238,10 @@ function parse(code, options) {
238
238
  return parseForESLint(code, options).ast;
239
239
  }
240
240
  exports.parse = parse;
241
+ // NOTE - we cannot migrate this to an import statement because it will make TSC copy the package.json to the dist folder
242
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
243
+ exports.version = require('../package.json').version;
244
+ exports.meta = {
245
+ name: 'angular-eslint/template-parser',
246
+ version: exports.version,
247
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular-eslint/template-parser",
3
- "version": "17.5.3-alpha.0",
3
+ "version": "17.5.3-alpha.1",
4
4
  "description": "Angular Template parser for ESLint",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -18,11 +18,11 @@
18
18
  "LICENSE"
19
19
  ],
20
20
  "dependencies": {
21
- "@angular-eslint/bundled-angular-compiler": "17.5.3-alpha.0",
21
+ "@angular-eslint/bundled-angular-compiler": "17.5.3-alpha.1",
22
22
  "eslint-scope": "^8.0.0"
23
23
  },
24
24
  "peerDependencies": {
25
- "eslint": "^7.20.0 || ^8.0.0",
25
+ "eslint": "^8.57.0 || ^9.0.0",
26
26
  "typescript": "*"
27
27
  },
28
28
  "gitHead": "e2006e5e9c99e5a943d1a999e0efa5247d29ec24"