@angular-eslint/eslint-plugin 12.2.3-alpha.4 → 12.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.
- package/CHANGELOG.md +21 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- package/dist/rules/component-selector.d.ts +1 -1
- package/dist/rules/no-input-prefix.d.ts +3 -5
- package/dist/rules/no-input-rename.d.ts +5 -7
- package/dist/rules/no-pipe-impure.d.ts +2 -2
- package/dist/utils/get-aria-attribute-keys.d.ts +1 -0
- package/dist/utils/selectors.d.ts +10 -1
- package/dist/utils/utils.d.ts +3 -3
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,27 @@
|
|
|
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.3.1](https://github.com/angular-eslint/angular-eslint/compare/v12.3.0...v12.3.1) (2021-07-15)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- **eslint-plugin:** handle literal `outputs` properly for [*-output-*] rules ([#595](https://github.com/angular-eslint/angular-eslint/issues/595)) ([8621a62](https://github.com/angular-eslint/angular-eslint/commit/8621a62a5360caac33fd87001e2928d7995a5a01))
|
|
11
|
+
|
|
12
|
+
# [12.3.0](https://github.com/angular-eslint/angular-eslint/compare/v12.2.2...v12.3.0) (2021-07-13)
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
- **eslint-plugin:** [no-input-prefix] handle alias and `inputs` metadata property ([#582](https://github.com/angular-eslint/angular-eslint/issues/582)) ([675ee11](https://github.com/angular-eslint/angular-eslint/commit/675ee11f541e9e08c87df75a9004a12d0f0403bf))
|
|
17
|
+
- **eslint-plugin:** [no-input-rename] handle alias and `inputs` metadata property ([#583](https://github.com/angular-eslint/angular-eslint/issues/583)) ([2883e18](https://github.com/angular-eslint/angular-eslint/commit/2883e185abca4cfd2a7191f5c10742d521f48a89))
|
|
18
|
+
- **eslint-plugin:** [use-component-view-encapsulation] handle literal `encapsulation` properly ([#586](https://github.com/angular-eslint/angular-eslint/issues/586)) ([3a9b7f4](https://github.com/angular-eslint/angular-eslint/commit/3a9b7f4056b33918ead342efa331d21b9b1f4309))
|
|
19
|
+
- **eslint-plugin:** [use-pipe-transform-interface] handle type imports properly in fix ([#592](https://github.com/angular-eslint/angular-eslint/issues/592)) ([ac3fb12](https://github.com/angular-eslint/angular-eslint/commit/ac3fb126f1171284db6a52775c044aaedef2b90e))
|
|
20
|
+
|
|
21
|
+
### Features
|
|
22
|
+
|
|
23
|
+
- **eslint-plugin:** [component-selector] handle shadow dom components properly ([#559](https://github.com/angular-eslint/angular-eslint/issues/559)) ([ecbe684](https://github.com/angular-eslint/angular-eslint/commit/ecbe68431fb73177d905676fef3df9be9c646636))
|
|
24
|
+
- **eslint-plugin:** [no-pipe-impure] add suggestion ([#585](https://github.com/angular-eslint/angular-eslint/issues/585)) ([149bf2f](https://github.com/angular-eslint/angular-eslint/commit/149bf2ffe0af7af1b0fc6b249321b50cf5d9f0a6))
|
|
25
|
+
- **schematics:** better support @angular/cli 12.1 ([#591](https://github.com/angular-eslint/angular-eslint/issues/591)) ([c5da07b](https://github.com/angular-eslint/angular-eslint/commit/c5da07b2d0c506dde24f0abc3e212db9deeaca82))
|
|
26
|
+
|
|
6
27
|
## [12.2.2](https://github.com/angular-eslint/angular-eslint/compare/v12.2.1...v12.2.2) (2021-07-10)
|
|
7
28
|
|
|
8
29
|
### Bug Fixes
|
package/dist/index.d.ts
CHANGED
|
@@ -280,9 +280,9 @@ declare const _default: {
|
|
|
280
280
|
readonly allowStatic?: boolean | undefined;
|
|
281
281
|
}], import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleListener>;
|
|
282
282
|
"no-input-prefix": import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleModule<"noInputPrefix", [{
|
|
283
|
-
prefixes: string[];
|
|
283
|
+
readonly prefixes: readonly string[];
|
|
284
284
|
}], import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleListener>;
|
|
285
|
-
"no-input-rename": import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleModule<"
|
|
285
|
+
"no-input-rename": import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleModule<import("./rules/no-input-rename").MessageIds, [{
|
|
286
286
|
readonly allowedNames?: readonly string[] | undefined;
|
|
287
287
|
}], import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleListener>;
|
|
288
288
|
"no-inputs-metadata-property": import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleModule<"noInputsMetadataProperty", [], import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleListener>;
|
|
@@ -291,7 +291,7 @@ declare const _default: {
|
|
|
291
291
|
"no-output-on-prefix": import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleModule<"noOutputOnPrefix", [], import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleListener>;
|
|
292
292
|
"no-output-rename": import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleModule<import("./rules/no-output-rename").MessageIds, [], import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleListener>;
|
|
293
293
|
"no-outputs-metadata-property": import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleModule<"noOutputsMetadataProperty", [], import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleListener>;
|
|
294
|
-
"no-pipe-impure": import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleModule<"
|
|
294
|
+
"no-pipe-impure": import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleModule<import("./rules/no-pipe-impure").MessageIds, [], import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleListener>;
|
|
295
295
|
"no-queries-metadata-property": import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleModule<"noQueriesMetadataProperty", [], import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleListener>;
|
|
296
296
|
"no-empty-lifecycle-method": import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleModule<import("./rules/no-empty-lifecycle-method").MessageIds, [], import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleListener>;
|
|
297
297
|
"prefer-on-push-component-change-detection": import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleModule<"preferOnPushComponentChangeDetection", [], import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleListener>;
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=require("@typescript-eslint/experimental-utils"),t=require("@angular/compiler");const r=e.ESLintUtils.RuleCreator(e=>"https://github.com/angular-eslint/angular-eslint");function n(){return(n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function a(e){var t={exports:{}};return e(t,t.exports),t.exports}var s=a(function(e,t){var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.AST_TOKEN_TYPES=t.AST_NODE_TYPES=void 0,(r=t.AST_NODE_TYPES||(t.AST_NODE_TYPES={})).ArrayExpression="ArrayExpression",r.ArrayPattern="ArrayPattern",r.ArrowFunctionExpression="ArrowFunctionExpression",r.AssignmentExpression="AssignmentExpression",r.AssignmentPattern="AssignmentPattern",r.AwaitExpression="AwaitExpression",r.BinaryExpression="BinaryExpression",r.BlockStatement="BlockStatement",r.BreakStatement="BreakStatement",r.CallExpression="CallExpression",r.CatchClause="CatchClause",r.ChainExpression="ChainExpression",r.ClassBody="ClassBody",r.ClassDeclaration="ClassDeclaration",r.ClassExpression="ClassExpression",r.ClassProperty="ClassProperty",r.ConditionalExpression="ConditionalExpression",r.ContinueStatement="ContinueStatement",r.DebuggerStatement="DebuggerStatement",r.Decorator="Decorator",r.DoWhileStatement="DoWhileStatement",r.EmptyStatement="EmptyStatement",r.ExportAllDeclaration="ExportAllDeclaration",r.ExportDefaultDeclaration="ExportDefaultDeclaration",r.ExportNamedDeclaration="ExportNamedDeclaration",r.ExportSpecifier="ExportSpecifier",r.ExpressionStatement="ExpressionStatement",r.ForInStatement="ForInStatement",r.ForOfStatement="ForOfStatement",r.ForStatement="ForStatement",r.FunctionDeclaration="FunctionDeclaration",r.FunctionExpression="FunctionExpression",r.Identifier="Identifier",r.IfStatement="IfStatement",r.ImportDeclaration="ImportDeclaration",r.ImportDefaultSpecifier="ImportDefaultSpecifier",r.ImportExpression="ImportExpression",r.ImportNamespaceSpecifier="ImportNamespaceSpecifier",r.ImportSpecifier="ImportSpecifier",r.JSXAttribute="JSXAttribute",r.JSXClosingElement="JSXClosingElement",r.JSXClosingFragment="JSXClosingFragment",r.JSXElement="JSXElement",r.JSXEmptyExpression="JSXEmptyExpression",r.JSXExpressionContainer="JSXExpressionContainer",r.JSXFragment="JSXFragment",r.JSXIdentifier="JSXIdentifier",r.JSXMemberExpression="JSXMemberExpression",r.JSXNamespacedName="JSXNamespacedName",r.JSXOpeningElement="JSXOpeningElement",r.JSXOpeningFragment="JSXOpeningFragment",r.JSXSpreadAttribute="JSXSpreadAttribute",r.JSXSpreadChild="JSXSpreadChild",r.JSXText="JSXText",r.LabeledStatement="LabeledStatement",r.Literal="Literal",r.LogicalExpression="LogicalExpression",r.MemberExpression="MemberExpression",r.MetaProperty="MetaProperty",r.MethodDefinition="MethodDefinition",r.NewExpression="NewExpression",r.ObjectExpression="ObjectExpression",r.ObjectPattern="ObjectPattern",r.Program="Program",r.Property="Property",r.RestElement="RestElement",r.ReturnStatement="ReturnStatement",r.SequenceExpression="SequenceExpression",r.SpreadElement="SpreadElement",r.Super="Super",r.SwitchCase="SwitchCase",r.SwitchStatement="SwitchStatement",r.TaggedTemplateExpression="TaggedTemplateExpression",r.TemplateElement="TemplateElement",r.TemplateLiteral="TemplateLiteral",r.ThisExpression="ThisExpression",r.ThrowStatement="ThrowStatement",r.TryStatement="TryStatement",r.UnaryExpression="UnaryExpression",r.UpdateExpression="UpdateExpression",r.VariableDeclaration="VariableDeclaration",r.VariableDeclarator="VariableDeclarator",r.WhileStatement="WhileStatement",r.WithStatement="WithStatement",r.YieldExpression="YieldExpression",r.TSAbstractClassProperty="TSAbstractClassProperty",r.TSAbstractKeyword="TSAbstractKeyword",r.TSAbstractMethodDefinition="TSAbstractMethodDefinition",r.TSAnyKeyword="TSAnyKeyword",r.TSArrayType="TSArrayType",r.TSAsExpression="TSAsExpression",r.TSAsyncKeyword="TSAsyncKeyword",r.TSBigIntKeyword="TSBigIntKeyword",r.TSBooleanKeyword="TSBooleanKeyword",r.TSCallSignatureDeclaration="TSCallSignatureDeclaration",r.TSClassImplements="TSClassImplements",r.TSConditionalType="TSConditionalType",r.TSConstructorType="TSConstructorType",r.TSConstructSignatureDeclaration="TSConstructSignatureDeclaration",r.TSDeclareFunction="TSDeclareFunction",r.TSDeclareKeyword="TSDeclareKeyword",r.TSEmptyBodyFunctionExpression="TSEmptyBodyFunctionExpression",r.TSEnumDeclaration="TSEnumDeclaration",r.TSEnumMember="TSEnumMember",r.TSExportAssignment="TSExportAssignment",r.TSExportKeyword="TSExportKeyword",r.TSExternalModuleReference="TSExternalModuleReference",r.TSFunctionType="TSFunctionType",r.TSImportEqualsDeclaration="TSImportEqualsDeclaration",r.TSImportType="TSImportType",r.TSIndexedAccessType="TSIndexedAccessType",r.TSIndexSignature="TSIndexSignature",r.TSInferType="TSInferType",r.TSInterfaceBody="TSInterfaceBody",r.TSInterfaceDeclaration="TSInterfaceDeclaration",r.TSInterfaceHeritage="TSInterfaceHeritage",r.TSIntersectionType="TSIntersectionType",r.TSIntrinsicKeyword="TSIntrinsicKeyword",r.TSLiteralType="TSLiteralType",r.TSMappedType="TSMappedType",r.TSMethodSignature="TSMethodSignature",r.TSModuleBlock="TSModuleBlock",r.TSModuleDeclaration="TSModuleDeclaration",r.TSNamedTupleMember="TSNamedTupleMember",r.TSNamespaceExportDeclaration="TSNamespaceExportDeclaration",r.TSNeverKeyword="TSNeverKeyword",r.TSNonNullExpression="TSNonNullExpression",r.TSNullKeyword="TSNullKeyword",r.TSNumberKeyword="TSNumberKeyword",r.TSObjectKeyword="TSObjectKeyword",r.TSOptionalType="TSOptionalType",r.TSParameterProperty="TSParameterProperty",r.TSParenthesizedType="TSParenthesizedType",r.TSPrivateKeyword="TSPrivateKeyword",r.TSPropertySignature="TSPropertySignature",r.TSProtectedKeyword="TSProtectedKeyword",r.TSPublicKeyword="TSPublicKeyword",r.TSQualifiedName="TSQualifiedName",r.TSReadonlyKeyword="TSReadonlyKeyword",r.TSRestType="TSRestType",r.TSStaticKeyword="TSStaticKeyword",r.TSStringKeyword="TSStringKeyword",r.TSSymbolKeyword="TSSymbolKeyword",r.TSTemplateLiteralType="TSTemplateLiteralType",r.TSThisType="TSThisType",r.TSTupleType="TSTupleType",r.TSTypeAliasDeclaration="TSTypeAliasDeclaration",r.TSTypeAnnotation="TSTypeAnnotation",r.TSTypeAssertion="TSTypeAssertion",r.TSTypeLiteral="TSTypeLiteral",r.TSTypeOperator="TSTypeOperator",r.TSTypeParameter="TSTypeParameter",r.TSTypeParameterDeclaration="TSTypeParameterDeclaration",r.TSTypeParameterInstantiation="TSTypeParameterInstantiation",r.TSTypePredicate="TSTypePredicate",r.TSTypeQuery="TSTypeQuery",r.TSTypeReference="TSTypeReference",r.TSUndefinedKeyword="TSUndefinedKeyword",r.TSUnionType="TSUnionType",r.TSUnknownKeyword="TSUnknownKeyword",r.TSVoidKeyword="TSVoidKeyword",(n=t.AST_TOKEN_TYPES||(t.AST_TOKEN_TYPES={})).Boolean="Boolean",n.Identifier="Identifier",n.JSXIdentifier="JSXIdentifier",n.JSXText="JSXText",n.Keyword="Keyword",n.Null="Null",n.Numeric="Numeric",n.Punctuator="Punctuator",n.RegularExpression="RegularExpression",n.String="String",n.Template="Template",n.Block="Block",n.Line="Line"});Object.defineProperty(exports,"__esModule",{value:!0});var i={__proto__:null};Object.defineProperty(exports,"__esModule",{value:!0});var l={__proto__:null},c=a(function(e,t){var r=o&&o.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=o&&o.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=o&&o.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)"default"!==o&&Object.prototype.hasOwnProperty.call(e,o)&&r(t,e,o);return n(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.TSESTree=void 0,t.TSESTree=a(s)}),p=a(function(e,t){var r=o&&o.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=o&&o.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.AST_TOKEN_TYPES=t.AST_NODE_TYPES=void 0,Object.defineProperty(t,"AST_NODE_TYPES",{enumerable:!0,get:function(){return s.AST_NODE_TYPES}});var a=s;Object.defineProperty(t,"AST_TOKEN_TYPES",{enumerable:!0,get:function(){return a.AST_TOKEN_TYPES}}),n(i,t),n(l,t),n(c,t)});const u=Object.keys;var d,m,g,f;!function(e){e.Component="Component",e.Directive="Directive",e.Injectable="Injectable",e.NgModule="NgModule",e.Pipe="Pipe"}(d||(d={})),function(e){e.Attribute="Attribute",e.Host="Host",e.Inject="Inject",e.Optional="Optional",e.Self="Self",e.SkipSelf="SkipSelf"}(m||(m={})),function(e){e.HostListener="HostListener"}(g||(g={})),function(e){e.ContentChild="ContentChild",e.ContentChildren="ContentChildren",e.HostBinding="HostBinding",e.Input="Input",e.Output="Output",e.ViewChild="ViewChild",e.ViewChildren="ViewChildren"}(f||(f={}));const y=n({},m,g,f);var h,S;!function(e){e.AfterContentChecked="AfterContentChecked",e.AfterContentInit="AfterContentInit",e.AfterViewChecked="AfterViewChecked",e.AfterViewInit="AfterViewInit",e.DoBootstrap="DoBootstrap",e.DoCheck="DoCheck",e.OnChanges="OnChanges",e.OnDestroy="OnDestroy",e.OnInit="OnInit"}(h||(h={})),function(e){e.ngAfterContentChecked="ngAfterContentChecked",e.ngAfterContentInit="ngAfterContentInit",e.ngAfterViewChecked="ngAfterViewChecked",e.ngAfterViewInit="ngAfterViewInit",e.ngDoBootstrap="ngDoBootstrap",e.ngDoCheck="ngDoCheck",e.ngOnChanges="ngOnChanges",e.ngOnDestroy="ngOnDestroy",e.ngOnInit="ngOnInit"}(S||(S={}));const T="camelCase",x="kebab-case",v=u(d),b=u(y),E=u(h),w=u(S),D=new Map([[d.Component,new Set([S.ngAfterContentChecked,S.ngAfterContentInit,S.ngAfterViewChecked,S.ngAfterViewInit,S.ngOnChanges,S.ngOnDestroy,S.ngOnInit,S.ngDoCheck])],[d.Directive,new Set([S.ngAfterContentChecked,S.ngAfterContentInit,S.ngAfterViewChecked,S.ngAfterViewInit,S.ngOnChanges,S.ngOnDestroy,S.ngOnInit,S.ngDoCheck])],[d.Injectable,new Set([S.ngOnDestroy])],[d.NgModule,new Set([S.ngDoBootstrap])],[d.Pipe,new Set([S.ngOnDestroy])]]),C=new Set(b),P=new Set(v),I=new Map([[d.Component,C],[d.Directive,C],[d.Injectable,new Set([y.Host,y.Inject,y.Optional,y.Self,y.SkipSelf])],[d.NgModule,new Set([y.Host,y.Inject,y.Optional,y.Self,y.SkipSelf])],[d.Pipe,new Set([y.Host,y.Inject,y.Optional,y.Self,y.SkipSelf])]]);function O(e){return e.type===p.AST_NODE_TYPES.CallExpression}function A(e){return e.type===p.AST_NODE_TYPES.ClassDeclaration}function k(e){return function(e){return e.type===p.AST_NODE_TYPES.ClassProperty}(e)||L(e)}function N(e){return e.type===p.AST_NODE_TYPES.ObjectExpression}function M(e){return e.type===p.AST_NODE_TYPES.ArrayExpression}function j(e){return e.type===p.AST_NODE_TYPES.Property}function _(e){return e.type===p.AST_NODE_TYPES.Program}function B(e){return e.type===p.AST_NODE_TYPES.Literal}function R(e){return e.type===p.AST_NODE_TYPES.TemplateLiteral}function $(e){return e.type===p.AST_NODE_TYPES.ImportDeclaration}function U(e){return e.type===p.AST_NODE_TYPES.ImportSpecifier}function K(e){return B(e)&&"string"==typeof e.value}function L(e){return e.type===p.AST_NODE_TYPES.MethodDefinition}function V({parent:e},t){for(;e&&!_(e);){if(t(e))return e;e=e.parent}return null}function F(e,t){let r=e;for(;r=r.parent;)if(_(r))return r.body.filter(e=>$(e)&&e.source.value===t);return r}function J(t,r,n,o){const{implements:a}=r;if(!a)return;const s=a.map(({expression:e})=>e).filter(e.ASTUtils.isIdentifier).find(({name:e})=>e===n);if(!s)return;const i=a[0].expression===s;if(i&&a[a.length-1].expression===s&&r.id)return o.removeRange([r.id.range[1],a[0].range[1]]);const l=t.getTokenAfter(s);if(i&&l)return o.removeRange([s.range[0],l.range[1]]);const c=t.getTokenBefore(s);return c?o.removeRange([c.range[0],s.range[1]]):void 0}function X(t,r,n){const o=t.getTokenAfter(r);return o&&e.ASTUtils.isCommaToken(o)?n.removeRange([r.range[0],o.range[1]]):n.remove(r)}function q(e){return e.slice(-1)[0]}function Y(e,t,r,n){const o=F(e,t);if(null==o||!o.length)return n.insertTextAfterRange([0,0],`import { ${r} } from '${t}';\n`);const a=q(o[0].specifiers);return n.insertTextAfter(a,`, ${r}`)}function H(e,t,r,n){var o;const{importDeclaration:a,importSpecifier:s}=null!=(o=function(e,t){for(const r of e){const e=r.specifiers.find(e=>U(e)&&e.imported.name===t);if(e)return{importDeclaration:r,importSpecifier:e}}}(t,r))?o:{};if(!a||!s)return;const i=a.specifiers[0]===s;if(i&&a.specifiers[a.specifiers.length-1]===s)return n.remove(a);const l=e.getTokenAfter(s);if(i&&l)return n.removeRange([s.range[0],l.range[1]]);const c=e.getTokenBefore(s);return c?n.removeRange([c.range[0],s.range[1]]):void 0}const W=e=>{var t;return A(e)?null==(t=e.id)?void 0:t.name:e.parent?W(e.parent):void 0},z=({decorators:e})=>null==e?void 0:e.map(G).filter(pe).find(ae),G=({expression:t})=>e.ASTUtils.isIdentifier(t)?t.name:O(t)&&e.ASTUtils.isIdentifier(t.callee)?t.callee.name:void 0,Q=e=>{var t;return null!=(t=e.implements)?t:[]},Z=t=>Q(t).map(({expression:e})=>function(e){return e.type===p.AST_NODE_TYPES.MemberExpression}(e)?e.property:e).filter(e.ASTUtils.isIdentifier).map(({name:e})=>e),ee=e=>Z(e).filter(ne),te=new Set(E),re=new Set(w),ne=e=>te.has(e),oe=e=>re.has(e),ae=e=>P.has(e),se=(t,r)=>{var n;return null==(n=((t,r)=>{var n;return null==(n=(({expression:e})=>{if(!O(e)||0===e.arguments.length)return;const[t]=e.arguments;return N(t)&&t.properties?t:void 0})(t))?void 0:n.properties.filter(j).find(({key:t})=>e.ASTUtils.isIdentifier(t)&&t.name===r)})(t,r))?void 0:n.value},ie=({body:{body:e}})=>e.filter(L),le=t=>K(t.key)?t.key.value:e.ASTUtils.isIdentifier(t.key)?t.key.name:void 0;function ce(e){return Array.isArray(e)?e:e?[e]:[]}const pe=e=>null!=e,ue={attribute:e=>0!==e.length,camelCase:e=>/^[a-zA-Z0-9[\]]+$/.test(e),element:e=>null!==e,kebabCase:e=>/^[a-z0-9-]+-[a-z0-9-]+$/.test(e),prefix(e,t){const r=new RegExp(`^\\[?(${e})`);return n=>{if(!e)return!0;if(!r.test(n))return!1;const o=n.replace(r,"");if(t===T)return!o||o[0]===o[0].toUpperCase();if(t===x)return!o||"-"===o[0];throw Error("Invalid selector style!")}}};function de(e,t){const r=F(e,t);return Boolean(null==r?void 0:r.some(t=>t.specifiers.some(t=>U(t)&&t.imported.name===e.name&&t.local.name===e.name)))}const me=e=>{const t=e.length;return 1===t?`"${e[0]}"`:`${e.map(e=>`"${e}"`).slice(0,t-1).join(", ")} or "${[...e].pop()}"`},ge=e=>RegExp(`^(${e.join("|")})$`);function fe(t){return e.ASTUtils.isIdentifier(t)?t.name:K(t)?t.value:t.value.raw}function ye(e,t){return K(e)?`'${t}'`:`\`${t}\``}function he(e){return e.replace(/[[\]\s]/g,"")}var Se=r({name:"contextual-decorator",meta:{type:"suggestion",docs:{description:"Ensures that classes use contextual decorators in its body",category:"Best Practices",recommended:!1},schema:[],messages:{contextualDecorator:'Decorator out of context for "@{{classDecoratorName}}()"'}},defaultOptions:[],create:e=>({"MethodDefinition[kind=/^(get|set|method)$/], ClassProperty, TSParameterProperty"(t){!function(e,t){var r;if(null==(r=t.decorators)||!r.length)return;const n=V(t,A);if(!n)return;const o=z(n);if(o)for(const r of t.decorators)Te(e,r,o)}(e,t)}})});function Te(e,t,r){const n=G(t);if(!n||!C.has(n))return;const o=I.get(r);null!=o&&o.has(n)||e.report({node:t,messageId:"contextualDecorator",data:{classDecoratorName:r}})}const xe="ClassDeclaration > Decorator[expression.callee.name=/^(Component|Directive)$/]",ve='ClassDeclaration > Decorator[expression.callee.name="Component"]',be='ClassDeclaration > Decorator[expression.callee.name="Directive"]',Ee='ClassDeclaration > Decorator[expression.callee.name="Pipe"]',we='Decorator[expression.callee.name="Output"]',De=`${xe} Property[key.name='outputs'] > ArrayExpression :matches(Literal, TemplateElement)`,Ce=`:matches(ClassProperty, MethodDefinition[kind='get']) ${we} :matches(Literal, TemplateElement)`,Pe=`:matches(ClassProperty, MethodDefinition[kind='get'])[computed=false]:has(${we}) > :matches(Identifier, Literal)`;var Ie=r({name:"component-class-suffix",meta:{type:"suggestion",docs:{description:'Classes decorated with @Component must have suffix "Component" (or custom) in their name. See more at https://angular.io/styleguide#style-02-03',category:"Best Practices",recommended:"error"},schema:[{type:"object",properties:{suffixes:{type:"array",items:{type:"string"}}},additionalProperties:!1}],messages:{componentClassSuffix:"Component class names should end with one of these suffixes: {{suffixes}} (https://angular.io/styleguide#style-02-03)"}},defaultOptions:[{suffixes:["Component"]}],create:(e,[{suffixes:t}])=>({[ve](r){const n=r.parent,o=W(n);o&&t.some(e=>o.endsWith(e))||e.report({node:n.id?n.id:n,messageId:"componentClassSuffix",data:{suffixes:me(t)}})}})});const Oe=/\r\n|\r|\n/;function Ae(e){return R(e)?e.quasis[0].value.raw.trim().split(Oe).length:B(e)?e.raw.trim().split(Oe).length:0}var ke=r({name:"component-max-inline-declarations",meta:{type:"suggestion",docs:{description:"Enforces a maximum number of lines in inline template, styles and animations. See more at https://angular.io/guide/styleguide#style-05-04",category:"Best Practices",recommended:!1},schema:[{type:"object",properties:{template:{minimum:0,type:"number"},styles:{minimum:0,type:"number"},animations:{minimum:0,type:"number"}},additionalProperties:!1}],messages:{componentMaxInlineDeclarations:"`{{propertyType}}` has too many lines ({{lineCount}}). Maximum allowed is {{max}} (https://angular.io/guide/styleguide#style-05-04)"}},defaultOptions:[{template:3,styles:3,animations:15}],create:(e,[{template:t=3,styles:r=3,animations:n=15}])=>({[`${ve} Property[key.name='template']`]({value:r}){const n=Ae(r);n<=t||e.report({node:r,messageId:"componentMaxInlineDeclarations",data:{lineCount:n,max:t,propertyType:"template"}})},[`${ve} Property[key.name='styles']`]({value:t}){if(!M(t))return;const n=t.elements.reduce((e,t)=>e+Ae(t),0);n<=r||e.report({node:t,messageId:"componentMaxInlineDeclarations",data:{lineCount:n,max:r,propertyType:"styles"}})},[`${ve} Property[key.name='animations']`]({value:t}){if(!M(t)||0===t.elements.length)return;const r=Math.max(t.loc.end.line-t.loc.start.line-2,1);r<=n||e.report({node:t,messageId:"componentMaxInlineDeclarations",data:{lineCount:r,max:n,propertyType:"animations"}})}})});const Ne="attribute",Me="element",je={[Ne]:"attrs",[Me]:Me},_e=(e,t,r)=>{r.report({node:e,messageId:"prefixFailure",data:{prefix:me(ce(t))}})},Be=(e,t,r)=>{r.report({node:e,messageId:"styleFailure",data:{style:t}})},Re=(e,t,r)=>{r.report({node:e,messageId:"typeFailure",data:{type:t}})},$e=(e,t,r)=>{const n=ce(e),o=r,a=n.length>0&&n.every(e=>-1!==[Me,Ne].indexOf(e)),s=t.length>0,i=-1!==[T,x].indexOf(o);return a&&s&&i},Ue=(e,r,n,o)=>{const a=ce(r||["attrs",Me]).reduce((e,t)=>e.concat(je[t]),[]),s=o===x?ue.kebabCase:ue.camelCase;let i=null;if(e&&B(e)?i=t.CssSelector.parse(e.raw):e&&R(e)&&e.quasis[0]&&(i=t.CssSelector.parse(e.quasis[0].value.raw)),!i)return null;const l=((e,t)=>e.reduce((e,r)=>{const n=t.reduce((e,t)=>{const n=r[t];return n?e.concat(n):e},[]);return e.concat(n)},[]))(i,a),c=l.some(e=>n.some(t=>ue.prefix(t,o)(e))),p=l.some(e=>s(e));return{hasExpectedPrefix:c,hasExpectedType:l.length>0,hasExpectedStyle:p}};var Ke=r({name:"component-selector",meta:{type:"suggestion",docs:{description:"Component selectors should follow given naming rules. See more at https://angular.io/guide/styleguide#style-02-07, https://angular.io/guide/styleguide#style-05-02\n and https://angular.io/guide/styleguide#style-05-03.",category:"Best Practices",recommended:!1},schema:[{type:"object",properties:{type:{oneOf:[{type:"string"},{type:"array",items:{enum:[Me,Ne]}}]},prefix:{oneOf:[{type:"string"},{type:"array"}]},style:{type:"string",enum:[T,x]}},additionalProperties:!1}],messages:{prefixFailure:"The selector should start with one of these prefixes: {{prefix}} (https://angular.io/guide/styleguide#style-02-07)",styleFailure:"The selector should be {{style}} (https://angular.io/guide/styleguide#style-05-02)",typeFailure:"The selector should be used as an {{type}} (https://angular.io/guide/styleguide#style-05-03)"}},defaultOptions:[{type:"",prefix:"",style:""}],create:(e,[{type:t,prefix:r,style:n}])=>({[ve](o){const a=se(o,"selector");if(!a)return;if(!$e(t,r,n))return;const s=Ue(a,t,ce(r),n);null!==s&&(s.hasExpectedType?s.hasExpectedStyle?s.hasExpectedPrefix||_e(a,r,e):Be(a,n,e):Re(a,t,e))}})}),Le=r({name:"contextual-lifecycle",meta:{type:"problem",docs:{description:"Ensures that lifecycle methods are used in a correct context",category:"Possible Errors",recommended:"error"},schema:[],messages:{contextualLifecycle:"Angular will not invoke the `{{methodName}}` lifecycle method within `@{{classDecoratorName}}()` classes"}},defaultOptions:[],create(e){function t({parent:t},r){const n=t,o=D.get(r),a=ie(n);for(const t of a){const n=le(t);!n||!oe(n)||null!=o&&o.has(n)||e.report({node:t.key,messageId:"contextualLifecycle",data:{classDecoratorName:r,methodName:n}})}}return{[ve](e){t(e,d.Component)},[be](e){t(e,d.Directive)},'ClassDeclaration > Decorator[expression.callee.name="Injectable"]'(e){t(e,d.Injectable)},'ClassDeclaration > Decorator[expression.callee.name="NgModule"]'(e){t(e,d.NgModule)},[Ee](e){t(e,d.Pipe)}}}}),Ve=r({name:"directive-class-suffix",meta:{type:"suggestion",docs:{description:'Classes decorated with @Directive must have suffix "Directive" (or custom) in their name. See more at https://angular.io/styleguide#style-02-03',category:"Best Practices",recommended:"error"},schema:[{type:"object",properties:{suffixes:{type:"array",items:{type:"string"}}},additionalProperties:!1}],messages:{directiveClassSuffix:"Directive class names should end with one of these suffixes: {{suffixes}} (https://angular.io/styleguide#style-02-03)"}},defaultOptions:[{suffixes:["Directive"]}],create:(e,[{suffixes:t}])=>({[be](r){if(!se(r,"selector"))return;const n=r.parent,o=W(n),a=Z(n).some(e=>e.endsWith("Validator")),s=t.concat(a?"Validator":[]);var i;o&&s.some(e=>o.endsWith(e))||e.report({node:null!=(i=n.id)?i:n,messageId:"directiveClassSuffix",data:{suffixes:me(s)}})}})}),Fe=r({name:"directive-selector",meta:{type:"suggestion",docs:{description:"Directive selectors should follow given naming rules. See more at https://angular.io/guide/styleguide#style-02-06 and https://angular.io/guide/styleguide#style-02-08.",category:"Best Practices",recommended:!1},schema:[{type:"object",properties:{type:{oneOf:[{type:"string"},{type:"array",items:{enum:[Me,Ne]}}]},prefix:{oneOf:[{type:"string"},{type:"array"}]},style:{type:"string",enum:[T,x]}},additionalProperties:!1}],messages:{prefixFailure:"The selector should start with one of these prefixes: {{prefix}} (https://angular.io/guide/styleguide#style-02-08)",styleFailure:"The selector should be {{style}} (https://angular.io/guide/styleguide#style-02-06)",typeFailure:"The selector should be used as an {{type}} (https://angular.io/guide/styleguide#style-02-06)"}},defaultOptions:[{type:"",prefix:"",style:""}],create:(e,[{type:t,prefix:r,style:n}])=>({[be](o){const a=se(o,"selector");if(!a)return;if(!$e(t,r,n))return;const s=Ue(a,t,ce(r),n);null!==s&&(s.hasExpectedType?s.hasExpectedStyle?s.hasExpectedPrefix||_e(a,r,e):Be(a,n,e):Re(a,t,e))}})}),Je=r({name:"no-attribute-decorator",meta:{type:"problem",docs:{description:"Disallows usage of @Attribute decorator.",category:"Possible Errors",recommended:!1},schema:[],messages:{noAttributeDecorator:"The usage of @Attribute is considered a bad practice. Use @Input instead"}},defaultOptions:[],create:e=>({'ClassDeclaration MethodDefinition[key.name="constructor"] Decorator[expression.callee.name="Attribute"]'(t){e.report({node:t,messageId:"noAttributeDecorator"})}})});const Xe=[h.DoCheck,h.OnChanges],qe=[S.ngDoCheck,S.ngOnChanges];var Ye=r({name:"no-conflicting-lifecycle",meta:{type:"suggestion",docs:{description:"Ensures that directives not implement conflicting lifecycle interfaces.",category:"Best Practices",recommended:"error"},schema:[],messages:{noConflictingLifecycleInterface:`Implementing ${h.DoCheck} and ${h.OnChanges} in a class is not recommended`,noConflictingLifecycleMethod:`Declaring ${S.ngDoCheck} and ${S.ngOnChanges} method in a class is not recommended`}},defaultOptions:[],create:t=>({ClassDeclaration(r){(r=>{const n=ee(r);if(!Xe.every(e=>n.includes(e)))return;const o=Q(r).filter(t=>e.ASTUtils.isIdentifier(t.expression)&&ne(t.expression.name));for(const e of o)t.report({node:e,messageId:"noConflictingLifecycleInterface"})})(r),(r=>{const n=(e=>ie(e).map(le).filter(pe).filter(oe))(r);if(!qe.every(e=>n.includes(e)))return;const o=ie(r).filter(t=>e.ASTUtils.isIdentifier(t.key)&&oe(t.key.name));for(const e of o)t.report({node:e,messageId:"noConflictingLifecycleMethod"})})(r)}})}),He=r({name:"no-forward-ref",meta:{type:"suggestion",docs:{description:"Disallows usage of `forwardRef` references for DI",category:"Best Practices",recommended:!1},schema:[],messages:{noForwardRef:"Avoid using `forwardRef`"}},defaultOptions:[],create:e=>({'CallExpression[callee.type="Identifier"][callee.name="forwardRef"]'(t){e.report({node:t,messageId:"noForwardRef"})}})});const We={allowStatic:!1};var ze=r({name:"no-host-metadata-property",meta:{type:"suggestion",docs:{description:"Disallows usage of the `host` metadata property. See more at https://angular.io/styleguide#style-06-03",category:"Best Practices",recommended:"error"},schema:[{type:"object",properties:{allowStatic:{type:"boolean",default:We.allowStatic}},additionalProperties:!1}],messages:{noHostMetadataProperty:`Use @${y.HostBinding} or @${y.HostListener} rather than the \`host\` metadata property (https://angular.io/styleguide#style-06-03)`}},defaultOptions:[We],create:(e,[{allowStatic:t}])=>({[`${xe} Property[key.name="host"]`](r){(t&&N(r.value)?r.value.properties.filter(Ge):[r]).forEach(t=>{e.report({node:t,messageId:"noHostMetadataProperty"})})}})});function Ge(t){return j(t)&&!function(t){return!t.computed&&(e.ASTUtils.isIdentifier(t.key)||K(t.key)&&function({0:e}){return e.toLowerCase()!==e.toUpperCase()}(t.key.value))}(t)&&!function(e){return K(e.value)&&""===e.value.value}(t)}var Qe=r({name:"no-input-prefix",meta:{type:"suggestion",docs:{description:"Input names should not be prefixed by the configured disallowed prefixes.",category:"Best Practices",recommended:!1},schema:[{type:"object",properties:{prefixes:{type:"array",items:{type:"string"}}},additionalProperties:!1}],messages:{noInputPrefix:"@Inputs should not be prefixed by {{prefixes}}"}},defaultOptions:[{prefixes:[]}],create:(t,[{prefixes:r}])=>({':matches(ClassProperty, MethodDefinition[kind="set"]) > Decorator[expression.callee.name="Input"]'(n){if(!de(n.expression.callee,"@angular/core"))return;const o=n.parent,a=function({key:t}){if(e.ASTUtils.isIdentifier(t))return t.name;if(B(t))return t.raw;throw new Error(`Unexpected "ClassProperty.key.type" provided: ${t.type}`)}(o);r.some(e=>e===a||new RegExp(`^${e}[^a-z]`).test(a))&&t.report({node:o,messageId:"noInputPrefix",data:{prefixes:me(r)}})}})});const Ze=new Set(["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-controls","aria-current","aria-describedby","aria-disabled","aria-dragged","aria-dropeffect","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-label","aria-labelledby","aria-level","aria-live","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext"]);var et=r({name:"no-input-rename",meta:{type:"suggestion",docs:{description:"Disallows renaming directive inputs by providing a string to the decorator.",category:"Best Practices",recommended:"error"},schema:[{type:"object",properties:{allowedNames:{type:"array",items:{type:"string"},description:"A list with allowed input names",uniqueItems:!0}},additionalProperties:!1}],messages:{noInputRename:"@Inputs should not be aliased (https://angular.io/guide/styleguide#style-05-13)"}},defaultOptions:[{allowedNames:[]}],create:(t,[{allowedNames:r=[]}])=>({':matches(ClassProperty, MethodDefinition[kind="set"]) > Decorator[expression.callee.name="Input"]'(n){const o=n.expression;if(!de(o.callee,"@angular/core"))return;if(0===o.arguments.length)return;let a;const s=n.parent,{decorators:i}=s.parent.parent,l=null==i?void 0:i.find(t=>O(t.expression)&&e.ASTUtils.isIdentifier(t.expression.callee)&&t.expression.callee.name===d.Directive);if(l){const e=se(l,"selector");e&&K(e)&&(a=e.value.replace(/[[\]\s]/g,"").split(","))}const c=o.arguments[0].value;c&&e.ASTUtils.isIdentifier(s.key)&&((e,t)=>r.includes(e)||e!==t&&a&&a.some(r=>new RegExp(`^${r}((${t[0].toUpperCase()+t.slice(1)}$)|(?=$))`).test(e))||Ze.has(e)&&t===e.replace(/-[a-zA-Z]/g,({1:e})=>e.toUpperCase()))(c.toString(),s.key.name)||t.report({node:s,messageId:"noInputRename"})}})}),tt=r({name:"no-inputs-metadata-property",meta:{type:"suggestion",docs:{description:"Disallows usage of the `inputs` metadata property. See more at https://angular.io/styleguide#style-05-12.",category:"Best Practices",recommended:"error"},schema:[],messages:{noInputsMetadataProperty:`Use @${y.Input} rather than the \`inputs\` metadata property (https://angular.io/styleguide#style-05-12)`}},defaultOptions:[],create:e=>({[xe](t){const r=se(t,"inputs");r&&e.report({node:r.parent,messageId:"noInputsMetadataProperty"})}})}),rt=r({name:"no-lifecycle-call",meta:{type:"suggestion",docs:{description:"Disallows explicit calls to lifecycle methods",category:"Best Practices",recommended:!1},schema:[],messages:{noLifecycleCall:"Avoid explicit calls to lifecycle methods"}},defaultOptions:[],create:t=>({[`ClassDeclaration CallExpression > MemberExpression[property.name=${ge([...re])}]`]:r=>{const n=V(r,A);!n||!z(n)||function(e){return e.type===p.AST_NODE_TYPES.Super}(r.object)&&function(t){const r=V(t,L);return Boolean(r&&function({property:t},{key:r}){return e.ASTUtils.isIdentifier(t)&&e.ASTUtils.isIdentifier(r)&&t.name===r.name}(t,r))}(r)||t.report({node:r.parent,messageId:"noLifecycleCall"})}})});let nt=null;function ot(){var e;return null!=(e=nt)?e:nt=new Set(["abort","afterprint","animationend","animationiteration","animationstart","appinstalled","audioprocess","audioend","audiostart","beforeprint","beforeunload","beginEvent","blocked","blur","boundary","cached","canplay","canplaythrough","change","chargingchange","chargingtimechange","checking","click","close","complete","compositionend","compositionstart","compositionupdate","contextmenu","copy","cut","dblclick","devicechange","devicelight","devicemotion","deviceorientation","deviceproximity","dischargingtimechange","DOMAttributeNameChanged","DOMAttrModified","DOMCharacterDataModified","DOMContentLoaded","DOMElementNameChanged","focus","focusin","focusout","DOMNodeInserted","DOMNodeInsertedIntoDocument","DOMNodeRemoved","DOMNodeRemovedFromDocument","DOMSubtreeModified","downloading","drag","dragend","dragenter","dragleave","dragover","dragstart","drop","durationchange","emptied","end","ended","endEvent","error","fullscreenchange","fullscreenerror","gamepadconnected","gamepaddisconnected","gotpointercapture","hashchange","lostpointercapture","input","invalid","keydown","keypress","keyup","languagechange","levelchange","load","loadeddata","loadedmetadata","loadend","loadstart","mark","message","messageerror","mousedown","mouseenter","mouseleave","mousemove","mouseout","mouseover","mouseup","nomatch","notificationclick","noupdate","obsolete","offline","online","open","orientationchange","pagehide","pageshow","paste","pause","pointercancel","pointerdown","pointerenter","pointerleave","pointerlockchange","pointerlockerror","pointermove","pointerout","pointerover","pointerup","play","playing","popstate","progress","push","pushsubscriptionchange","ratechange","readystatechange","repeatEvent","reset","resize","resourcetimingbufferfull","result","resume","scroll","seeked","seeking","select","selectstart","selectionchange","show","soundend","soundstart","speechend","speechstart","stalled","start","storage","submit","success","suspend","SVGAbort","SVGError","SVGLoad","SVGResize","SVGScroll","SVGUnload","SVGZoom","timeout","timeupdate","touchcancel","touchend","touchmove","touchstart","transitionend","unload","updateready","upgradeneeded","userproximity","voiceschanged","versionchange","visibilitychange","volumechange","waiting","wheel"])}var at=r({name:"no-output-native",meta:{type:"suggestion",docs:{description:"Ensures that output bindings, including aliases, are not named as standard DOM events",category:"Best Practices",recommended:"error"},schema:[],messages:{noOutputNative:"Output bindings, including aliases, should not be named as standard DOM events"}},defaultOptions:[],create(e){const t=ot();return{[[De,Ce,Pe].join(",")](r){const[n,o]=fe(r).replace(/\s/g,"").split(":");(t.has(n)||t.has(o))&&e.report({node:r,messageId:"noOutputNative"})}}}}),st=r({name:"no-output-on-prefix",meta:{type:"suggestion",docs:{description:'Ensures that output bindings, including aliases, are not named "on", nor prefixed with it. See more at https://angular.io/guide/styleguide#style-05-16',category:"Best Practices",recommended:"error"},schema:[],messages:{noOutputOnPrefix:'Output bindings, including aliases, should not be named "on", nor prefixed with it (https://angular.io/guide/styleguide#style-05-16)'}},defaultOptions:[],create(e){const t=/^on(([^a-z])|(?=$))/;return{[[De,Ce,Pe].join(",")](r){const[n,o]=fe(r).replace(/\s/g,"").split(":");(t.test(n)||t.test(o))&&e.report({node:r,messageId:"noOutputOnPrefix"})}}}}),it=r({name:"no-output-rename",meta:{type:"suggestion",docs:{description:"Ensures that output bindings are not aliased",category:"Best Practices",recommended:"error",suggestion:!0},fixable:"code",schema:[],messages:{noOutputRename:"Output bindings should not be aliased (https://angular.io/guide/styleguide#style-05-13)",suggestRemoveAliasName:"Remove alias name",suggestReplaceOriginalNameWithAliasName:"Remove alias name and use it as the original name"}},defaultOptions:[],create(t){let r=new Set;return{[`${xe} Property[key.name='selector'] :matches(Literal, TemplateElement)`](e){r=new Set(he(fe(e)).split(","))},[Ce](n){const o=V(n,k);if(!o||!e.ASTUtils.isIdentifier(o.key))return;const a=fe(n),s=fe(o.key);a===s?t.report({node:n,messageId:"noOutputRename",fix:e=>e.remove(n)}):lt(r,s,a)||t.report({node:n,messageId:"noOutputRename",suggest:[{messageId:"suggestRemoveAliasName",fix:e=>e.remove(n)},{messageId:"suggestReplaceOriginalNameWithAliasName",fix:e=>[e.remove(n),e.replaceText(o.key,a.includes("-")?`'${a}'`:a)]}]})},[De](e){const[n,o]=he(fe(e)).split(":");o&&(o===n?t.report({node:e,messageId:"noOutputRename",fix:t=>t.replaceText(e,ye(e,n))}):lt(r,n,o)||t.report({node:e,messageId:"noOutputRename",suggest:[["suggestRemoveAliasName",n],["suggestReplaceOriginalNameWithAliasName",o]].map(([t,r])=>({messageId:t,fix:t=>t.replaceText(e,ye(e,r))}))}))},"ClassDeclaration:exit"(){r=new Set}}}});function lt(e,t,r){return[...e].some(e=>e===r||function(e,t){return`${e}${r=t,`${r[0].toUpperCase()}${r.slice(1)}`}`;var r}(e,t)===r)}var ct=r({name:"no-outputs-metadata-property",meta:{type:"suggestion",docs:{description:"Disallows usage of the `outputs` metadata property. See more at https://angular.io/styleguide#style-05-12",category:"Best Practices",recommended:"error"},schema:[],messages:{noOutputsMetadataProperty:"Use `@Output` rather than the `outputs` metadata property (https://angular.io/styleguide#style-05-12)"}},defaultOptions:[],create:e=>({[`${xe} Property[key.name="outputs"][computed=false]`](t){e.report({node:t,messageId:"noOutputsMetadataProperty"})}})}),pt=r({name:"no-pipe-impure",meta:{type:"suggestion",docs:{description:"Disallows the declaration of impure pipes",category:"Best Practices",recommended:!1},schema:[],messages:{noPipeImpure:"Impure pipes should be avoided because they are invoked on each change-detection cycle"}},defaultOptions:[],create:e=>({[`${Ee} Property[key.name='pure'][value.value=false]`](t){e.report({node:t,messageId:"noPipeImpure"})}})}),ut=r({name:"no-queries-metadata-property",meta:{type:"suggestion",docs:{description:"Disallows usage of the `queries` metadata property. See more at https://angular.io/styleguide#style-05-12.",category:"Best Practices",recommended:!1},schema:[],messages:{noQueriesMetadataProperty:`Use @${y.Output} rather than the \`queries\` metadata property (https://angular.io/styleguide#style-05-12)`}},defaultOptions:[],create:e=>({[xe](t){const r=se(t,"queries");r&&e.report({node:r.parent,messageId:"noQueriesMetadataProperty"})}})}),dt=r({name:"no-empty-lifecycle-method",meta:{type:"suggestion",docs:{description:"Disallows declaring empty lifecycle methods",category:"Best Practices",recommended:"error",suggestion:!0},schema:[],messages:{noEmptyLifecycleMethod:"Lifecycle methods should not be empty",suggestRemoveLifecycleMethod:"Remove lifecycle method"}},defaultOptions:[],create(e){const t=e.getSourceCode();return{[`ClassDeclaration > ClassBody > MethodDefinition[key.name=${ge([...re])}][value.body.body.length=0]`](r){z(r.parent.parent)&&e.report({node:r,messageId:"noEmptyLifecycleMethod",suggest:[{messageId:"suggestRemoveLifecycleMethod",fix:e=>{var n;const o=null!=(n=F(r,"@angular/core"))?n:[],a=r.key.name.replace(/^ng+/,"");return[e.remove(r),J(t,r.parent.parent,a,e),H(t,o,a,e)].filter(pe)}}]})}}}});const mt="prefer-on-push-component-change-detection";var gt=r({name:mt,meta:{type:"suggestion",docs:{description:"Enforces component's change detection to ChangeDetectionStrategy.OnPush.",category:"Best Practices",recommended:!1},schema:[],messages:{preferOnPushComponentChangeDetection:"The changeDetection value of a component should be set to ChangeDetectionStrategy.OnPush"}},defaultOptions:[],create:t=>({[ve](r){const n=se(r,"changeDetection");n?e.ASTUtils.isIdentifier(n.property)&&"OnPush"===n.property.name||t.report({node:n,messageId:"preferOnPushComponentChangeDetection"}):t.report({node:r,messageId:"preferOnPushComponentChangeDetection"})}})}),ft=r({name:"prefer-output-readonly",meta:{type:"suggestion",docs:{description:"Prefer to declare `@Output` as `readonly` since they are not supposed to be reassigned",category:"Best Practices",recommended:!1,suggestion:!0},schema:[],messages:{preferOutputReadonly:"Prefer to declare `@Output` as `readonly` since they are not supposed to be reassigned",suggestAddReadonlyModifier:"Add `readonly` modifier"}},defaultOptions:[],create:e=>({[`ClassProperty:not([readonly]) > ${we}`]({parent:{key:t}}){e.report({node:t,messageId:"preferOutputReadonly",suggest:[{messageId:"suggestAddReadonlyModifier",fix:e=>e.insertTextBefore(t,"readonly ")}]})}})});const yt=/^\.\.?\/.+/;var ht=r({name:"relative-url-prefix",meta:{type:"suggestion",docs:{description:"The ./ and ../ prefix is standard syntax for relative URLs; don't depend on Angular's current ability to do without that prefix. See more at https://angular.io/styleguide#style-05-04",category:"Best Practices",recommended:!1},schema:[],messages:{relativeUrlPrefix:"The ./ and ../ prefix is standard syntax for relative URLs. (https://angular.io/styleguide#style-05-04)"}},defaultOptions:[],create:e=>({[`${ve} Property[key.name='templateUrl']`]({value:t}){St(t)&&e.report({node:t,messageId:"relativeUrlPrefix"})},[`${ve} Property[key.name='styleUrls']`]({value:t}){M(t)&&t.elements.filter(St).forEach(t=>{e.report({node:t,messageId:"relativeUrlPrefix"})})}})});function St(e){return!K(e)||!yt.test(e.value)}const Tt=["bootstrap","declarations","entryComponents","exports","imports","providers","schemas"];var xt=r({name:"sort-ngmodule-metadata-arrays",meta:{type:"suggestion",docs:{description:"Enforces ASC alphabetical order for NgModule metadata arrays for easy visual scanning",category:"Best Practices",recommended:!1},fixable:"code",schema:[],messages:{sortNgmoduleMetadataArrays:"NgModule metadata arrays should be sorted in ASC alphabetical order"}},defaultOptions:[],create:t=>({'ClassDeclaration > Decorator[expression.callee.name="NgModule"]'(r){Tt.forEach(n=>{const o=se(r,n);if(!o||!M(o)||o.elements.length<2)return;const a=o.elements.filter(e.ASTUtils.isIdentifier).map((e,t,r)=>[e,r[t+1]]).find(([e,t])=>t&&1===e.name.localeCompare(t.name));if(!a)return;const[s,i]=a;t.report({messageId:"sortNgmoduleMetadataArrays",node:s,fix:e=>[e.replaceText(s,i.name),e.replaceText(i,s.name)]})})}})}),vt=r({name:"use-component-selector",meta:{type:"suggestion",docs:{description:"Component selector must be declared",category:"Best Practices",recommended:!1},schema:[],messages:{useComponentSelector:"The selector of the component is mandatory"}},defaultOptions:[],create:e=>({[ve](t){const r=se(t,"selector");r&&K(r)&&r.value.length||e.report({node:t,messageId:"useComponentSelector"})}})}),bt=r({name:"use-component-view-encapsulation",meta:{type:"suggestion",docs:{description:"Disallows using `ViewEncapsulation.None`",category:"Best Practices",recommended:!1},schema:[],messages:{useComponentViewEncapsulation:"Using `ViewEncapsulation.None` makes your styles global, which may have an unintended effect",suggestRemoveViewEncapsulationNone:"Remove `ViewEncapsulation.None`"}},defaultOptions:[],create(e){const t=e.getSourceCode();return{[`${ve} Property[key.name='encapsulation'] > MemberExpression[object.name='ViewEncapsulation'] > Identifier[name='None']`](r){e.report({node:r,messageId:"useComponentViewEncapsulation",suggest:[{messageId:"suggestRemoveViewEncapsulationNone",fix:e=>{var n;const o=null!=(n=F(r,"@angular/core"))?n:[];return[X(t,r.parent.parent,e),H(t,o,"ViewEncapsulation",e)].filter(pe)}}]})}}}}),Et=r({name:"use-injectable-provided-in",meta:{type:"suggestion",docs:{description:`"Using the 'providedIn' property makes classes decorated with @${d.Injectable} tree shakeable`,category:"Best Practices",recommended:!1},schema:[],messages:{useInjectableProvidedIn:`Classes decorated with @${d.Injectable} should use the 'providedIn' property`}},defaultOptions:[],create:e=>({'ClassDeclaration > Decorator[expression.callee.name="Injectable"]'(t){se(t,"providedIn")||e.report({node:t,messageId:"useInjectableProvidedIn"})}})}),wt=r({name:"use-lifecycle-interface",meta:{type:"suggestion",docs:{description:"Ensures that classes implement lifecycle interfaces corresponding to the declared lifecycle methods. See more at https://angular.io/styleguide#style-09-01",category:"Best Practices",recommended:"warn"},schema:[],messages:{useLifecycleInterface:"Lifecycle interface '{{interfaceName}}' should be implemented for method '{{methodName}}'. (https://angular.io/styleguide#style-09-01)"}},defaultOptions:[],create:e=>({[`MethodDefinition[key.name=${ge([...re])}]`]({key:t,parent:{parent:r}}){if(!z(r))return;const n=ee(r),o=t.name,a=(e=>e.slice(2))(o);n.includes(h[a])||e.report({node:t,messageId:"useLifecycleInterface",data:{interfaceName:a,methodName:o}})}})}),Dt=r({name:"use-pipe-transform-interface",meta:{type:"suggestion",docs:{description:"Ensures that Pipes implement `PipeTransform` interface",category:"Best Practices",recommended:"error"},fixable:"code",schema:[],messages:{usePipeTransformInterface:"Pipes should implement `PipeTransform` interface"}},defaultOptions:[],create:e=>({[Ee]({parent:t}){var r;Z(t).find(e=>"PipeTransform"===e)||e.report({node:null!=(r=t.id)?r:t,messageId:"usePipeTransformInterface",fix:e=>{const{implementsNodeReplace:r,implementsTextReplace:n}=function({id:e,implements:t},r){const[n,o]=t?[q(t),`, ${r}`]:[e,` implements ${r}`];return{implementsNodeReplace:n,implementsTextReplace:o}}(t,"PipeTransform");return[Y(t,"@angular/core","PipeTransform",e),e.insertTextAfter(r,n)]}})}})}),Ct=r({name:"pipe-prefix",meta:{type:"suggestion",docs:{description:"Enforce consistent prefix for pipes.",category:"Stylistic Issues",recommended:!1},schema:[{type:"object",properties:{prefixes:{type:"array",items:{type:"string"},minimum:1,uniqueItems:!0}},additionalProperties:!1}],messages:{pipePrefix:"@Pipes should be prefixed by {{prefixes}}"}},defaultOptions:[{prefixes:[]}],create:(e,[{prefixes:t}])=>({[Ee](r){const n=se(r,"name");if(!n)return;if(!function(e){return Array.isArray(e)&&e.length>0}(t))return;const o=t.join("|"),a=ue.prefix(o,"camelCase");let s;K(n)?s=n.value:R(n)&&n.quasis[0]&&(s=n.quasis[0].value.raw),s&&(a.apply(this,[s])||e.report({node:n,messageId:"pipePrefix",data:{prefixes:me(t)}}))}})});module.exports={configs:{all:{extends:"./configs/base.json",rules:{"@angular-eslint/component-class-suffix":"error","@angular-eslint/component-max-inline-declarations":"error","@angular-eslint/component-selector":"error","@angular-eslint/contextual-decorator":"error","@angular-eslint/contextual-lifecycle":"error","@angular-eslint/directive-class-suffix":"error","@angular-eslint/directive-selector":"error","@angular-eslint/no-attribute-decorator":"error","@angular-eslint/no-conflicting-lifecycle":"error","@angular-eslint/no-empty-lifecycle-method":"error","@angular-eslint/no-forward-ref":"error","@angular-eslint/no-host-metadata-property":"error","@angular-eslint/no-input-prefix":"error","@angular-eslint/no-input-rename":"error","@angular-eslint/no-inputs-metadata-property":"error","@angular-eslint/no-lifecycle-call":"error","@angular-eslint/no-output-native":"error","@angular-eslint/no-output-on-prefix":"error","@angular-eslint/no-output-rename":"error","@angular-eslint/no-outputs-metadata-property":"error","@angular-eslint/no-pipe-impure":"error","@angular-eslint/no-queries-metadata-property":"error","@angular-eslint/pipe-prefix":"error","@angular-eslint/prefer-on-push-component-change-detection":"error","@angular-eslint/prefer-output-readonly":"error","@angular-eslint/relative-url-prefix":"error","@angular-eslint/sort-ngmodule-metadata-arrays":"error","@angular-eslint/use-component-selector":"error","@angular-eslint/use-component-view-encapsulation":"error","@angular-eslint/use-injectable-provided-in":"error","@angular-eslint/use-lifecycle-interface":"error","@angular-eslint/use-pipe-transform-interface":"error"}},base:{parser:"@typescript-eslint/parser",parserOptions:{ecmaVersion:2020,sourceType:"module",project:"./tsconfig.json"},plugins:["@typescript-eslint","@angular-eslint"]},recommended:{extends:"./configs/base.json",rules:{"@angular-eslint/component-class-suffix":"error","@angular-eslint/contextual-lifecycle":"error","@angular-eslint/directive-class-suffix":"error","@angular-eslint/no-conflicting-lifecycle":"error","@angular-eslint/no-empty-lifecycle-method":"error","@angular-eslint/no-host-metadata-property":"error","@angular-eslint/no-input-rename":"error","@angular-eslint/no-inputs-metadata-property":"error","@angular-eslint/no-output-native":"error","@angular-eslint/no-output-on-prefix":"error","@angular-eslint/no-output-rename":"error","@angular-eslint/no-outputs-metadata-property":"error","@angular-eslint/use-lifecycle-interface":"warn","@angular-eslint/use-pipe-transform-interface":"error"}},"recommended--extra":{extends:"./configs/base.json",rules:{"no-restricted-imports":["error",{paths:[{name:"rxjs/Rx",message:"Please import directly from 'rxjs' instead"}]}],"@typescript-eslint/member-ordering":["error",{default:["static-field","instance-field","static-method","instance-method"]}],"no-restricted-syntax":["error",{selector:'CallExpression[callee.object.name="console"][callee.property.name=/^(debug|info|time|timeEnd|trace)$/]',message:"Unexpected property on console object was called"}],"@typescript-eslint/no-inferrable-types":["error",{ignoreParameters:!0}],"@typescript-eslint/no-non-null-assertion":"error","no-fallthrough":"error"}},"ng-cli-compat":{extends:["./configs/base.json"],env:{browser:!0,es6:!0,node:!0},plugins:["eslint-plugin-import","eslint-plugin-jsdoc","eslint-plugin-prefer-arrow"],rules:{"@typescript-eslint/interface-name-prefix":"off","@typescript-eslint/explicit-member-accessibility":"off","sort-keys":"off","@angular-eslint/component-class-suffix":"error","@angular-eslint/component-selector":["error",{type:"element",prefix:"app",style:"kebab-case"}],"@angular-eslint/contextual-lifecycle":"error","@angular-eslint/directive-class-suffix":"error","@angular-eslint/directive-selector":["error",{type:"attribute",prefix:"app",style:"camelCase"}],"@angular-eslint/no-conflicting-lifecycle":"error","@angular-eslint/no-host-metadata-property":"error","@angular-eslint/no-input-rename":"error","@angular-eslint/no-inputs-metadata-property":"error","@angular-eslint/no-output-native":"error","@angular-eslint/no-output-on-prefix":"error","@angular-eslint/no-output-rename":"error","@angular-eslint/no-outputs-metadata-property":"error","@angular-eslint/use-lifecycle-interface":"error","@angular-eslint/use-pipe-transform-interface":"error","@typescript-eslint/adjacent-overload-signatures":"error","@typescript-eslint/array-type":"off","@typescript-eslint/ban-types":["error",{types:{Object:{message:"Avoid using the `Object` type. Did you mean `object`?"},Function:{message:"Avoid using the `Function` type. Prefer a specific function type, like `() => void`."},Boolean:{message:"Avoid using the `Boolean` type. Did you mean `boolean`?"},Number:{message:"Avoid using the `Number` type. Did you mean `number`?"},String:{message:"Avoid using the `String` type. Did you mean `string`?"},Symbol:{message:"Avoid using the `Symbol` type. Did you mean `symbol`?"}}}],"@typescript-eslint/consistent-type-assertions":"error","@typescript-eslint/dot-notation":"error","@typescript-eslint/member-ordering":"error","@typescript-eslint/naming-convention":"error","@typescript-eslint/no-empty-function":"off","@typescript-eslint/no-empty-interface":"error","@typescript-eslint/no-explicit-any":"off","@typescript-eslint/no-inferrable-types":["error",{ignoreParameters:!0}],"@typescript-eslint/no-misused-new":"error","@typescript-eslint/no-namespace":"error","@typescript-eslint/no-non-null-assertion":"error","@typescript-eslint/no-parameter-properties":"off","@typescript-eslint/no-unused-expressions":"error","@typescript-eslint/no-use-before-define":"off","@typescript-eslint/no-var-requires":"off","@typescript-eslint/prefer-for-of":"error","@typescript-eslint/prefer-function-type":"error","@typescript-eslint/prefer-namespace-keyword":"error","@typescript-eslint/triple-slash-reference":["error",{path:"always",types:"prefer-import",lib:"always"}],"@typescript-eslint/unified-signatures":"error",complexity:"off","constructor-super":"error",eqeqeq:["error","smart"],"guard-for-in":"error","id-blacklist":["error","any","Number","number","String","string","Boolean","boolean","Undefined","undefined"],"id-match":"error","import/no-deprecated":"warn","jsdoc/newline-after-description":"error","jsdoc/no-types":"error","max-classes-per-file":"off","no-bitwise":"error","no-caller":"error","no-cond-assign":"error","no-console":["error",{allow:["log","warn","dir","timeLog","assert","clear","count","countReset","group","groupEnd","table","dirxml","error","groupCollapsed","Console","profile","profileEnd","timeStamp","context"]}],"no-debugger":"error","no-empty":"off","no-eval":"error","no-fallthrough":"error","no-invalid-this":"off","no-new-wrappers":"error","no-restricted-imports":["error",{name:"rxjs/Rx",message:"Please import directly from 'rxjs' instead"}],"@typescript-eslint/no-shadow":["error",{hoist:"all"}],"no-throw-literal":"error","no-undef-init":"error","no-underscore-dangle":"error","no-unsafe-finally":"error","no-unused-labels":"error","no-var":"error","object-shorthand":"error","one-var":["error","never"],"prefer-arrow/prefer-arrow-functions":"error","prefer-const":"error",radix:"error","use-isnan":"error","valid-typeof":"off"}},"ng-cli-compat--formatting-add-on":{plugins:["eslint-plugin-jsdoc"],rules:{"arrow-body-style":"error","arrow-parens":"off","comma-dangle":"off",curly:"error","eol-last":"error","jsdoc/check-alignment":"error","max-len":["error",{code:140}],"new-parens":"error","no-multiple-empty-lines":"off","no-trailing-spaces":"error","quote-props":["error","as-needed"],"space-before-function-paren":["error",{anonymous:"never",asyncArrow:"always",named:"never"}],"@typescript-eslint/member-delimiter-style":["error",{multiline:{delimiter:"semi",requireLast:!0},singleline:{delimiter:"semi",requireLast:!1}}],quotes:"off","@typescript-eslint/quotes":["error","single",{allowTemplateLiterals:!0}],"@typescript-eslint/semi":["error","always"],"@typescript-eslint/type-annotation-spacing":"error"}}},rules:{"contextual-decorator":Se,"component-class-suffix":Ie,"component-max-inline-declarations":ke,"component-selector":Ke,"contextual-lifecycle":Le,"directive-class-suffix":Ve,"directive-selector":Fe,"no-attribute-decorator":Je,"no-conflicting-lifecycle":Ye,"no-forward-ref":He,"no-host-metadata-property":ze,"no-input-prefix":Qe,"no-input-rename":et,"no-inputs-metadata-property":tt,"no-lifecycle-call":rt,"no-output-native":at,"no-output-on-prefix":st,"no-output-rename":it,"no-outputs-metadata-property":ct,"no-pipe-impure":pt,"no-queries-metadata-property":ut,"no-empty-lifecycle-method":dt,[mt]:gt,"prefer-output-readonly":ft,"relative-url-prefix":ht,"sort-ngmodule-metadata-arrays":xt,"use-component-selector":vt,"use-component-view-encapsulation":bt,"use-injectable-provided-in":Et,"use-lifecycle-interface":wt,"use-pipe-transform-interface":Dt,"pipe-prefix":Ct}};
|
|
1
|
+
var e=require("@typescript-eslint/experimental-utils"),t=require("@angular/compiler");const r=e.ESLintUtils.RuleCreator(e=>"https://github.com/angular-eslint/angular-eslint");function n(){return(n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var a="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function o(e){var t={exports:{}};return e(t,t.exports),t.exports}var s=o(function(e,t){var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.AST_TOKEN_TYPES=t.AST_NODE_TYPES=void 0,(r=t.AST_NODE_TYPES||(t.AST_NODE_TYPES={})).ArrayExpression="ArrayExpression",r.ArrayPattern="ArrayPattern",r.ArrowFunctionExpression="ArrowFunctionExpression",r.AssignmentExpression="AssignmentExpression",r.AssignmentPattern="AssignmentPattern",r.AwaitExpression="AwaitExpression",r.BinaryExpression="BinaryExpression",r.BlockStatement="BlockStatement",r.BreakStatement="BreakStatement",r.CallExpression="CallExpression",r.CatchClause="CatchClause",r.ChainExpression="ChainExpression",r.ClassBody="ClassBody",r.ClassDeclaration="ClassDeclaration",r.ClassExpression="ClassExpression",r.ClassProperty="ClassProperty",r.ConditionalExpression="ConditionalExpression",r.ContinueStatement="ContinueStatement",r.DebuggerStatement="DebuggerStatement",r.Decorator="Decorator",r.DoWhileStatement="DoWhileStatement",r.EmptyStatement="EmptyStatement",r.ExportAllDeclaration="ExportAllDeclaration",r.ExportDefaultDeclaration="ExportDefaultDeclaration",r.ExportNamedDeclaration="ExportNamedDeclaration",r.ExportSpecifier="ExportSpecifier",r.ExpressionStatement="ExpressionStatement",r.ForInStatement="ForInStatement",r.ForOfStatement="ForOfStatement",r.ForStatement="ForStatement",r.FunctionDeclaration="FunctionDeclaration",r.FunctionExpression="FunctionExpression",r.Identifier="Identifier",r.IfStatement="IfStatement",r.ImportDeclaration="ImportDeclaration",r.ImportDefaultSpecifier="ImportDefaultSpecifier",r.ImportExpression="ImportExpression",r.ImportNamespaceSpecifier="ImportNamespaceSpecifier",r.ImportSpecifier="ImportSpecifier",r.JSXAttribute="JSXAttribute",r.JSXClosingElement="JSXClosingElement",r.JSXClosingFragment="JSXClosingFragment",r.JSXElement="JSXElement",r.JSXEmptyExpression="JSXEmptyExpression",r.JSXExpressionContainer="JSXExpressionContainer",r.JSXFragment="JSXFragment",r.JSXIdentifier="JSXIdentifier",r.JSXMemberExpression="JSXMemberExpression",r.JSXNamespacedName="JSXNamespacedName",r.JSXOpeningElement="JSXOpeningElement",r.JSXOpeningFragment="JSXOpeningFragment",r.JSXSpreadAttribute="JSXSpreadAttribute",r.JSXSpreadChild="JSXSpreadChild",r.JSXText="JSXText",r.LabeledStatement="LabeledStatement",r.Literal="Literal",r.LogicalExpression="LogicalExpression",r.MemberExpression="MemberExpression",r.MetaProperty="MetaProperty",r.MethodDefinition="MethodDefinition",r.NewExpression="NewExpression",r.ObjectExpression="ObjectExpression",r.ObjectPattern="ObjectPattern",r.Program="Program",r.Property="Property",r.RestElement="RestElement",r.ReturnStatement="ReturnStatement",r.SequenceExpression="SequenceExpression",r.SpreadElement="SpreadElement",r.Super="Super",r.SwitchCase="SwitchCase",r.SwitchStatement="SwitchStatement",r.TaggedTemplateExpression="TaggedTemplateExpression",r.TemplateElement="TemplateElement",r.TemplateLiteral="TemplateLiteral",r.ThisExpression="ThisExpression",r.ThrowStatement="ThrowStatement",r.TryStatement="TryStatement",r.UnaryExpression="UnaryExpression",r.UpdateExpression="UpdateExpression",r.VariableDeclaration="VariableDeclaration",r.VariableDeclarator="VariableDeclarator",r.WhileStatement="WhileStatement",r.WithStatement="WithStatement",r.YieldExpression="YieldExpression",r.TSAbstractClassProperty="TSAbstractClassProperty",r.TSAbstractKeyword="TSAbstractKeyword",r.TSAbstractMethodDefinition="TSAbstractMethodDefinition",r.TSAnyKeyword="TSAnyKeyword",r.TSArrayType="TSArrayType",r.TSAsExpression="TSAsExpression",r.TSAsyncKeyword="TSAsyncKeyword",r.TSBigIntKeyword="TSBigIntKeyword",r.TSBooleanKeyword="TSBooleanKeyword",r.TSCallSignatureDeclaration="TSCallSignatureDeclaration",r.TSClassImplements="TSClassImplements",r.TSConditionalType="TSConditionalType",r.TSConstructorType="TSConstructorType",r.TSConstructSignatureDeclaration="TSConstructSignatureDeclaration",r.TSDeclareFunction="TSDeclareFunction",r.TSDeclareKeyword="TSDeclareKeyword",r.TSEmptyBodyFunctionExpression="TSEmptyBodyFunctionExpression",r.TSEnumDeclaration="TSEnumDeclaration",r.TSEnumMember="TSEnumMember",r.TSExportAssignment="TSExportAssignment",r.TSExportKeyword="TSExportKeyword",r.TSExternalModuleReference="TSExternalModuleReference",r.TSFunctionType="TSFunctionType",r.TSImportEqualsDeclaration="TSImportEqualsDeclaration",r.TSImportType="TSImportType",r.TSIndexedAccessType="TSIndexedAccessType",r.TSIndexSignature="TSIndexSignature",r.TSInferType="TSInferType",r.TSInterfaceBody="TSInterfaceBody",r.TSInterfaceDeclaration="TSInterfaceDeclaration",r.TSInterfaceHeritage="TSInterfaceHeritage",r.TSIntersectionType="TSIntersectionType",r.TSIntrinsicKeyword="TSIntrinsicKeyword",r.TSLiteralType="TSLiteralType",r.TSMappedType="TSMappedType",r.TSMethodSignature="TSMethodSignature",r.TSModuleBlock="TSModuleBlock",r.TSModuleDeclaration="TSModuleDeclaration",r.TSNamedTupleMember="TSNamedTupleMember",r.TSNamespaceExportDeclaration="TSNamespaceExportDeclaration",r.TSNeverKeyword="TSNeverKeyword",r.TSNonNullExpression="TSNonNullExpression",r.TSNullKeyword="TSNullKeyword",r.TSNumberKeyword="TSNumberKeyword",r.TSObjectKeyword="TSObjectKeyword",r.TSOptionalType="TSOptionalType",r.TSParameterProperty="TSParameterProperty",r.TSParenthesizedType="TSParenthesizedType",r.TSPrivateKeyword="TSPrivateKeyword",r.TSPropertySignature="TSPropertySignature",r.TSProtectedKeyword="TSProtectedKeyword",r.TSPublicKeyword="TSPublicKeyword",r.TSQualifiedName="TSQualifiedName",r.TSReadonlyKeyword="TSReadonlyKeyword",r.TSRestType="TSRestType",r.TSStaticKeyword="TSStaticKeyword",r.TSStringKeyword="TSStringKeyword",r.TSSymbolKeyword="TSSymbolKeyword",r.TSTemplateLiteralType="TSTemplateLiteralType",r.TSThisType="TSThisType",r.TSTupleType="TSTupleType",r.TSTypeAliasDeclaration="TSTypeAliasDeclaration",r.TSTypeAnnotation="TSTypeAnnotation",r.TSTypeAssertion="TSTypeAssertion",r.TSTypeLiteral="TSTypeLiteral",r.TSTypeOperator="TSTypeOperator",r.TSTypeParameter="TSTypeParameter",r.TSTypeParameterDeclaration="TSTypeParameterDeclaration",r.TSTypeParameterInstantiation="TSTypeParameterInstantiation",r.TSTypePredicate="TSTypePredicate",r.TSTypeQuery="TSTypeQuery",r.TSTypeReference="TSTypeReference",r.TSUndefinedKeyword="TSUndefinedKeyword",r.TSUnionType="TSUnionType",r.TSUnknownKeyword="TSUnknownKeyword",r.TSVoidKeyword="TSVoidKeyword",(n=t.AST_TOKEN_TYPES||(t.AST_TOKEN_TYPES={})).Boolean="Boolean",n.Identifier="Identifier",n.JSXIdentifier="JSXIdentifier",n.JSXText="JSXText",n.Keyword="Keyword",n.Null="Null",n.Numeric="Numeric",n.Punctuator="Punctuator",n.RegularExpression="RegularExpression",n.String="String",n.Template="Template",n.Block="Block",n.Line="Line"});Object.defineProperty(exports,"__esModule",{value:!0});var i={__proto__:null};Object.defineProperty(exports,"__esModule",{value:!0});var l={__proto__:null},c=o(function(e,t){var r=a&&a.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=a&&a.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=a&&a.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)"default"!==a&&Object.prototype.hasOwnProperty.call(e,a)&&r(t,e,a);return n(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.TSESTree=void 0,t.TSESTree=o(s)}),p=o(function(e,t){var r=a&&a.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=a&&a.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.AST_TOKEN_TYPES=t.AST_NODE_TYPES=void 0,Object.defineProperty(t,"AST_NODE_TYPES",{enumerable:!0,get:function(){return s.AST_NODE_TYPES}});var o=s;Object.defineProperty(t,"AST_TOKEN_TYPES",{enumerable:!0,get:function(){return o.AST_TOKEN_TYPES}}),n(i,t),n(l,t),n(c,t)});const u=Object.keys;var d,m,g,f;!function(e){e.Component="Component",e.Directive="Directive",e.Injectable="Injectable",e.NgModule="NgModule",e.Pipe="Pipe"}(d||(d={})),function(e){e.Attribute="Attribute",e.Host="Host",e.Inject="Inject",e.Optional="Optional",e.Self="Self",e.SkipSelf="SkipSelf"}(m||(m={})),function(e){e.HostListener="HostListener"}(g||(g={})),function(e){e.ContentChild="ContentChild",e.ContentChildren="ContentChildren",e.HostBinding="HostBinding",e.Input="Input",e.Output="Output",e.ViewChild="ViewChild",e.ViewChildren="ViewChildren"}(f||(f={}));const y=n({},m,g,f);var h,S;!function(e){e.AfterContentChecked="AfterContentChecked",e.AfterContentInit="AfterContentInit",e.AfterViewChecked="AfterViewChecked",e.AfterViewInit="AfterViewInit",e.DoBootstrap="DoBootstrap",e.DoCheck="DoCheck",e.OnChanges="OnChanges",e.OnDestroy="OnDestroy",e.OnInit="OnInit"}(h||(h={})),function(e){e.ngAfterContentChecked="ngAfterContentChecked",e.ngAfterContentInit="ngAfterContentInit",e.ngAfterViewChecked="ngAfterViewChecked",e.ngAfterViewInit="ngAfterViewInit",e.ngDoBootstrap="ngDoBootstrap",e.ngDoCheck="ngDoCheck",e.ngOnChanges="ngOnChanges",e.ngOnDestroy="ngOnDestroy",e.ngOnInit="ngOnInit"}(S||(S={}));const T="camelCase",x="kebab-case",v=u(d),b=u(y),E=u(h),w=u(S),I=new Map([[d.Component,new Set([S.ngAfterContentChecked,S.ngAfterContentInit,S.ngAfterViewChecked,S.ngAfterViewInit,S.ngOnChanges,S.ngOnDestroy,S.ngOnInit,S.ngDoCheck])],[d.Directive,new Set([S.ngAfterContentChecked,S.ngAfterContentInit,S.ngAfterViewChecked,S.ngAfterViewInit,S.ngOnChanges,S.ngOnDestroy,S.ngOnInit,S.ngDoCheck])],[d.Injectable,new Set([S.ngOnDestroy])],[d.NgModule,new Set([S.ngDoBootstrap])],[d.Pipe,new Set([S.ngOnDestroy])]]),D=new Set(b),C=new Set(v),P=new Map([[d.Component,D],[d.Directive,D],[d.Injectable,new Set([y.Host,y.Inject,y.Optional,y.Self,y.SkipSelf])],[d.NgModule,new Set([y.Host,y.Inject,y.Optional,y.Self,y.SkipSelf])],[d.Pipe,new Set([y.Host,y.Inject,y.Optional,y.Self,y.SkipSelf])]]);function O(e){return e.type===p.AST_NODE_TYPES.CallExpression}function A(e){return e.type===p.AST_NODE_TYPES.MemberExpression}function N(e){return e.type===p.AST_NODE_TYPES.ClassDeclaration}function k(e){return function(e){return e.type===p.AST_NODE_TYPES.ClassProperty}(e)||U(e)}function M(e){return e.type===p.AST_NODE_TYPES.ObjectExpression}function j(e){return e.type===p.AST_NODE_TYPES.ArrayExpression}function _(e){return e.type===p.AST_NODE_TYPES.Property}function R(e){return e.type===p.AST_NODE_TYPES.Program}function B(e){return e.type===p.AST_NODE_TYPES.Literal}function $(e){return e.type===p.AST_NODE_TYPES.TemplateLiteral}function L(e){return e.type===p.AST_NODE_TYPES.ImportDeclaration}function K(e){return B(e)&&"string"==typeof e.value}function U(e){return e.type===p.AST_NODE_TYPES.MethodDefinition}function V({parent:e},t){for(;e&&!R(e);){if(t(e))return e;e=e.parent}return null}function F(e,t){let r=e;for(;r=r.parent;)if(R(r))return r.body.filter(e=>L(e)&&e.source.value===t);return r}function J(t,r,n,a){const{implements:o}=r;if(!o)return;const s=o.map(({expression:e})=>e).filter(e.ASTUtils.isIdentifier).find(({name:e})=>e===n);if(!s)return;const i=o[0].expression===s;if(i&&o[o.length-1].expression===s&&r.id)return a.removeRange([r.id.range[1],o[0].range[1]]);const l=t.getTokenAfter(s);if(i&&l)return a.removeRange([s.range[0],l.range[1]]);const c=t.getTokenBefore(s);return c?a.removeRange([c.range[0],s.range[1]]):void 0}function X(t,r,n){const a=t.getTokenAfter(r);return a&&e.ASTUtils.isCommaToken(a)?n.removeRange([r.range[0],a.range[1]]):n.remove(r)}function q(e,t){for(const r of e){const e=r.specifiers.find(e=>e.type===p.AST_NODE_TYPES.ImportSpecifier&&e.imported.name===t);if(e)return{importDeclaration:r,importSpecifier:e}}}function Y(e){return e.slice(-1)[0]}function H(e,t,r,n){const a=F(e,t);if(null==a||!a.length)return n.insertTextAfterRange([0,0],`import { ${r} } from '${t}';\n`);if(q(a,r))return;const o=Y(a[0].specifiers);return n.insertTextAfter(o,`, ${r}`)}function W(e,t,r,n){var a;const{importDeclaration:o,importSpecifier:s}=null!=(a=q(t,r))?a:{};if(!o||!s)return;const i=o.specifiers[0]===s;if(i&&o.specifiers[o.specifiers.length-1]===s)return n.remove(o);const l=e.getTokenAfter(s);if(i&&l)return n.removeRange([s.range[0],l.range[1]]);const c=e.getTokenBefore(s);return c?n.removeRange([c.range[0],s.range[1]]):void 0}const z=e=>{var t;return N(e)?null==(t=e.id)?void 0:t.name:e.parent?z(e.parent):void 0},G=({decorators:e})=>null==e?void 0:e.map(Q).filter(ue).find(se),Q=({expression:t})=>e.ASTUtils.isIdentifier(t)?t.name:O(t)&&e.ASTUtils.isIdentifier(t.callee)?t.callee.name:void 0,Z=e=>{var t;return null!=(t=e.implements)?t:[]},ee=t=>Z(t).map(({expression:e})=>A(e)?e.property:e).filter(e.ASTUtils.isIdentifier).map(({name:e})=>e),te=e=>ee(e).filter(ae),re=new Set(E),ne=new Set(w),ae=e=>re.has(e),oe=e=>ne.has(e),se=e=>C.has(e),ie=(t,r)=>{var n;return null==(n=((t,r)=>{var n;return null==(n=(({expression:e})=>{if(!O(e)||0===e.arguments.length)return;const[t]=e.arguments;return M(t)&&t.properties?t:void 0})(t))?void 0:n.properties.filter(_).find(({key:t})=>e.ASTUtils.isIdentifier(t)&&t.name===r)})(t,r))?void 0:n.value},le=({body:{body:e}})=>e.filter(U),ce=t=>K(t.key)?t.key.value:e.ASTUtils.isIdentifier(t.key)?t.key.name:void 0;function pe(e){return Array.isArray(e)?e:e?[e]:[]}const ue=e=>null!=e,de={attribute:e=>0!==e.length,camelCase:e=>/^[a-zA-Z0-9[\]]+$/.test(e),element:e=>null!==e,kebabCase:e=>/^[a-z0-9-]+-[a-z0-9-]+$/.test(e),prefix(e,t){const r=new RegExp(`^\\[?(${e})`);return n=>{if(!e)return!0;if(!r.test(n))return!1;const a=n.replace(r,"");if(t===T)return!a||a[0]===a[0].toUpperCase();if(t===x)return!a||"-"===a[0];throw Error("Invalid selector style!")}}},me=e=>e.replace(/-[a-zA-Z]/g,({1:e})=>e.toUpperCase()),ge=e=>{const t=e.length;return 1===t?`"${e[0]}"`:`${e.map(e=>`"${e}"`).slice(0,t-1).join(", ")} or "${[...e].pop()}"`},fe=e=>RegExp(`^(${e.join("|")})$`);function ye(t){return e.ASTUtils.isIdentifier(t)?t.name:B(t)?String(t.value):($(t)?t.quasis[0]:t).value.raw}function he(e,t){return B(e)?`'${t}'`:`\`${t}\``}function Se(e){return`${e[0].toUpperCase()}${e.slice(1)}`}function Te(e){return e.replace(/[[\]\s]/g,"")}var xe=r({name:"contextual-decorator",meta:{type:"suggestion",docs:{description:"Ensures that classes use contextual decorators in its body",category:"Best Practices",recommended:!1},schema:[],messages:{contextualDecorator:'Decorator out of context for "@{{classDecoratorName}}()"'}},defaultOptions:[],create:e=>({"MethodDefinition[kind=/^(get|set|method)$/], ClassProperty, TSParameterProperty"(t){!function(e,t){var r;if(null==(r=t.decorators)||!r.length)return;const n=V(t,N);if(!n)return;const a=G(n);if(a)for(const r of t.decorators)ve(e,r,a)}(e,t)}})});function ve(e,t,r){const n=Q(t);if(!n||!D.has(n))return;const a=P.get(r);null!=a&&a.has(n)||e.report({node:t,messageId:"contextualDecorator",data:{classDecoratorName:r}})}const be="ClassDeclaration > Decorator[expression.callee.name=/^(Component|Directive)$/]",Ee='ClassDeclaration > Decorator[expression.callee.name="Component"]',we='ClassDeclaration > Decorator[expression.callee.name="Directive"]',Ie='ClassDeclaration > Decorator[expression.callee.name="Pipe"]',De='Decorator[expression.callee.name="Output"]';function Ce(e){return`Property:matches([key.name='${e}'][computed=false], [key.value='${e}'], [key.quasis.0.value.raw='${e}'])`}const Pe=`:matches(${Ee} ${Ce("selector")} :matches(Literal, TemplateElement), ${we} ${Ce("selector")} :matches(Literal, TemplateElement))`,Oe=`${be} ${Ce("inputs")} > ArrayExpression :matches(Literal, TemplateElement)`,Ae=":matches(ClassProperty, MethodDefinition[kind='set']) Decorator[expression.callee.name=\"Input\"] :matches(Literal, TemplateElement)",Ne=":matches(ClassProperty, MethodDefinition[kind='set'])[computed=false]:has(Decorator[expression.callee.name=\"Input\"]) > :matches(Identifier, Literal)",ke=`${be} ${Ce("outputs")} > ArrayExpression :matches(Literal, TemplateElement)`,Me=`:matches(ClassProperty, MethodDefinition[kind='get']) ${De} :matches(Literal, TemplateElement)`,je=`:matches(ClassProperty, MethodDefinition[kind='get'])[computed=false]:has(${De}) > :matches(Identifier, Literal)`;var _e=r({name:"component-class-suffix",meta:{type:"suggestion",docs:{description:'Classes decorated with @Component must have suffix "Component" (or custom) in their name. See more at https://angular.io/styleguide#style-02-03',category:"Best Practices",recommended:"error"},schema:[{type:"object",properties:{suffixes:{type:"array",items:{type:"string"}}},additionalProperties:!1}],messages:{componentClassSuffix:"Component class names should end with one of these suffixes: {{suffixes}} (https://angular.io/styleguide#style-02-03)"}},defaultOptions:[{suffixes:["Component"]}],create:(e,[{suffixes:t}])=>({[Ee](r){const n=r.parent,a=z(n);a&&t.some(e=>a.endsWith(e))||e.report({node:n.id?n.id:n,messageId:"componentClassSuffix",data:{suffixes:ge(t)}})}})});const Re=/\r\n|\r|\n/;function Be(e){return $(e)?e.quasis[0].value.raw.trim().split(Re).length:B(e)?e.raw.trim().split(Re).length:0}var $e=r({name:"component-max-inline-declarations",meta:{type:"suggestion",docs:{description:"Enforces a maximum number of lines in inline template, styles and animations. See more at https://angular.io/guide/styleguide#style-05-04",category:"Best Practices",recommended:!1},schema:[{type:"object",properties:{template:{minimum:0,type:"number"},styles:{minimum:0,type:"number"},animations:{minimum:0,type:"number"}},additionalProperties:!1}],messages:{componentMaxInlineDeclarations:"`{{propertyType}}` has too many lines ({{lineCount}}). Maximum allowed is {{max}} (https://angular.io/guide/styleguide#style-05-04)"}},defaultOptions:[{template:3,styles:3,animations:15}],create:(e,[{template:t=3,styles:r=3,animations:n=15}])=>({[`${Ee} Property[key.name='template']`]({value:r}){const n=Be(r);n<=t||e.report({node:r,messageId:"componentMaxInlineDeclarations",data:{lineCount:n,max:t,propertyType:"template"}})},[`${Ee} Property[key.name='styles']`]({value:t}){if(!j(t))return;const n=t.elements.reduce((e,t)=>e+Be(t),0);n<=r||e.report({node:t,messageId:"componentMaxInlineDeclarations",data:{lineCount:n,max:r,propertyType:"styles"}})},[`${Ee} Property[key.name='animations']`]({value:t}){if(!j(t)||0===t.elements.length)return;const r=Math.max(t.loc.end.line-t.loc.start.line-2,1);r<=n||e.report({node:t,messageId:"componentMaxInlineDeclarations",data:{lineCount:r,max:n,propertyType:"animations"}})}})});const Le="attribute",Ke="element",Ue={[Le]:"attrs",[Ke]:Ke},Ve=(e,t,r)=>{r.report({node:e,messageId:"prefixFailure",data:{prefix:ge(pe(t))}})},Fe=(e,t,r)=>{r.report({node:e,messageId:"styleFailure",data:{style:t}})},Je=(e,t,r)=>{r.report({node:e,messageId:"typeFailure",data:{type:t}})},Xe=(e,t,r)=>{const n=pe(e),a=r,o=n.length>0&&n.every(e=>-1!==[Ke,Le].indexOf(e)),s=t.length>0,i=-1!==[T,x].indexOf(a);return o&&s&&i},qe=(e,r,n,a)=>{const o=pe(r||["attrs",Ke]).reduce((e,t)=>e.concat(Ue[t]),[]),s=a===x?de.kebabCase:de.camelCase;let i=null;if(e&&B(e)?i=t.CssSelector.parse(e.raw):e&&$(e)&&e.quasis[0]&&(i=t.CssSelector.parse(e.quasis[0].value.raw)),!i)return null;const l=((e,t)=>e.reduce((e,r)=>{const n=t.reduce((e,t)=>{const n=r[t];return n?e.concat(n):e},[]);return e.concat(n)},[]))(i,o),c=l.some(e=>n.some(t=>de.prefix(t,a)(e))),p=l.some(e=>s(e));return{hasExpectedPrefix:c,hasExpectedType:l.length>0,hasExpectedStyle:p}};var Ye=r({name:"component-selector",meta:{type:"suggestion",docs:{description:"Component selectors should follow given naming rules. See more at https://angular.io/guide/styleguide#style-02-07, https://angular.io/guide/styleguide#style-05-02\n and https://angular.io/guide/styleguide#style-05-03.",category:"Best Practices",recommended:!1},schema:[{type:"object",properties:{type:{oneOf:[{type:"string"},{type:"array",items:{enum:[Ke,Le]}}]},prefix:{oneOf:[{type:"string"},{type:"array"}]},style:{type:"string",enum:[T,x]}},additionalProperties:!1}],messages:{prefixFailure:"The selector should start with one of these prefixes: {{prefix}} (https://angular.io/guide/styleguide#style-02-07)",styleFailure:"The selector should be {{style}} (https://angular.io/guide/styleguide#style-05-02)",typeFailure:"The selector should be used as an {{type}} (https://angular.io/guide/styleguide#style-05-03)",shadowDomEncapsulatedStyleFailure:`The selector of a ShadowDom-encapsulated component should be \`${x}\` (https://github.com/angular-eslint/angular-eslint/issues/534)`}},defaultOptions:[{type:"",prefix:"",style:""}],create:(t,[{type:r,prefix:n,style:a}])=>({[Ee](o){const s=ie(o,"selector");if(!s)return;if(!Xe(r,n,a))return;const i=a!==x&&function(t){const r=ie(t,"encapsulation");return r&&A(r)&&e.ASTUtils.isIdentifier(r.object)&&"ViewEncapsulation"===r.object.name&&e.ASTUtils.isIdentifier(r.property)&&"ShadowDom"===r.property.name}(o)?x:a,l=qe(s,r,pe(n),i);null!==l&&(l.hasExpectedType?l.hasExpectedStyle?l.hasExpectedPrefix||Ve(s,n,t):a===i?Fe(s,a,t):t.report({node:s,messageId:"shadowDomEncapsulatedStyleFailure"}):Je(s,r,t))}})}),He=r({name:"contextual-lifecycle",meta:{type:"problem",docs:{description:"Ensures that lifecycle methods are used in a correct context",category:"Possible Errors",recommended:"error"},schema:[],messages:{contextualLifecycle:"Angular will not invoke the `{{methodName}}` lifecycle method within `@{{classDecoratorName}}()` classes"}},defaultOptions:[],create(e){function t({parent:t},r){const n=t,a=I.get(r),o=le(n);for(const t of o){const n=ce(t);!n||!oe(n)||null!=a&&a.has(n)||e.report({node:t.key,messageId:"contextualLifecycle",data:{classDecoratorName:r,methodName:n}})}}return{[Ee](e){t(e,d.Component)},[we](e){t(e,d.Directive)},'ClassDeclaration > Decorator[expression.callee.name="Injectable"]'(e){t(e,d.Injectable)},'ClassDeclaration > Decorator[expression.callee.name="NgModule"]'(e){t(e,d.NgModule)},[Ie](e){t(e,d.Pipe)}}}}),We=r({name:"directive-class-suffix",meta:{type:"suggestion",docs:{description:'Classes decorated with @Directive must have suffix "Directive" (or custom) in their name. See more at https://angular.io/styleguide#style-02-03',category:"Best Practices",recommended:"error"},schema:[{type:"object",properties:{suffixes:{type:"array",items:{type:"string"}}},additionalProperties:!1}],messages:{directiveClassSuffix:"Directive class names should end with one of these suffixes: {{suffixes}} (https://angular.io/styleguide#style-02-03)"}},defaultOptions:[{suffixes:["Directive"]}],create:(e,[{suffixes:t}])=>({[we](r){if(!ie(r,"selector"))return;const n=r.parent,a=z(n),o=ee(n).some(e=>e.endsWith("Validator")),s=t.concat(o?"Validator":[]);var i;a&&s.some(e=>a.endsWith(e))||e.report({node:null!=(i=n.id)?i:n,messageId:"directiveClassSuffix",data:{suffixes:ge(s)}})}})}),ze=r({name:"directive-selector",meta:{type:"suggestion",docs:{description:"Directive selectors should follow given naming rules. See more at https://angular.io/guide/styleguide#style-02-06 and https://angular.io/guide/styleguide#style-02-08.",category:"Best Practices",recommended:!1},schema:[{type:"object",properties:{type:{oneOf:[{type:"string"},{type:"array",items:{enum:[Ke,Le]}}]},prefix:{oneOf:[{type:"string"},{type:"array"}]},style:{type:"string",enum:[T,x]}},additionalProperties:!1}],messages:{prefixFailure:"The selector should start with one of these prefixes: {{prefix}} (https://angular.io/guide/styleguide#style-02-08)",styleFailure:"The selector should be {{style}} (https://angular.io/guide/styleguide#style-02-06)",typeFailure:"The selector should be used as an {{type}} (https://angular.io/guide/styleguide#style-02-06)"}},defaultOptions:[{type:"",prefix:"",style:""}],create:(e,[{type:t,prefix:r,style:n}])=>({[we](a){const o=ie(a,"selector");if(!o)return;if(!Xe(t,r,n))return;const s=qe(o,t,pe(r),n);null!==s&&(s.hasExpectedType?s.hasExpectedStyle?s.hasExpectedPrefix||Ve(o,r,e):Fe(o,n,e):Je(o,t,e))}})}),Ge=r({name:"no-attribute-decorator",meta:{type:"problem",docs:{description:"Disallows usage of @Attribute decorator.",category:"Possible Errors",recommended:!1},schema:[],messages:{noAttributeDecorator:"The usage of @Attribute is considered a bad practice. Use @Input instead"}},defaultOptions:[],create:e=>({'ClassDeclaration MethodDefinition[key.name="constructor"] Decorator[expression.callee.name="Attribute"]'(t){e.report({node:t,messageId:"noAttributeDecorator"})}})});const Qe=[h.DoCheck,h.OnChanges],Ze=[S.ngDoCheck,S.ngOnChanges];var et=r({name:"no-conflicting-lifecycle",meta:{type:"suggestion",docs:{description:"Ensures that directives not implement conflicting lifecycle interfaces.",category:"Best Practices",recommended:"error"},schema:[],messages:{noConflictingLifecycleInterface:`Implementing ${h.DoCheck} and ${h.OnChanges} in a class is not recommended`,noConflictingLifecycleMethod:`Declaring ${S.ngDoCheck} and ${S.ngOnChanges} method in a class is not recommended`}},defaultOptions:[],create:t=>({ClassDeclaration(r){(r=>{const n=te(r);if(!Qe.every(e=>n.includes(e)))return;const a=Z(r).filter(t=>e.ASTUtils.isIdentifier(t.expression)&&ae(t.expression.name));for(const e of a)t.report({node:e,messageId:"noConflictingLifecycleInterface"})})(r),(r=>{const n=(e=>le(e).map(ce).filter(ue).filter(oe))(r);if(!Ze.every(e=>n.includes(e)))return;const a=le(r).filter(t=>e.ASTUtils.isIdentifier(t.key)&&oe(t.key.name));for(const e of a)t.report({node:e,messageId:"noConflictingLifecycleMethod"})})(r)}})}),tt=r({name:"no-forward-ref",meta:{type:"suggestion",docs:{description:"Disallows usage of `forwardRef` references for DI",category:"Best Practices",recommended:!1},schema:[],messages:{noForwardRef:"Avoid using `forwardRef`"}},defaultOptions:[],create:e=>({'CallExpression[callee.type="Identifier"][callee.name="forwardRef"]'(t){e.report({node:t,messageId:"noForwardRef"})}})});const rt={allowStatic:!1};var nt=r({name:"no-host-metadata-property",meta:{type:"suggestion",docs:{description:"Disallows usage of the `host` metadata property. See more at https://angular.io/styleguide#style-06-03",category:"Best Practices",recommended:"error"},schema:[{type:"object",properties:{allowStatic:{type:"boolean",default:rt.allowStatic}},additionalProperties:!1}],messages:{noHostMetadataProperty:`Use @${y.HostBinding} or @${y.HostListener} rather than the \`host\` metadata property (https://angular.io/styleguide#style-06-03)`}},defaultOptions:[rt],create:(e,[{allowStatic:t}])=>({[`${be} Property[key.name="host"]`](r){(t&&M(r.value)?r.value.properties.filter(at):[r]).forEach(t=>{e.report({node:t,messageId:"noHostMetadataProperty"})})}})});function at(t){return _(t)&&!function(t){return!t.computed&&(e.ASTUtils.isIdentifier(t.key)||K(t.key)&&function({0:e}){return e.toLowerCase()!==e.toUpperCase()}(t.key.value))}(t)&&!function(e){return K(e.value)&&""===e.value.value}(t)}var ot=r({name:"no-input-prefix",meta:{type:"suggestion",docs:{description:"Ensures that input bindings, including aliases, are not named or prefixed by the configured disallowed prefixes",category:"Best Practices",recommended:!1},schema:[{type:"object",properties:{prefixes:{type:"array",items:{type:"string"}}},additionalProperties:!1}],messages:{noInputPrefix:"Input bindings, including aliases, should not be named, nor prefixed by {{prefixes}}"}},defaultOptions:[{prefixes:[]}],create:(e,[{prefixes:t}])=>({[[Oe,Ae,Ne].join(",")](r){const[n,a]=ye(r).replace(/\s/g,"").split(":");t.some(e=>function(e,t,r){const n=RegExp(`^${e}(([^a-z])|(?=$))`);return n.test(t)||n.test(r)}(e,n,a))&&e.report({node:r,messageId:"noInputPrefix",data:{prefixes:ge(t)}})}})});let st=null;function it(){var e;return null!=(e=st)?e:st=new Set(["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-dragged","aria-dropeffect","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext"])}var lt=r({name:"no-input-rename",meta:{type:"suggestion",docs:{description:"Ensures that input bindings are not aliased",category:"Best Practices",recommended:"error",suggestion:!0},fixable:"code",schema:[{type:"object",properties:{allowedNames:{type:"array",items:{type:"string"},description:"A list with allowed input names",uniqueItems:!0}},additionalProperties:!1}],messages:{noInputRename:"Input bindings should not be aliased (https://angular.io/guide/styleguide#style-05-13)",suggestRemoveAliasName:"Remove alias name",suggestReplaceOriginalNameWithAliasName:"Remove alias name and use it as the original name"}},defaultOptions:[{allowedNames:[]}],create(t,[{allowedNames:r=[]}]){let n=new Set;const a=it();return{[Pe](e){n=new Set(Te(ye(e)).split(","))},[Ae](o){const s=V(o,k);if(!s||!e.ASTUtils.isIdentifier(s.key))return;const i=ye(o),l=ye(s.key);r.includes(i)||a.has(i)&&l===me(i)||(i===l?t.report({node:o,messageId:"noInputRename",fix:e=>e.remove(o)}):ct(n,l,i)||t.report({node:o,messageId:"noInputRename",suggest:[{messageId:"suggestRemoveAliasName",fix:e=>e.remove(o)},{messageId:"suggestReplaceOriginalNameWithAliasName",fix:e=>[e.remove(o),e.replaceText(s.key,i.includes("-")?`'${i}'`:i)]}]}))},[Oe](e){const[o,s]=Te(ye(e)).split(":");!s||r.includes(s)||a.has(s)&&o===me(s)||(s===o?t.report({node:e,messageId:"noInputRename",fix:t=>t.replaceText(e,he(e,o))}):ct(n,o,s)||t.report({node:e,messageId:"noInputRename",suggest:[["suggestRemoveAliasName",o],["suggestReplaceOriginalNameWithAliasName",s]].map(([t,r])=>({messageId:t,fix:t=>t.replaceText(e,he(e,r))}))}))},"ClassDeclaration:exit"(){n=new Set}}}});function ct(e,t,r){return[...e].some(e=>e===r||function(e,t){return`${e}${Se(t)}`}(e,t)===r)}var pt=r({name:"no-inputs-metadata-property",meta:{type:"suggestion",docs:{description:"Disallows usage of the `inputs` metadata property. See more at https://angular.io/styleguide#style-05-12",category:"Best Practices",recommended:"error"},schema:[],messages:{noInputsMetadataProperty:"Use `@Input` rather than the `inputs` metadata property (https://angular.io/styleguide#style-05-12)"}},defaultOptions:[],create:e=>({[`${be} ${Ce("inputs")}`](t){e.report({node:t,messageId:"noInputsMetadataProperty"})}})}),ut=r({name:"no-lifecycle-call",meta:{type:"suggestion",docs:{description:"Disallows explicit calls to lifecycle methods",category:"Best Practices",recommended:!1},schema:[],messages:{noLifecycleCall:"Avoid explicit calls to lifecycle methods"}},defaultOptions:[],create:t=>({[`ClassDeclaration CallExpression > MemberExpression[property.name=${fe([...ne])}]`]:r=>{const n=V(r,N);!n||!G(n)||function(e){return e.type===p.AST_NODE_TYPES.Super}(r.object)&&function(t){const r=V(t,U);return Boolean(r&&function({property:t},{key:r}){return e.ASTUtils.isIdentifier(t)&&e.ASTUtils.isIdentifier(r)&&t.name===r.name}(t,r))}(r)||t.report({node:r.parent,messageId:"noLifecycleCall"})}})});let dt=null;function mt(){var e;return null!=(e=dt)?e:dt=new Set(["abort","afterprint","animationend","animationiteration","animationstart","appinstalled","audioprocess","audioend","audiostart","beforeprint","beforeunload","beginEvent","blocked","blur","boundary","cached","canplay","canplaythrough","change","chargingchange","chargingtimechange","checking","click","close","complete","compositionend","compositionstart","compositionupdate","contextmenu","copy","cut","dblclick","devicechange","devicelight","devicemotion","deviceorientation","deviceproximity","dischargingtimechange","DOMAttributeNameChanged","DOMAttrModified","DOMCharacterDataModified","DOMContentLoaded","DOMElementNameChanged","focus","focusin","focusout","DOMNodeInserted","DOMNodeInsertedIntoDocument","DOMNodeRemoved","DOMNodeRemovedFromDocument","DOMSubtreeModified","downloading","drag","dragend","dragenter","dragleave","dragover","dragstart","drop","durationchange","emptied","end","ended","endEvent","error","fullscreenchange","fullscreenerror","gamepadconnected","gamepaddisconnected","gotpointercapture","hashchange","lostpointercapture","input","invalid","keydown","keypress","keyup","languagechange","levelchange","load","loadeddata","loadedmetadata","loadend","loadstart","mark","message","messageerror","mousedown","mouseenter","mouseleave","mousemove","mouseout","mouseover","mouseup","nomatch","notificationclick","noupdate","obsolete","offline","online","open","orientationchange","pagehide","pageshow","paste","pause","pointercancel","pointerdown","pointerenter","pointerleave","pointerlockchange","pointerlockerror","pointermove","pointerout","pointerover","pointerup","play","playing","popstate","progress","push","pushsubscriptionchange","ratechange","readystatechange","repeatEvent","reset","resize","resourcetimingbufferfull","result","resume","scroll","seeked","seeking","select","selectstart","selectionchange","show","soundend","soundstart","speechend","speechstart","stalled","start","storage","submit","success","suspend","SVGAbort","SVGError","SVGLoad","SVGResize","SVGScroll","SVGUnload","SVGZoom","timeout","timeupdate","touchcancel","touchend","touchmove","touchstart","transitionend","unload","updateready","upgradeneeded","userproximity","voiceschanged","versionchange","visibilitychange","volumechange","waiting","wheel"])}var gt=r({name:"no-output-native",meta:{type:"suggestion",docs:{description:"Ensures that output bindings, including aliases, are not named as standard DOM events",category:"Best Practices",recommended:"error"},schema:[],messages:{noOutputNative:"Output bindings, including aliases, should not be named as standard DOM events"}},defaultOptions:[],create(e){const t=mt();return{[[ke,Me,je].join(",")](r){const[n,a]=ye(r).replace(/\s/g,"").split(":");(t.has(n)||t.has(a))&&e.report({node:r,messageId:"noOutputNative"})}}}}),ft=r({name:"no-output-on-prefix",meta:{type:"suggestion",docs:{description:'Ensures that output bindings, including aliases, are not named "on", nor prefixed with it. See more at https://angular.io/guide/styleguide#style-05-16',category:"Best Practices",recommended:"error"},schema:[],messages:{noOutputOnPrefix:'Output bindings, including aliases, should not be named "on", nor prefixed with it (https://angular.io/guide/styleguide#style-05-16)'}},defaultOptions:[],create(e){const t=/^on(([^a-z])|(?=$))/;return{[[ke,Me,je].join(",")](r){const[n,a]=ye(r).replace(/\s/g,"").split(":");(t.test(n)||t.test(a))&&e.report({node:r,messageId:"noOutputOnPrefix"})}}}}),yt=r({name:"no-output-rename",meta:{type:"suggestion",docs:{description:"Ensures that output bindings are not aliased",category:"Best Practices",recommended:"error",suggestion:!0},fixable:"code",schema:[],messages:{noOutputRename:"Output bindings should not be aliased (https://angular.io/guide/styleguide#style-05-13)",suggestRemoveAliasName:"Remove alias name",suggestReplaceOriginalNameWithAliasName:"Remove alias name and use it as the original name"}},defaultOptions:[],create(t){let r=new Set;return{[Pe](e){r=new Set(Te(ye(e)).split(","))},[Me](n){const a=V(n,k);if(!a||!e.ASTUtils.isIdentifier(a.key))return;const o=ye(n),s=ye(a.key);o===s?t.report({node:n,messageId:"noOutputRename",fix:e=>e.remove(n)}):ht(r,s,o)||t.report({node:n,messageId:"noOutputRename",suggest:[{messageId:"suggestRemoveAliasName",fix:e=>e.remove(n)},{messageId:"suggestReplaceOriginalNameWithAliasName",fix:e=>[e.remove(n),e.replaceText(a.key,o.includes("-")?`'${o}'`:o)]}]})},[ke](e){const[n,a]=Te(ye(e)).split(":");a&&(a===n?t.report({node:e,messageId:"noOutputRename",fix:t=>t.replaceText(e,he(e,n))}):ht(r,n,a)||t.report({node:e,messageId:"noOutputRename",suggest:[["suggestRemoveAliasName",n],["suggestReplaceOriginalNameWithAliasName",a]].map(([t,r])=>({messageId:t,fix:t=>t.replaceText(e,he(e,r))}))}))},"ClassDeclaration:exit"(){r=new Set}}}});function ht(e,t,r){return[...e].some(e=>e===r||function(e,t){return`${e}${Se(t)}`}(e,t)===r)}var St=r({name:"no-outputs-metadata-property",meta:{type:"suggestion",docs:{description:"Disallows usage of the `outputs` metadata property. See more at https://angular.io/styleguide#style-05-12",category:"Best Practices",recommended:"error"},schema:[],messages:{noOutputsMetadataProperty:"Use `@Output` rather than the `outputs` metadata property (https://angular.io/styleguide#style-05-12)"}},defaultOptions:[],create:e=>({[`${be} ${Ce("outputs")}`](t){e.report({node:t,messageId:"noOutputsMetadataProperty"})}})}),Tt=r({name:"no-pipe-impure",meta:{type:"suggestion",docs:{description:"Disallows the declaration of impure pipes",category:"Best Practices",recommended:!1,suggestion:!0},schema:[],messages:{noPipeImpure:"Impure pipes should be avoided because they are invoked on each change-detection cycle",suggestRemovePipeImpure:"Remove `pure` property"}},defaultOptions:[],create(e){const t=e.getSourceCode();return{[`${Ie} ObjectExpression > Property:matches([key.name='pure'], [key.value='pure']):matches([value.value=false], [value.operator='!'][value.argument.value=true])[computed=false]`](r){e.report({node:r,messageId:"noPipeImpure",suggest:[{messageId:"suggestRemovePipeImpure",fix:e=>X(t,r,e)}]})}}}}),xt=r({name:"no-queries-metadata-property",meta:{type:"suggestion",docs:{description:"Disallows usage of the `queries` metadata property. See more at https://angular.io/styleguide#style-05-12.",category:"Best Practices",recommended:!1},schema:[],messages:{noQueriesMetadataProperty:`Use @${y.Output} rather than the \`queries\` metadata property (https://angular.io/styleguide#style-05-12)`}},defaultOptions:[],create:e=>({[be](t){const r=ie(t,"queries");r&&e.report({node:r.parent,messageId:"noQueriesMetadataProperty"})}})}),vt=r({name:"no-empty-lifecycle-method",meta:{type:"suggestion",docs:{description:"Disallows declaring empty lifecycle methods",category:"Best Practices",recommended:"error",suggestion:!0},schema:[],messages:{noEmptyLifecycleMethod:"Lifecycle methods should not be empty",suggestRemoveLifecycleMethod:"Remove lifecycle method"}},defaultOptions:[],create(e){const t=e.getSourceCode();return{[`ClassDeclaration > ClassBody > MethodDefinition[key.name=${fe([...ne])}][value.body.body.length=0]`](r){G(r.parent.parent)&&e.report({node:r,messageId:"noEmptyLifecycleMethod",suggest:[{messageId:"suggestRemoveLifecycleMethod",fix:e=>{var n;const a=null!=(n=F(r,"@angular/core"))?n:[],o=r.key.name.replace(/^ng+/,"");return[e.remove(r),J(t,r.parent.parent,o,e),W(t,a,o,e)].filter(ue)}}]})}}}});const bt="prefer-on-push-component-change-detection";var Et=r({name:bt,meta:{type:"suggestion",docs:{description:"Enforces component's change detection to ChangeDetectionStrategy.OnPush.",category:"Best Practices",recommended:!1},schema:[],messages:{preferOnPushComponentChangeDetection:"The changeDetection value of a component should be set to ChangeDetectionStrategy.OnPush"}},defaultOptions:[],create:t=>({[Ee](r){const n=ie(r,"changeDetection");n?e.ASTUtils.isIdentifier(n.property)&&"OnPush"===n.property.name||t.report({node:n,messageId:"preferOnPushComponentChangeDetection"}):t.report({node:r,messageId:"preferOnPushComponentChangeDetection"})}})}),wt=r({name:"prefer-output-readonly",meta:{type:"suggestion",docs:{description:"Prefer to declare `@Output` as `readonly` since they are not supposed to be reassigned",category:"Best Practices",recommended:!1,suggestion:!0},schema:[],messages:{preferOutputReadonly:"Prefer to declare `@Output` as `readonly` since they are not supposed to be reassigned",suggestAddReadonlyModifier:"Add `readonly` modifier"}},defaultOptions:[],create:e=>({[`ClassProperty:not([readonly]) > ${De}`]({parent:{key:t}}){e.report({node:t,messageId:"preferOutputReadonly",suggest:[{messageId:"suggestAddReadonlyModifier",fix:e=>e.insertTextBefore(t,"readonly ")}]})}})});const It=/^\.\.?\/.+/;var Dt=r({name:"relative-url-prefix",meta:{type:"suggestion",docs:{description:"The ./ and ../ prefix is standard syntax for relative URLs; don't depend on Angular's current ability to do without that prefix. See more at https://angular.io/styleguide#style-05-04",category:"Best Practices",recommended:!1},schema:[],messages:{relativeUrlPrefix:"The ./ and ../ prefix is standard syntax for relative URLs. (https://angular.io/styleguide#style-05-04)"}},defaultOptions:[],create:e=>({[`${Ee} Property[key.name='templateUrl']`]({value:t}){Ct(t)&&e.report({node:t,messageId:"relativeUrlPrefix"})},[`${Ee} Property[key.name='styleUrls']`]({value:t}){j(t)&&t.elements.filter(Ct).forEach(t=>{e.report({node:t,messageId:"relativeUrlPrefix"})})}})});function Ct(e){return!K(e)||!It.test(e.value)}const Pt=["bootstrap","declarations","entryComponents","exports","imports","providers","schemas"];var Ot=r({name:"sort-ngmodule-metadata-arrays",meta:{type:"suggestion",docs:{description:"Enforces ASC alphabetical order for NgModule metadata arrays for easy visual scanning",category:"Best Practices",recommended:!1},fixable:"code",schema:[],messages:{sortNgmoduleMetadataArrays:"NgModule metadata arrays should be sorted in ASC alphabetical order"}},defaultOptions:[],create:t=>({'ClassDeclaration > Decorator[expression.callee.name="NgModule"]'(r){Pt.forEach(n=>{const a=ie(r,n);if(!a||!j(a)||a.elements.length<2)return;const o=a.elements.filter(e.ASTUtils.isIdentifier).map((e,t,r)=>[e,r[t+1]]).find(([e,t])=>t&&1===e.name.localeCompare(t.name));if(!o)return;const[s,i]=o;t.report({messageId:"sortNgmoduleMetadataArrays",node:s,fix:e=>[e.replaceText(s,i.name),e.replaceText(i,s.name)]})})}})}),At=r({name:"use-component-selector",meta:{type:"suggestion",docs:{description:"Component selector must be declared",category:"Best Practices",recommended:!1},schema:[],messages:{useComponentSelector:"The selector of the component is mandatory"}},defaultOptions:[],create:e=>({[Ee](t){const r=ie(t,"selector");r&&K(r)&&r.value.length||e.report({node:t,messageId:"useComponentSelector"})}})}),Nt=r({name:"use-component-view-encapsulation",meta:{type:"suggestion",docs:{description:"Disallows using `ViewEncapsulation.None`",category:"Best Practices",recommended:!1},schema:[],messages:{useComponentViewEncapsulation:"Using `ViewEncapsulation.None` makes your styles global, which may have an unintended effect",suggestRemoveViewEncapsulationNone:"Remove `ViewEncapsulation.None`"}},defaultOptions:[],create(e){const t=e.getSourceCode();return{[`${Ee} Property:matches([key.name='encapsulation'], [key.value='encapsulation']) > MemberExpression[object.name='ViewEncapsulation'] > Identifier[name='None']`](r){e.report({node:r,messageId:"useComponentViewEncapsulation",suggest:[{messageId:"suggestRemoveViewEncapsulationNone",fix:e=>{var n;const a=null!=(n=F(r,"@angular/core"))?n:[];return[X(t,r.parent.parent,e),W(t,a,"ViewEncapsulation",e)].filter(ue)}}]})}}}}),kt=r({name:"use-injectable-provided-in",meta:{type:"suggestion",docs:{description:`"Using the 'providedIn' property makes classes decorated with @${d.Injectable} tree shakeable`,category:"Best Practices",recommended:!1},schema:[],messages:{useInjectableProvidedIn:`Classes decorated with @${d.Injectable} should use the 'providedIn' property`}},defaultOptions:[],create:e=>({'ClassDeclaration > Decorator[expression.callee.name="Injectable"]'(t){ie(t,"providedIn")||e.report({node:t,messageId:"useInjectableProvidedIn"})}})}),Mt=r({name:"use-lifecycle-interface",meta:{type:"suggestion",docs:{description:"Ensures that classes implement lifecycle interfaces corresponding to the declared lifecycle methods. See more at https://angular.io/styleguide#style-09-01",category:"Best Practices",recommended:"warn"},schema:[],messages:{useLifecycleInterface:"Lifecycle interface '{{interfaceName}}' should be implemented for method '{{methodName}}'. (https://angular.io/styleguide#style-09-01)"}},defaultOptions:[],create:e=>({[`MethodDefinition[key.name=${fe([...ne])}]`]({key:t,parent:{parent:r}}){if(!G(r))return;const n=te(r),a=t.name,o=(e=>e.slice(2))(a);n.includes(h[o])||e.report({node:t,messageId:"useLifecycleInterface",data:{interfaceName:o,methodName:a}})}})}),jt=r({name:"use-pipe-transform-interface",meta:{type:"suggestion",docs:{description:"Ensures that `Pipes` implement `PipeTransform` interface",category:"Best Practices",recommended:"error"},fixable:"code",schema:[],messages:{usePipeTransformInterface:"Pipes should implement `PipeTransform` interface"}},defaultOptions:[],create:e=>({"ClassDeclaration:not(:has(TSClassImplements:matches([expression.name='PipeTransform'], [expression.property.name='PipeTransform']))) > Decorator[expression.callee.name='Pipe']"({parent:t}){var r;e.report({node:null!=(r=t.id)?r:t,messageId:"usePipeTransformInterface",fix:e=>{const{implementsNodeReplace:r,implementsTextReplace:n}=function({id:e,implements:t},r){const[n,a]=t?[Y(t),`, ${r}`]:[e,` implements ${r}`];return{implementsNodeReplace:n,implementsTextReplace:a}}(t,"PipeTransform");return[H(t,"@angular/core","PipeTransform",e),e.insertTextAfter(r,n)].filter(ue)}})}})}),_t=r({name:"pipe-prefix",meta:{type:"suggestion",docs:{description:"Enforce consistent prefix for pipes.",category:"Stylistic Issues",recommended:!1},schema:[{type:"object",properties:{prefixes:{type:"array",items:{type:"string"},minimum:1,uniqueItems:!0}},additionalProperties:!1}],messages:{pipePrefix:"@Pipes should be prefixed by {{prefixes}}"}},defaultOptions:[{prefixes:[]}],create:(e,[{prefixes:t}])=>({[Ie](r){const n=ie(r,"name");if(!n)return;if(!function(e){return Array.isArray(e)&&e.length>0}(t))return;const a=t.join("|"),o=de.prefix(a,"camelCase");let s;K(n)?s=n.value:$(n)&&n.quasis[0]&&(s=n.quasis[0].value.raw),s&&(o.apply(this,[s])||e.report({node:n,messageId:"pipePrefix",data:{prefixes:ge(t)}}))}})});module.exports={configs:{all:{extends:"./configs/base.json",rules:{"@angular-eslint/component-class-suffix":"error","@angular-eslint/component-max-inline-declarations":"error","@angular-eslint/component-selector":"error","@angular-eslint/contextual-decorator":"error","@angular-eslint/contextual-lifecycle":"error","@angular-eslint/directive-class-suffix":"error","@angular-eslint/directive-selector":"error","@angular-eslint/no-attribute-decorator":"error","@angular-eslint/no-conflicting-lifecycle":"error","@angular-eslint/no-empty-lifecycle-method":"error","@angular-eslint/no-forward-ref":"error","@angular-eslint/no-host-metadata-property":"error","@angular-eslint/no-input-prefix":"error","@angular-eslint/no-input-rename":"error","@angular-eslint/no-inputs-metadata-property":"error","@angular-eslint/no-lifecycle-call":"error","@angular-eslint/no-output-native":"error","@angular-eslint/no-output-on-prefix":"error","@angular-eslint/no-output-rename":"error","@angular-eslint/no-outputs-metadata-property":"error","@angular-eslint/no-pipe-impure":"error","@angular-eslint/no-queries-metadata-property":"error","@angular-eslint/pipe-prefix":"error","@angular-eslint/prefer-on-push-component-change-detection":"error","@angular-eslint/prefer-output-readonly":"error","@angular-eslint/relative-url-prefix":"error","@angular-eslint/sort-ngmodule-metadata-arrays":"error","@angular-eslint/use-component-selector":"error","@angular-eslint/use-component-view-encapsulation":"error","@angular-eslint/use-injectable-provided-in":"error","@angular-eslint/use-lifecycle-interface":"error","@angular-eslint/use-pipe-transform-interface":"error"}},base:{parser:"@typescript-eslint/parser",parserOptions:{ecmaVersion:2020,sourceType:"module",project:"./tsconfig.json"},plugins:["@typescript-eslint","@angular-eslint"]},recommended:{extends:"./configs/base.json",rules:{"@angular-eslint/component-class-suffix":"error","@angular-eslint/contextual-lifecycle":"error","@angular-eslint/directive-class-suffix":"error","@angular-eslint/no-conflicting-lifecycle":"error","@angular-eslint/no-empty-lifecycle-method":"error","@angular-eslint/no-host-metadata-property":"error","@angular-eslint/no-input-rename":"error","@angular-eslint/no-inputs-metadata-property":"error","@angular-eslint/no-output-native":"error","@angular-eslint/no-output-on-prefix":"error","@angular-eslint/no-output-rename":"error","@angular-eslint/no-outputs-metadata-property":"error","@angular-eslint/use-lifecycle-interface":"warn","@angular-eslint/use-pipe-transform-interface":"error"}},"recommended--extra":{extends:"./configs/base.json",rules:{"no-restricted-imports":["error",{paths:[{name:"rxjs/Rx",message:"Please import directly from 'rxjs' instead"}]}],"@typescript-eslint/member-ordering":["error",{default:["static-field","instance-field","static-method","instance-method"]}],"no-restricted-syntax":["error",{selector:'CallExpression[callee.object.name="console"][callee.property.name=/^(debug|info|time|timeEnd|trace)$/]',message:"Unexpected property on console object was called"}],"@typescript-eslint/no-inferrable-types":["error",{ignoreParameters:!0}],"@typescript-eslint/no-non-null-assertion":"error","no-fallthrough":"error"}},"ng-cli-compat":{extends:["./configs/base.json"],env:{browser:!0,es6:!0,node:!0},plugins:["eslint-plugin-import","eslint-plugin-jsdoc","eslint-plugin-prefer-arrow"],rules:{"@typescript-eslint/interface-name-prefix":"off","@typescript-eslint/explicit-member-accessibility":"off","sort-keys":"off","@angular-eslint/component-class-suffix":"error","@angular-eslint/component-selector":["error",{type:"element",prefix:"app",style:"kebab-case"}],"@angular-eslint/contextual-lifecycle":"error","@angular-eslint/directive-class-suffix":"error","@angular-eslint/directive-selector":["error",{type:"attribute",prefix:"app",style:"camelCase"}],"@angular-eslint/no-conflicting-lifecycle":"error","@angular-eslint/no-host-metadata-property":"error","@angular-eslint/no-input-rename":"error","@angular-eslint/no-inputs-metadata-property":"error","@angular-eslint/no-output-native":"error","@angular-eslint/no-output-on-prefix":"error","@angular-eslint/no-output-rename":"error","@angular-eslint/no-outputs-metadata-property":"error","@angular-eslint/use-lifecycle-interface":"error","@angular-eslint/use-pipe-transform-interface":"error","@typescript-eslint/adjacent-overload-signatures":"error","@typescript-eslint/array-type":"off","@typescript-eslint/ban-types":["error",{types:{Object:{message:"Avoid using the `Object` type. Did you mean `object`?"},Function:{message:"Avoid using the `Function` type. Prefer a specific function type, like `() => void`."},Boolean:{message:"Avoid using the `Boolean` type. Did you mean `boolean`?"},Number:{message:"Avoid using the `Number` type. Did you mean `number`?"},String:{message:"Avoid using the `String` type. Did you mean `string`?"},Symbol:{message:"Avoid using the `Symbol` type. Did you mean `symbol`?"}}}],"@typescript-eslint/consistent-type-assertions":"error","@typescript-eslint/dot-notation":"error","@typescript-eslint/member-ordering":"error","@typescript-eslint/naming-convention":"error","@typescript-eslint/no-empty-function":"off","@typescript-eslint/no-empty-interface":"error","@typescript-eslint/no-explicit-any":"off","@typescript-eslint/no-inferrable-types":["error",{ignoreParameters:!0}],"@typescript-eslint/no-misused-new":"error","@typescript-eslint/no-namespace":"error","@typescript-eslint/no-non-null-assertion":"error","@typescript-eslint/no-parameter-properties":"off","@typescript-eslint/no-unused-expressions":"error","@typescript-eslint/no-use-before-define":"off","@typescript-eslint/no-var-requires":"off","@typescript-eslint/prefer-for-of":"error","@typescript-eslint/prefer-function-type":"error","@typescript-eslint/prefer-namespace-keyword":"error","@typescript-eslint/triple-slash-reference":["error",{path:"always",types:"prefer-import",lib:"always"}],"@typescript-eslint/unified-signatures":"error",complexity:"off","constructor-super":"error",eqeqeq:["error","smart"],"guard-for-in":"error","id-blacklist":["error","any","Number","number","String","string","Boolean","boolean","Undefined","undefined"],"id-match":"error","import/no-deprecated":"warn","jsdoc/newline-after-description":"error","jsdoc/no-types":"error","max-classes-per-file":"off","no-bitwise":"error","no-caller":"error","no-cond-assign":"error","no-console":["error",{allow:["log","warn","dir","timeLog","assert","clear","count","countReset","group","groupEnd","table","dirxml","error","groupCollapsed","Console","profile","profileEnd","timeStamp","context"]}],"no-debugger":"error","no-empty":"off","no-eval":"error","no-fallthrough":"error","no-invalid-this":"off","no-new-wrappers":"error","no-restricted-imports":["error",{name:"rxjs/Rx",message:"Please import directly from 'rxjs' instead"}],"@typescript-eslint/no-shadow":["error",{hoist:"all"}],"no-throw-literal":"error","no-undef-init":"error","no-underscore-dangle":"error","no-unsafe-finally":"error","no-unused-labels":"error","no-var":"error","object-shorthand":"error","one-var":["error","never"],"prefer-arrow/prefer-arrow-functions":"error","prefer-const":"error",radix:"error","use-isnan":"error","valid-typeof":"off"}},"ng-cli-compat--formatting-add-on":{plugins:["eslint-plugin-jsdoc"],rules:{"arrow-body-style":"error","arrow-parens":"off","comma-dangle":"off",curly:"error","eol-last":"error","jsdoc/check-alignment":"error","max-len":["error",{code:140}],"new-parens":"error","no-multiple-empty-lines":"off","no-trailing-spaces":"error","quote-props":["error","as-needed"],"space-before-function-paren":["error",{anonymous:"never",asyncArrow:"always",named:"never"}],"@typescript-eslint/member-delimiter-style":["error",{multiline:{delimiter:"semi",requireLast:!0},singleline:{delimiter:"semi",requireLast:!1}}],quotes:"off","@typescript-eslint/quotes":["error","single",{allowTemplateLiterals:!0}],"@typescript-eslint/semi":["error","always"],"@typescript-eslint/type-annotation-spacing":"error"}}},rules:{"contextual-decorator":xe,"component-class-suffix":_e,"component-max-inline-declarations":$e,"component-selector":Ye,"contextual-lifecycle":He,"directive-class-suffix":We,"directive-selector":ze,"no-attribute-decorator":Ge,"no-conflicting-lifecycle":et,"no-forward-ref":tt,"no-host-metadata-property":nt,"no-input-prefix":ot,"no-input-rename":lt,"no-inputs-metadata-property":pt,"no-lifecycle-call":ut,"no-output-native":gt,"no-output-on-prefix":ft,"no-output-rename":yt,"no-outputs-metadata-property":St,"no-pipe-impure":Tt,"no-queries-metadata-property":xt,"no-empty-lifecycle-method":vt,[bt]:Et,"prefer-output-readonly":wt,"relative-url-prefix":Dt,"sort-ngmodule-metadata-arrays":Ot,"use-component-selector":At,"use-component-view-encapsulation":Nt,"use-injectable-provided-in":kt,"use-lifecycle-interface":Mt,"use-pipe-transform-interface":jt,"pipe-prefix":_t}};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Options } from '../utils/property-selector';
|
|
2
2
|
export declare const RULE_NAME = "component-selector";
|
|
3
|
-
export declare type MessageIds = 'prefixFailure' | 'styleFailure' | 'typeFailure';
|
|
3
|
+
export declare type MessageIds = 'prefixFailure' | 'styleFailure' | 'typeFailure' | 'shadowDomEncapsulatedStyleFailure';
|
|
4
4
|
declare const _default: import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleModule<MessageIds, Options, import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleListener>;
|
|
5
5
|
export default _default;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
declare type Options = [
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
5
|
-
];
|
|
1
|
+
declare type Options = [{
|
|
2
|
+
readonly prefixes: readonly string[];
|
|
3
|
+
}];
|
|
6
4
|
export declare type MessageIds = 'noInputPrefix';
|
|
7
5
|
export declare const RULE_NAME = "no-input-prefix";
|
|
8
6
|
declare const _default: import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleModule<"noInputPrefix", Options, import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleListener>;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
declare type Options = [
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
];
|
|
6
|
-
export declare type MessageIds = 'noInputRename';
|
|
1
|
+
declare type Options = [{
|
|
2
|
+
readonly allowedNames?: readonly string[];
|
|
3
|
+
}];
|
|
4
|
+
export declare type MessageIds = 'noInputRename' | 'suggestRemoveAliasName' | 'suggestReplaceOriginalNameWithAliasName';
|
|
7
5
|
export declare const RULE_NAME = "no-input-rename";
|
|
8
|
-
declare const _default: import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleModule<
|
|
6
|
+
declare const _default: import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleModule<MessageIds, Options, import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleListener>;
|
|
9
7
|
export default _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare type MessageIds = 'noPipeImpure';
|
|
1
|
+
export declare type MessageIds = 'noPipeImpure' | 'suggestRemovePipeImpure';
|
|
2
2
|
export declare const RULE_NAME = "no-pipe-impure";
|
|
3
|
-
declare const _default: import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleModule<
|
|
3
|
+
declare const _default: import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleModule<MessageIds, [], import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleListener>;
|
|
4
4
|
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getAriaAttributeKeys(): ReadonlySet<string>;
|
|
@@ -4,7 +4,16 @@ export declare const DIRECTIVE_CLASS_DECORATOR = "ClassDeclaration > Decorator[e
|
|
|
4
4
|
export declare const PIPE_CLASS_DECORATOR = "ClassDeclaration > Decorator[expression.callee.name=\"Pipe\"]";
|
|
5
5
|
export declare const INJECTABLE_CLASS_DECORATOR = "ClassDeclaration > Decorator[expression.callee.name=\"Injectable\"]";
|
|
6
6
|
export declare const MODULE_CLASS_DECORATOR = "ClassDeclaration > Decorator[expression.callee.name=\"NgModule\"]";
|
|
7
|
+
export declare const INPUT_DECORATOR = "Decorator[expression.callee.name=\"Input\"]";
|
|
7
8
|
export declare const OUTPUT_DECORATOR = "Decorator[expression.callee.name=\"Output\"]";
|
|
8
|
-
export declare const
|
|
9
|
+
export declare const LITERAL_OR_TEMPLATE_ELEMENT = ":matches(Literal, TemplateElement)";
|
|
10
|
+
export declare function metadataProperty<TKey extends string>(key: TKey): `Property:matches([key.name='${TKey}'][computed=false], [key.value='${TKey}'], [key.quasis.0.value.raw='${TKey}'])`;
|
|
11
|
+
export declare const COMPONENT_SELECTOR_LITERAL: string;
|
|
12
|
+
export declare const DIRECTIVE_SELECTOR_LITERAL: string;
|
|
13
|
+
export declare const COMPONENT_OR_DIRECTIVE_SELECTOR_LITERAL: string;
|
|
14
|
+
export declare const INPUTS_METADATA_PROPERTY_LITERAL: string;
|
|
15
|
+
export declare const INPUT_ALIAS: string;
|
|
16
|
+
export declare const INPUT_PROPERTY_OR_SETTER: string;
|
|
17
|
+
export declare const OUTPUTS_METADATA_PROPERTY_LITERAL: string;
|
|
9
18
|
export declare const OUTPUT_ALIAS: string;
|
|
10
19
|
export declare const OUTPUT_PROPERTY_OR_GETTER: string;
|
package/dist/utils/utils.d.ts
CHANGED
|
@@ -104,7 +104,7 @@ export declare function getImportDeclarations(node: TSESTree.Node, moduleName: s
|
|
|
104
104
|
export declare function getImplementsRemoveFix(sourceCode: Readonly<TSESLint.SourceCode>, classDeclaration: TSESTree.ClassDeclaration, interfaceName: string, fixer: TSESLint.RuleFixer): TSESLint.RuleFix | undefined;
|
|
105
105
|
export declare function getNodeToCommaRemoveFix(sourceCode: Readonly<TSESLint.SourceCode>, node: TSESTree.Node, fixer: TSESLint.RuleFixer): TSESLint.RuleFix;
|
|
106
106
|
export declare function getLast<T extends readonly unknown[]>(items: T): T[number];
|
|
107
|
-
export declare function getImportAddFix(node: TSESTree.ClassDeclaration, moduleName: string, importedName: string, fixer: TSESLint.RuleFixer): TSESLint.RuleFix;
|
|
107
|
+
export declare function getImportAddFix(node: TSESTree.ClassDeclaration, moduleName: string, importedName: string, fixer: TSESLint.RuleFixer): TSESLint.RuleFix | undefined;
|
|
108
108
|
export declare function getImportRemoveFix(sourceCode: Readonly<TSESLint.SourceCode>, importDeclarations: readonly TSESTree.ImportDeclaration[], importedName: string, fixer: TSESLint.RuleFixer): TSESLint.RuleFix | undefined;
|
|
109
109
|
export declare function getImplementsSchemaFixer({ id, implements: implementz }: TSESTree.ClassDeclaration, interfaceName: string): {
|
|
110
110
|
readonly implementsNodeReplace: TSESTree.TSClassImplements | TSESTree.Identifier;
|
|
@@ -163,8 +163,8 @@ export declare function isImportedFrom(identifier: TSESTree.Identifier, moduleNa
|
|
|
163
163
|
*/
|
|
164
164
|
export declare const toHumanReadableText: (items: readonly string[]) => string;
|
|
165
165
|
export declare const toPattern: (value: readonly unknown[]) => RegExp;
|
|
166
|
-
export declare function getRawText(node: TSESTree.Identifier | TSESTree.
|
|
167
|
-
export declare function getReplacementText(node: TSESTree.
|
|
166
|
+
export declare function getRawText(node: TSESTree.Identifier | TSESTree.Literal | TSESTree.TemplateElement | TSESTree.TemplateLiteral): string;
|
|
167
|
+
export declare function getReplacementText(node: TSESTree.Literal | TSESTree.TemplateElement | TSESTree.TemplateLiteral, text: string): string;
|
|
168
168
|
export declare function capitalize<T extends string>(text: T): Capitalize<T>;
|
|
169
169
|
export declare function withoutBracketsAndWhitespaces(text: string): string;
|
|
170
170
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular-eslint/eslint-plugin",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.3.1",
|
|
4
4
|
"description": "ESLint plugin for Angular applications, following angular.io/styleguide",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -20,12 +20,12 @@
|
|
|
20
20
|
"@typescript-eslint/experimental-utils": "4.28.2"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@angular-eslint/utils": "12.
|
|
23
|
+
"@angular-eslint/utils": "12.3.1"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
26
|
"@angular/compiler": ">= 12.0.0 < 13.0.0",
|
|
27
27
|
"eslint": "*",
|
|
28
28
|
"typescript": "*"
|
|
29
29
|
},
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "9919aa840c82ba796129ebd4d94fff27b1e41181"
|
|
31
31
|
}
|