@angular-eslint/template-parser 12.5.1-alpha.6 → 12.6.1-alpha.10
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/CHANGELOG.md +6 -0
- package/dist/convert-source-span-to-loc.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [12.6.0](https://github.com/angular-eslint/angular-eslint/compare/v12.5.0...v12.6.0) (2021-10-25)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- **bundled-angular-compiler:** create own bundle for `@angular/compiler` ([#720](https://github.com/angular-eslint/angular-eslint/issues/720)) ([0c42299](https://github.com/angular-eslint/angular-eslint/commit/0c422993496bb2670fbd31f55a5fe829704f5112))
|
|
11
|
+
|
|
6
12
|
# [12.5.0](https://github.com/angular-eslint/angular-eslint/compare/v12.4.1...v12.5.0) (2021-09-20)
|
|
7
13
|
|
|
8
14
|
**Note:** Version bump only for package @angular-eslint/template-parser
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ParseSourceSpan, TmplAstElement } from '@angular/compiler';
|
|
1
|
+
import type { ParseSourceSpan, TmplAstElement } from '@angular-eslint/bundled-angular-compiler';
|
|
2
2
|
import type { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils';
|
|
3
3
|
export declare function convertNodeSourceSpanToLoc(sourceSpan: ParseSourceSpan): TSESTree.SourceLocation;
|
|
4
4
|
export declare function convertElementSourceSpanToLoc(context: Readonly<TSESLint.RuleContext<string, readonly unknown[]>>, node: TmplAstElement & {
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=require("@angular/compiler"),t=require("eslint-scope");function n(e){return{start:{line:e.start.line+1,column:e.start.col},end:{line:e.end.line+1,column:e.end.col}}}function o(t,o){if("Element"!==o.type)throw new Error("convertElementSourceSpanToLoc is intented to be used only with elements.");return e.getHtmlTagDefinition(o.name).isVoid&&(o=function(t,n){const{rootNodes:o}=(s||(s=new e.HtmlParser)).parse(t.getSourceCode().getText(),t.getFilename());return r(o,n.sourceSpan)}(t,o)||o),n(o.sourceSpan)}function r(t,n){for(const o of t){if(o.sourceSpan.start.line===n.start.line&&o.sourceSpan.start.offset===n.start.offset)return o;if(o instanceof e.Element){const e=r(o.children,n);if(null!==e)return e}}return null}let s=null;const a={ASTWithSource:["ast"],Binary:["left","right"],BoundAttribute:["value"],BoundEvent:["handler"],BoundText:["value"],Conditional:["condition","trueExp","falseExp"],Element:["children","inputs","outputs","attributes"],Interpolation:["expressions"],PrefixNot:["expression"],Program:["templateNodes"],PropertyRead:["receiver"],Template:["templateAttrs","children","inputs"],BindingPipe:["exp"]};function l(e){let t=null;return"comments"!==e&&"leadingComments"!==e&&"loc"!==e&&"parent"!==e&&"range"!==e&&"tokens"!==e&&"trailingComments"!==e&&null!==(t=this[e])&&"object"==typeof t&&("string"==typeof t.type||Array.isArray(t))}function c(e){return null!==e&&"object"==typeof e&&"string"==typeof e.type}function i(e){let t=0,n=0;const o=a[e.type]||function(e){return Object.keys(e).filter(l,e)}(e);for(t=0;t<o.length;++t){const r=e[o[t]],s=Array.isArray(r);if(void 0!==r.type&&(r.__originalType=r.type),s||r.type||(r.type=r.constructor.name),s)for(n=0;n<r.length;++n){const e=r[n];void 0!==e.type&&(e.__originalType=e.type),e.type&&"number"!=typeof e.type||(e.type=e.constructor.name),c(e)&&i(e)}else c(r)&&i(r)}}function u(r,s){const l=e.parseTemplate(r,s.filePath,{preserveWhitespaces:!0,preserveLineEndings:!0,collectCommentNodes:!0});let c=[];Array.isArray(l.commentNodes)&&(c=l.commentNodes);const u={type:"Program",comments:(p=c,p.map(e=>({type:"Block",value:e.value,loc:n(e.sourceSpan),range:[e.sourceSpan.start.offset,e.sourceSpan.end.offset]})).sort((e,t)=>e.range[0]-t.range[0])),tokens:[],range:[0,0],loc:{start:{line:0,column:0},end:{line:0,column:0}},templateNodes:l.nodes,value:r};var p;const f=new t.ScopeManager({});new t.Scope(f,"module",null,u,!1),i(u);const
|
|
1
|
+
var e=require("@angular-eslint/bundled-angular-compiler"),t=require("eslint-scope");function n(e){return{start:{line:e.start.line+1,column:e.start.col},end:{line:e.end.line+1,column:e.end.col}}}function o(t,o){if("Element"!==o.type)throw new Error("convertElementSourceSpanToLoc is intented to be used only with elements.");return e.getHtmlTagDefinition(o.name).isVoid&&(o=function(t,n){const{rootNodes:o}=(s||(s=new e.HtmlParser)).parse(t.getSourceCode().getText(),t.getFilename());return r(o,n.sourceSpan)}(t,o)||o),n(o.sourceSpan)}function r(t,n){for(const o of t){if(o.sourceSpan.start.line===n.start.line&&o.sourceSpan.start.offset===n.start.offset)return o;if(o instanceof e.Element){const e=r(o.children,n);if(null!==e)return e}}return null}let s=null;const a={ASTWithSource:["ast"],Binary:["left","right"],BoundAttribute:["value"],BoundEvent:["handler"],BoundText:["value"],Conditional:["condition","trueExp","falseExp"],Element:["children","inputs","outputs","attributes"],Interpolation:["expressions"],PrefixNot:["expression"],Program:["templateNodes"],PropertyRead:["receiver"],Template:["templateAttrs","children","inputs"],BindingPipe:["exp"]};function l(e){let t=null;return"comments"!==e&&"leadingComments"!==e&&"loc"!==e&&"parent"!==e&&"range"!==e&&"tokens"!==e&&"trailingComments"!==e&&null!==(t=this[e])&&"object"==typeof t&&("string"==typeof t.type||Array.isArray(t))}function c(e){return null!==e&&"object"==typeof e&&"string"==typeof e.type}function i(e){let t=0,n=0;const o=a[e.type]||function(e){return Object.keys(e).filter(l,e)}(e);for(t=0;t<o.length;++t){const r=e[o[t]],s=Array.isArray(r);if(void 0!==r.type&&(r.__originalType=r.type),s||r.type||(r.type=r.constructor.name),s)for(n=0;n<r.length;++n){const e=r[n];void 0!==e.type&&(e.__originalType=e.type),e.type&&"number"!=typeof e.type||(e.type=e.constructor.name),c(e)&&i(e)}else c(r)&&i(r)}}function u(r,s){const l=e.parseTemplate(r,s.filePath,{preserveWhitespaces:!0,preserveLineEndings:!0,collectCommentNodes:!0});let c=[];Array.isArray(l.commentNodes)&&(c=l.commentNodes);const u={type:"Program",comments:(p=c,p.map(e=>({type:"Block",value:e.value,loc:n(e.sourceSpan),range:[e.sourceSpan.start.offset,e.sourceSpan.end.offset]})).sort((e,t)=>e.range[0]-t.range[0])),tokens:[],range:[0,0],loc:{start:{line:0,column:0},end:{line:0,column:0}},templateNodes:l.nodes,value:r};var p;const f=new t.ScopeManager({});new t.Scope(f,"module",null,u,!1),i(u);const d=function(e){let t=null;return e.templateNodes.forEach(e=>{const n=e.startSourceSpan||e.sourceSpan;t?n&&n.start.offset<t.start.offset&&(t=n):t=n}),t}(u),m=function(e){let t=null;return e.templateNodes.forEach(e=>{const n=e.endSourceSpan||e.sourceSpan;t?n&&n.end.offset>t.end.offset&&(t=n):t=n}),t}(u);return d&&m&&(u.range=[d.start.offset,m.end.offset],u.loc={start:n(d).start,end:n(m).end}),{ast:u,scopeManager:f,visitorKeys:a,services:{convertNodeSourceSpanToLoc:n,convertElementSourceSpanToLoc:o}}}exports.parse=function(e,t){return u(e,t).ast},exports.parseForESLint=u;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular-eslint/template-parser",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.6.1-alpha.10+7a3c73b",
|
|
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": "12.6.1-alpha.10+7a3c73b",
|
|
20
21
|
"eslint-scope": "^5.1.0"
|
|
21
22
|
},
|
|
22
23
|
"peerDependencies": {
|
|
23
|
-
"@angular/compiler": ">= 12.0.0 < 13.0.0",
|
|
24
24
|
"eslint": "*",
|
|
25
25
|
"typescript": "*"
|
|
26
26
|
},
|
|
27
|
-
"gitHead": "
|
|
27
|
+
"gitHead": "7a3c73b80f3d9fd494950ccc426ed59c89781c10"
|
|
28
28
|
}
|