@angular-eslint/eslint-plugin 12.3.2-alpha.4 → 12.4.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 +17 -0
- package/dist/index.js +1 -1
- package/dist/rules/prefer-on-push-component-change-detection.d.ts +2 -2
- package/dist/rules/sort-ngmodule-metadata-arrays.d.ts +1 -1
- package/dist/rules/use-injectable-provided-in.d.ts +5 -2
- package/dist/utils/selectors.d.ts +4 -1
- package/dist/utils/utils.d.ts +25 -10
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,23 @@
|
|
|
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.4.1](https://github.com/angular-eslint/angular-eslint/compare/v12.4.0...v12.4.1) (2021-09-09)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @angular-eslint/eslint-plugin
|
|
9
|
+
|
|
10
|
+
# [12.4.0](https://github.com/angular-eslint/angular-eslint/compare/v12.3.1...v12.4.0) (2021-09-09)
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
- **eslint-plugin:** [no-empty-lifecycle-method] incorrect suggestions and correct reports ([#606](https://github.com/angular-eslint/angular-eslint/issues/606)) ([a446e8f](https://github.com/angular-eslint/angular-eslint/commit/a446e8ff521725d354dc23242c4ad23bc52c9681))
|
|
15
|
+
- **eslint-plugin:** [sort-ngmodule-metadata-arrays] handle literal metadata and computed properties ([#667](https://github.com/angular-eslint/angular-eslint/issues/667)) ([f993069](https://github.com/angular-eslint/angular-eslint/commit/f99306977254e2894ad769448f0cbebd7665cbcd))
|
|
16
|
+
- **eslint-plugin:** properly handle computed literals for some rules ([#600](https://github.com/angular-eslint/angular-eslint/issues/600)) ([fbd6ff7](https://github.com/angular-eslint/angular-eslint/commit/fbd6ff7e5c5e4e249cbb5159c36cac3416e9ae3b))
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
- **eslint-plugin:** [prefer-on-push-component-change-detection] add suggestion ([#666](https://github.com/angular-eslint/angular-eslint/issues/666)) ([3723c4c](https://github.com/angular-eslint/angular-eslint/commit/3723c4ca591ba8b62b78717e683ee82e7a5a4b07))
|
|
21
|
+
- **eslint-plugin:** [use-injectable-provided-in] add suggestion ([#594](https://github.com/angular-eslint/angular-eslint/issues/594)) ([bdef8c7](https://github.com/angular-eslint/angular-eslint/commit/bdef8c77bcc72aa20c58c2c5c8fd0489675adcfd))
|
|
22
|
+
|
|
6
23
|
## [12.3.1](https://github.com/angular-eslint/angular-eslint/compare/v12.3.0...v12.3.1) (2021-07-15)
|
|
7
24
|
|
|
8
25
|
### Bug Fixes
|
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 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
|
+
var e=require("@typescript-eslint/experimental-utils/dist/eslint-utils"),t=require("@typescript-eslint/experimental-utils"),r=require("@angular/compiler");const n=(a=e=>`https://github.com/angular-eslint/angular-eslint/blob/master/packages/eslint-plugin-template/docs/rules/${e}.md`,function({name:t,meta:r,defaultOptions:n,create:o}){return{meta:Object.assign(Object.assign({},r),{docs:Object.assign(Object.assign({},r.docs),{url:a(t)})}),defaultOptions:n,create(t){const r=e.applyDefault(n,t.options);return o(t,r)}}});var a;function o(){return(o=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 s="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function i(e){var t={exports:{}};return e(t,t.exports),t.exports}var l=i(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 p={__proto__:null};Object.defineProperty(exports,"__esModule",{value:!0});var c={__proto__:null},u=i(function(e,t){var r=s&&s.__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=s&&s.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=s&&s.__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=a(l)}),d=i(function(e,t){var r=s&&s.__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=s&&s.__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 l.AST_NODE_TYPES}});var a=l;Object.defineProperty(t,"AST_TOKEN_TYPES",{enumerable:!0,get:function(){return a.AST_TOKEN_TYPES}}),n(p,t),n(c,t),n(u,t)});const m=Object.keys;var g,f,y,h;!function(e){e.Component="Component",e.Directive="Directive",e.Injectable="Injectable",e.NgModule="NgModule",e.Pipe="Pipe"}(g||(g={})),function(e){e.Attribute="Attribute",e.Host="Host",e.Inject="Inject",e.Optional="Optional",e.Self="Self",e.SkipSelf="SkipSelf"}(f||(f={})),function(e){e.HostListener="HostListener"}(y||(y={})),function(e){e.ContentChild="ContentChild",e.ContentChildren="ContentChildren",e.HostBinding="HostBinding",e.Input="Input",e.Output="Output",e.ViewChild="ViewChild",e.ViewChildren="ViewChildren"}(h||(h={}));const S=o({},f,y,h);var T,x;!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"}(T||(T={})),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"}(x||(x={}));const v="camelCase",b="kebab-case",E=m(g),I=m(S),w=m(T),D=m(x),C=new Map([[g.Component,new Set([x.ngAfterContentChecked,x.ngAfterContentInit,x.ngAfterViewChecked,x.ngAfterViewInit,x.ngOnChanges,x.ngOnDestroy,x.ngOnInit,x.ngDoCheck])],[g.Directive,new Set([x.ngAfterContentChecked,x.ngAfterContentInit,x.ngAfterViewChecked,x.ngAfterViewInit,x.ngOnChanges,x.ngOnDestroy,x.ngOnInit,x.ngDoCheck])],[g.Injectable,new Set([x.ngOnDestroy])],[g.NgModule,new Set([x.ngDoBootstrap])],[g.Pipe,new Set([x.ngOnDestroy])]]),P=new Set(I),O=new Set(E),A=new Map([[g.Component,P],[g.Directive,P],[g.Injectable,new Set([S.Host,S.Inject,S.Optional,S.Self,S.SkipSelf])],[g.NgModule,new Set([S.Host,S.Inject,S.Optional,S.Self,S.SkipSelf])],[g.Pipe,new Set([S.Host,S.Inject,S.Optional,S.Self,S.SkipSelf])]]);function N(e){return e.type===d.AST_NODE_TYPES.CallExpression}function k(e){return e.type===d.AST_NODE_TYPES.MemberExpression}function j(e){return t.ASTUtils.isIdentifier(e)||k(e)}function $(e){return e.type===d.AST_NODE_TYPES.ClassDeclaration}function M(e){return e.type===d.AST_NODE_TYPES.ClassProperty}function _(e){return M(e)||X(e)}function R(e){return e.type===d.AST_NODE_TYPES.ObjectExpression}function B(e){return e.type===d.AST_NODE_TYPES.ArrayExpression}function K(e){return e.type===d.AST_NODE_TYPES.Property}function L(e){return e.type===d.AST_NODE_TYPES.Program}function U(e){return e.type===d.AST_NODE_TYPES.Literal}function V(e){return e.type===d.AST_NODE_TYPES.TemplateLiteral}function F(e){return e.type===d.AST_NODE_TYPES.ImportDeclaration}function J(e){return U(e)&&"string"==typeof e.value}function X(e){return e.type===d.AST_NODE_TYPES.MethodDefinition}function q({parent:e},t){for(;e&&!L(e);){if(t(e))return e;e=e.parent}return null}function Y(e,t){let r=e;for(;r=r.parent;)if(L(r))return r.body.filter(e=>F(e)&&e.source.value===t);return r}function W(e,t,r,n){const{implements:a}=t;if(!a)return;const o=function(e,t){return ae(e).find(e=>se(e)===t)}(t,r);if(!o)return;const s=a[0].expression===o,i=G(a).expression===o,l=s&&i,p=e.getTokenBefore(o);if(l)return p&&(c=p).type===d.AST_TOKEN_TYPES.Keyword&&"implements"===c.value?n.removeRange([p.range[0],a[0].range[1]]):void 0;var c;if(s){const t=e.getTokenAfter(o);return t?n.removeRange([o.range[0],t.range[1]]):void 0}return p?n.removeRange([p.range[0],o.range[1]]):void 0}function H(e,r,n){const a=e.getTokenAfter(r);return a&&t.ASTUtils.isCommaToken(a)?n.removeRange([r.range[0],a.range[1]]):n.remove(r)}function z(e,t){for(const r of e){const e=r.specifiers.find(e=>e.type===d.AST_NODE_TYPES.ImportSpecifier&&e.imported.name===t);if(e)return{importDeclaration:r,importSpecifier:e}}}function G(e){return e.slice(-1)[0]}function Q({compatibleWithTypeOnlyImport:e=!1,fixer:t,importName:r,moduleName:n,node:a}){const o=`import { ${r} } from '${n}';\n`,s=Y(a,n);if(null==s||!s.length)return t.insertTextAfterRange([0,0],o);if(z(s,r))return;const i=function(e,t=!1){let r;for(const{importKind:n,specifiers:a}of e){const e=G(a);!t&&"type"===n||e.type===d.AST_NODE_TYPES.ImportNamespaceSpecifier||(r=e)}return r}(s,e);if(!i)return t.insertTextAfterRange([0,0],o);const l=function(e){return e.type===d.AST_NODE_TYPES.ImportDefaultSpecifier}(i)?`, { ${r} }`:`, ${r}`;return t.insertTextAfter(i,l)}function Z(e,t,r,n){var a;const{importDeclaration:o,importSpecifier:s}=null!=(a=z(t,r))?a:{};if(!o||!s)return;const i=o.specifiers[0]===s,l=G(o.specifiers)===s;if(i&&l)return n.remove(o);const p=e.getTokenAfter(s);if(i&&p)return n.removeRange([s.range[0],p.range[1]]);const c=e.getTokenBefore(s);return c?n.removeRange([c.range[0],s.range[1]]):void 0}function ee({expression:e},t,r){if(!N(e))return;const[n]=e.arguments;if(!n||!R(n)){const[n,a]=e.range;return t.insertTextAfterRange([n+1,a-1],`{${r}}`)}const{properties:a}=n;if(0===a.length){const[e,a]=n.range;return t.insertTextAfterRange([e+1,a-1],r)}return t.insertTextBefore(a[0],`${r},`)}const te=e=>{var t;return $(e)?null==(t=e.id)?void 0:t.name:e.parent?te(e.parent):void 0},re=({decorators:e})=>null==e?void 0:e.map(ne).filter(he).find(de),ne=({expression:e})=>t.ASTUtils.isIdentifier(e)?e.name:N(e)&&t.ASTUtils.isIdentifier(e.callee)?e.callee.name:void 0;function ae(e){var t;return(null!=(t=e.implements)?t:[]).map(({expression:e})=>e).filter(j)}function oe(e){return ae(e).map(se).filter(he)}function se(e){return t.ASTUtils.isIdentifier(e)?e.name:t.ASTUtils.isIdentifier(e.property)?e.property.name:void 0}const ie=e=>oe(e).filter(ce),le=new Set(w),pe=new Set(D),ce=e=>le.has(e),ue=e=>pe.has(e),de=e=>O.has(e),me=(e,r)=>{var n;return null==(n=((e,r)=>{var n;return null==(n=(({expression:e})=>{if(!N(e)||0===e.arguments.length)return;const[t]=e.arguments;return R(t)&&t.properties?t:void 0})(e))?void 0:n.properties.filter(K).find(({key:e})=>t.ASTUtils.isIdentifier(e)&&e.name===r)})(e,r))?void 0:n.value},ge=({body:{body:e}})=>e.filter(X),fe=({computed:e,key:r})=>J(r)?r.value:t.ASTUtils.isIdentifier(r)&&!e?r.name:void 0;function ye(e){return Array.isArray(e)?e:e?[e]:[]}const he=e=>null!=e,Se={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===v)return!a||a[0]===a[0].toUpperCase();if(t===b)return!a||"-"===a[0];throw Error("Invalid selector style!")}}},Te=e=>e.replace(/-[a-zA-Z]/g,({1:e})=>e.toUpperCase()),xe=e=>{const t=e.length;return 1===t?`"${e[0]}"`:`${e.map(e=>`"${e}"`).slice(0,t-1).join(", ")} or "${[...e].pop()}"`},ve=e=>RegExp(`^(${e.join("|")})$`);function be(e){if(t.ASTUtils.isIdentifier(e))return e.name;if(M(e)||X(e)||K(e))return be(e.key);if(U(e))return String(e.value);if(function(e){return e.type===d.AST_NODE_TYPES.TemplateElement}(e))return e.value.raw;if(V(e))return e.quasis[0].value.raw;throw Error(`Unexpected \`node.type\` provided: ${e.type}`)}function Ee(e,t){return U(e)?`'${t}'`:`\`${t}\``}function Ie(e){return`${e[0].toUpperCase()}${e.slice(1)}`}function we(e){return e.replace(/[[\]\s]/g,"")}var De=n({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=q(t,$);if(!n)return;const a=re(n);if(a)for(const r of t.decorators)Ce(e,r,a)}(e,t)}})});function Ce(e,t,r){const n=ne(t);if(!n||!P.has(n))return;const a=A.get(r);null!=a&&a.has(n)||e.report({node:t,messageId:"contextualDecorator",data:{classDecoratorName:r}})}const Pe="ClassDeclaration > Decorator[expression.callee.name=/^(Component|Directive)$/]",Oe='ClassDeclaration > Decorator[expression.callee.name="Component"]',Ae='ClassDeclaration > Decorator[expression.callee.name="Directive"]',Ne='ClassDeclaration > Decorator[expression.callee.name="Pipe"]',ke='Decorator[expression.callee.name="Output"]';function je(e){return`Property:matches([key.name=${e}][computed=false], [key.value=${e}], [key.quasis.0.value.raw=${e}])`}const $e=`:matches(${Oe} ${je("selector")} :matches(Literal, TemplateElement), ${Ae} ${je("selector")} :matches(Literal, TemplateElement))`,Me=`${Pe} ${je("inputs")} > ArrayExpression :matches(Literal, TemplateElement)`,_e=":matches(ClassProperty, MethodDefinition[kind='set']) Decorator[expression.callee.name=\"Input\"] :matches(Literal, TemplateElement)",Re=":matches(ClassProperty, MethodDefinition[kind='set'])[computed=false]:has(Decorator[expression.callee.name=\"Input\"]) > :matches(Identifier, Literal)",Be=`${Pe} ${je("outputs")} > ArrayExpression :matches(Literal, TemplateElement)`,Ke=`:matches(ClassProperty, MethodDefinition[kind='get']) ${ke} :matches(Literal, TemplateElement)`,Le=`:matches(ClassProperty, MethodDefinition[kind='get'])[computed=false]:has(${ke}) > :matches(Identifier, Literal)`;var Ue=n({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}])=>({[Oe](r){const n=r.parent,a=te(n);a&&t.some(e=>a.endsWith(e))||e.report({node:n.id?n.id:n,messageId:"componentClassSuffix",data:{suffixes:xe(t)}})}})});const Ve=/\r\n|\r|\n/;function Fe(e){return V(e)?e.quasis[0].value.raw.trim().split(Ve).length:U(e)?e.raw.trim().split(Ve).length:0}var Je=n({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}])=>({[`${Oe} Property[key.name='template']`]({value:r}){const n=Fe(r);n<=t||e.report({node:r,messageId:"componentMaxInlineDeclarations",data:{lineCount:n,max:t,propertyType:"template"}})},[`${Oe} Property[key.name='styles']`]({value:t}){if(!B(t))return;const n=t.elements.reduce((e,t)=>e+Fe(t),0);n<=r||e.report({node:t,messageId:"componentMaxInlineDeclarations",data:{lineCount:n,max:r,propertyType:"styles"}})},[`${Oe} Property[key.name='animations']`]({value:t}){if(!B(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 Xe="attribute",qe="element",Ye={[Xe]:"attrs",[qe]:qe},We=(e,t,r)=>{r.report({node:e,messageId:"prefixFailure",data:{prefix:xe(ye(t))}})},He=(e,t,r)=>{r.report({node:e,messageId:"styleFailure",data:{style:t}})},ze=(e,t,r)=>{r.report({node:e,messageId:"typeFailure",data:{type:t}})},Ge=(e,t,r)=>{const n=ye(e),a=r,o=n.length>0&&n.every(e=>-1!==[qe,Xe].indexOf(e)),s=t.length>0,i=-1!==[v,b].indexOf(a);return o&&s&&i},Qe=(e,t,n,a)=>{const o=ye(t||["attrs",qe]).reduce((e,t)=>e.concat(Ye[t]),[]),s=a===b?Se.kebabCase:Se.camelCase;let i=null;if(e&&U(e)?i=r.CssSelector.parse(e.raw):e&&V(e)&&e.quasis[0]&&(i=r.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),p=l.some(e=>n.some(t=>Se.prefix(t,a)(e))),c=l.some(e=>s(e));return{hasExpectedPrefix:p,hasExpectedType:l.length>0,hasExpectedStyle:c}};var Ze=n({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:[qe,Xe]}}]},prefix:{oneOf:[{type:"string"},{type:"array"}]},style:{type:"string",enum:[v,b]}},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 \`${b}\` (https://github.com/angular-eslint/angular-eslint/issues/534)`}},defaultOptions:[{type:"",prefix:"",style:""}],create:(e,[{type:r,prefix:n,style:a}])=>({[Oe](o){const s=me(o,"selector");if(!s)return;if(!Ge(r,n,a))return;const i=a!==b&&function(e){const r=me(e,"encapsulation");return r&&k(r)&&t.ASTUtils.isIdentifier(r.object)&&"ViewEncapsulation"===r.object.name&&t.ASTUtils.isIdentifier(r.property)&&"ShadowDom"===r.property.name}(o)?b:a,l=Qe(s,r,ye(n),i);null!==l&&(l.hasExpectedType?l.hasExpectedStyle?l.hasExpectedPrefix||We(s,n,e):a===i?He(s,a,e):e.report({node:s,messageId:"shadowDomEncapsulatedStyleFailure"}):ze(s,r,e))}})}),et=n({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=C.get(r),o=ge(n);for(const t of o){const n=fe(t);!n||!ue(n)||null!=a&&a.has(n)||e.report({node:t.key,messageId:"contextualLifecycle",data:{classDecoratorName:r,methodName:n}})}}return{[Oe](e){t(e,g.Component)},[Ae](e){t(e,g.Directive)},'ClassDeclaration > Decorator[expression.callee.name="Injectable"]'(e){t(e,g.Injectable)},'ClassDeclaration > Decorator[expression.callee.name="NgModule"]'(e){t(e,g.NgModule)},[Ne](e){t(e,g.Pipe)}}}}),tt=n({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}])=>({[Ae](r){if(!me(r,"selector"))return;const n=r.parent,a=te(n),o=oe(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:xe(s)}})}})}),rt=n({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:[qe,Xe]}}]},prefix:{oneOf:[{type:"string"},{type:"array"}]},style:{type:"string",enum:[v,b]}},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}])=>({[Ae](a){const o=me(a,"selector");if(!o)return;if(!Ge(t,r,n))return;const s=Qe(o,t,ye(r),n);null!==s&&(s.hasExpectedType?s.hasExpectedStyle?s.hasExpectedPrefix||We(o,r,e):He(o,n,e):ze(o,t,e))}})}),nt=n({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 at=[T.DoCheck,T.OnChanges],ot=[x.ngDoCheck,x.ngOnChanges];var st=n({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 ${T.DoCheck} and ${T.OnChanges} in a class is not recommended`,noConflictingLifecycleMethod:`Declaring ${x.ngDoCheck} and ${x.ngOnChanges} method in a class is not recommended`}},defaultOptions:[],create:e=>({ClassDeclaration(r){(t=>{const r=ie(t);if(!at.every(e=>r.includes(e)))return;const n=ae(t).filter(e=>{const t=se(e);return t&&ce(t)});for(const t of n)e.report({node:t,messageId:"noConflictingLifecycleInterface"})})(r),(r=>{const n=(e=>ge(e).map(fe).filter(he).filter(ue))(r);if(!ot.every(e=>n.includes(e)))return;const a=ge(r).filter(e=>t.ASTUtils.isIdentifier(e.key)&&ue(e.key.name));for(const t of a)e.report({node:t,messageId:"noConflictingLifecycleMethod"})})(r)}})}),it=n({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 lt={allowStatic:!1};var pt=n({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:lt.allowStatic}},additionalProperties:!1}],messages:{noHostMetadataProperty:`Use @${S.HostBinding} or @${S.HostListener} rather than the \`host\` metadata property (https://angular.io/styleguide#style-06-03)`}},defaultOptions:[lt],create:(e,[{allowStatic:t}])=>({[`${Pe} Property[key.name="host"]`](r){(t&&R(r.value)?r.value.properties.filter(ct):[r]).forEach(t=>{e.report({node:t,messageId:"noHostMetadataProperty"})})}})});function ct(e){return K(e)&&!function(e){return!e.computed&&(t.ASTUtils.isIdentifier(e.key)||J(e.key)&&function({0:e}){return e.toLowerCase()!==e.toUpperCase()}(e.key.value))}(e)&&!function(e){return J(e.value)&&""===e.value.value}(e)}var ut=n({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}])=>({[[Me,_e,Re].join(",")](r){const[n,a]=be(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:xe(t)}})}})});let dt=null;function mt(){var e;return null!=(e=dt)?e:dt=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 gt=n({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(e,[{allowedNames:r=[]}]){let n=new Set;const a=mt();return{[$e](e){n=new Set(we(be(e)).split(","))},[_e](o){const s=q(o,_);if(!s||!t.ASTUtils.isIdentifier(s.key))return;const i=be(o),l=be(s.key);r.includes(i)||a.has(i)&&l===Te(i)||(i===l?e.report({node:o,messageId:"noInputRename",fix:e=>e.remove(o)}):ft(n,l,i)||e.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)]}]}))},[Me](t){const[o,s]=we(be(t)).split(":");!s||r.includes(s)||a.has(s)&&o===Te(s)||(s===o?e.report({node:t,messageId:"noInputRename",fix:e=>e.replaceText(t,Ee(t,o))}):ft(n,o,s)||e.report({node:t,messageId:"noInputRename",suggest:[["suggestRemoveAliasName",o],["suggestReplaceOriginalNameWithAliasName",s]].map(([e,r])=>({messageId:e,fix:e=>e.replaceText(t,Ee(t,r))}))}))},"ClassDeclaration:exit"(){n=new Set}}}});function ft(e,t,r){return[...e].some(e=>e===r||function(e,t){return`${e}${Ie(t)}`}(e,t)===r)}var yt=n({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=>({[`${Pe} ${je("inputs")}`](t){e.report({node:t,messageId:"noInputsMetadataProperty"})}})}),ht=n({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:e=>({[`ClassDeclaration CallExpression > MemberExpression[property.name=${ve([...pe])}]`]:r=>{const n=q(r,$);!n||!re(n)||function(e){return e.type===d.AST_NODE_TYPES.Super}(r.object)&&function(e){const r=q(e,X);return Boolean(r&&function({property:e},{key:r}){return t.ASTUtils.isIdentifier(e)&&t.ASTUtils.isIdentifier(r)&&e.name===r.name}(e,r))}(r)||e.report({node:r.parent,messageId:"noLifecycleCall"})}})});let St=null;function Tt(){var e;return null!=(e=St)?e:St=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 xt=n({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=Tt();return{[[Be,Ke,Le].join(",")](r){const[n,a]=be(r).replace(/\s/g,"").split(":");(t.has(n)||t.has(a))&&e.report({node:r,messageId:"noOutputNative"})}}}}),vt=n({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{[[Be,Ke,Le].join(",")](r){const[n,a]=be(r).replace(/\s/g,"").split(":");(t.test(n)||t.test(a))&&e.report({node:r,messageId:"noOutputOnPrefix"})}}}}),bt=n({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(e){let r=new Set;return{[$e](e){r=new Set(we(be(e)).split(","))},[Ke](n){const a=q(n,_);if(!a||!t.ASTUtils.isIdentifier(a.key))return;const o=be(n),s=be(a.key);o===s?e.report({node:n,messageId:"noOutputRename",fix:e=>e.remove(n)}):Et(r,s,o)||e.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)]}]})},[Be](t){const[n,a]=we(be(t)).split(":");a&&(a===n?e.report({node:t,messageId:"noOutputRename",fix:e=>e.replaceText(t,Ee(t,n))}):Et(r,n,a)||e.report({node:t,messageId:"noOutputRename",suggest:[["suggestRemoveAliasName",n],["suggestReplaceOriginalNameWithAliasName",a]].map(([e,r])=>({messageId:e,fix:e=>e.replaceText(t,Ee(t,r))}))}))},"ClassDeclaration:exit"(){r=new Set}}}});function Et(e,t,r){return[...e].some(e=>e===r||function(e,t){return`${e}${Ie(t)}`}(e,t)===r)}var It=n({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=>({[`${Pe} ${je("outputs")}`](t){e.report({node:t,messageId:"noOutputsMetadataProperty"})}})}),wt=n({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{[`${Ne} ${je("pure")}:matches([value.value=false], [value.operator='!'][value.argument.value=true])`](r){e.report({node:r,messageId:"noPipeImpure",suggest:[{messageId:"suggestRemovePipeImpure",fix:e=>H(t,r,e)}]})}}}}),Dt=n({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 @${S.Output} rather than the \`queries\` metadata property (https://angular.io/styleguide#style-05-12)`}},defaultOptions:[],create:e=>({[Pe](t){const r=me(t,"queries");r&&e.report({node:r.parent,messageId:"noQueriesMetadataProperty"})}})}),Ct=n({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:has(Decorator[expression.callee.name=/^(Component|Directive|Injectable|NgModule|Pipe)$/]) > ClassBody > ${r=ve([...pe]),`MethodDefinition:matches([key.name=${r}][computed=false], [key.value=${r}], [key.quasis.0.value.raw=${r}])`}[value.body.body.length=0]`](r){e.report({node:r,messageId:"noEmptyLifecycleMethod",suggest:[{messageId:"suggestRemoveLifecycleMethod",fix:e=>{var n;const a=null!=(n=Y(r,"@angular/core"))?n:[],o=be(r).replace(/^ng+/,""),s=function(e,t){return e.split(" ").filter(e=>function(e){return e.replace(/[\W]/g,"")}(e)===t).length}(t.getText(),o);return[e.remove(r),W(t,r.parent.parent,o,e),s<=2?Z(t,a,o,e):null].filter(he)}}]})}};var r}});const Pt="prefer-on-push-component-change-detection",Ot="ChangeDetectionStrategy.OnPush";var At=n({name:Pt,meta:{type:"suggestion",docs:{description:`Ensures component's \`changeDetection\` is set to \`${Ot}\``,category:"Best Practices",recommended:!1,suggestion:!0},schema:[],messages:{preferOnPushComponentChangeDetection:`The component's \`changeDetection\` value should be set to \`${Ot}\``,suggestAddChangeDetectionOnPush:`Add \`${Ot}\``}},defaultOptions:[],create(e){const t=je("changeDetection");return{[[`${Oe}:matches([expression.arguments.length=0], [expression.arguments.0.type='ObjectExpression']:not(:has(${t})))`,`${Oe} > CallExpression > ObjectExpression > ${t}:matches([value.type='Identifier'][value.name='undefined'], [value.object.name='ChangeDetectionStrategy'][value.property.name!='OnPush'])`].join(",")](t){e.report({node:Nt(t),messageId:"preferOnPushComponentChangeDetection",suggest:[{messageId:"suggestAddChangeDetectionOnPush",fix:e=>K(t)?[Q({fixer:e,importName:"ChangeDetectionStrategy",moduleName:"@angular/core",node:t.parent.parent.parent.parent}),k(t.value)?e.replaceText(t.value.property,"OnPush"):e.replaceText(t.value,Ot)].filter(he):[Q({fixer:e,importName:"ChangeDetectionStrategy",moduleName:"@angular/core",node:t.parent}),ee(t,e,`changeDetection: ${Ot}`)].filter(he)}]})}}}});function Nt(e){return K(e)?k(e.value)?e.value.property:e.value:e}var kt=n({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]) > ${ke}`]({parent:{key:t}}){e.report({node:t,messageId:"preferOutputReadonly",suggest:[{messageId:"suggestAddReadonlyModifier",fix:e=>e.insertTextBefore(t,"readonly ")}]})}})});const jt=/^\.\.?\/.+/;var $t=n({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=>({[`${Oe} Property[key.name='templateUrl']`]({value:t}){Mt(t)&&e.report({node:t,messageId:"relativeUrlPrefix"})},[`${Oe} Property[key.name='styleUrls']`]({value:t}){B(t)&&t.elements.filter(Mt).forEach(t=>{e.report({node:t,messageId:"relativeUrlPrefix"})})}})});function Mt(e){return!J(e)||!jt.test(e.value)}var _t=n({name:"sort-ngmodule-metadata-arrays",meta:{type:"suggestion",docs:{description:"Ensures 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:e=>({[`ClassDeclaration > Decorator[expression.callee.name="NgModule"] ${je(/^(bootstrap|declarations|entryComponents|exports|imports|providers|schemas)$/)} ArrayExpression`]({elements:r}){const n=r.filter(t.ASTUtils.isIdentifier).map((e,t,r)=>[e,r[t+1]]).find(([e,t])=>t&&1===e.name.localeCompare(t.name));if(!n)return;const[a,o]=n;e.report({node:a,messageId:"sortNgmoduleMetadataArrays",fix:e=>[e.replaceText(a,o.name),e.replaceText(o,a.name)]})}})}),Rt=n({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=>({[Oe](t){const r=me(t,"selector");r&&J(r)&&r.value.length||e.report({node:t,messageId:"useComponentSelector"})}})}),Bt=n({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{[`${Oe} ${je("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=Y(r,"@angular/core"))?n:[];return[H(t,r.parent.parent,e),Z(t,a,"ViewEncapsulation",e)].filter(he)}}]})}}}}),Kt=n({name:"use-injectable-provided-in",meta:{type:"suggestion",docs:{description:"Using the `providedIn` property makes `Injectables` tree-shakable",category:"Best Practices",recommended:!1,suggestion:!0},schema:[{type:"object",properties:{ignoreClassNamePattern:{type:"string"}},additionalProperties:!1}],messages:{useInjectableProvidedIn:"The `providedIn` property is mandatory for `Injectables`",suggestInjector:"Use `providedIn: '{{injector}}'`"}},defaultOptions:[{}],create(e,[{ignoreClassNamePattern:t}]){const r=`ClassDeclaration:not([id.name=${t}]):not(:has(TSClassImplements:matches([expression.property.name='HttpInterceptor'], [expression.name='HttpInterceptor']))) > Decorator[expression.callee.name="Injectable"]`,n=je("providedIn");return{[[`${r}:matches([expression.arguments.length=0], [expression.arguments.0.type='ObjectExpression']:not(:has(${n})))`,`${r} ${n}:matches([value.type='Identifier'][value.name='undefined'], [value.type='Literal'][value.raw='null'])`].join(",")](t){e.report({node:K(t)?t.value:t,messageId:"useInjectableProvidedIn",suggest:["any","platform","root"].map(e=>({messageId:"suggestInjector",fix:r=>{var n;return K(t)?r.replaceText(t.value,`'${e}'`):null!=(n=ee(t,r,`providedIn: '${e}'`))?n:[]},data:{injector:e}}))})}}}}),Lt=n({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=${ve([...pe])}]`]({key:t,parent:{parent:r}}){if(!re(r))return;const n=ie(r),a=t.name,o=(e=>e.slice(2))(a);n.includes(T[o])||e.report({node:t,messageId:"useLifecycleInterface",data:{interfaceName:o,methodName:a}})}})}),Ut=n({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?[G(t),`, ${r}`]:[e,` implements ${r}`];return{implementsNodeReplace:n,implementsTextReplace:a}}(t,"PipeTransform");return[Q({compatibleWithTypeOnlyImport:!0,fixer:e,importName:"PipeTransform",moduleName:"@angular/core",node:t}),e.insertTextAfter(r,n)].filter(he)}})}})}),Vt=n({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}])=>({[Ne](r){const n=me(r,"name");if(!n)return;if(!function(e){return Array.isArray(e)&&e.length>0}(t))return;const a=t.join("|"),o=Se.prefix(a,"camelCase");let s;J(n)?s=n.value:V(n)&&n.quasis[0]&&(s=n.quasis[0].value.raw),s&&(o.apply(this,[s])||e.report({node:n,messageId:"pipePrefix",data:{prefixes:xe(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":De,"component-class-suffix":Ue,"component-max-inline-declarations":Je,"component-selector":Ze,"contextual-lifecycle":et,"directive-class-suffix":tt,"directive-selector":rt,"no-attribute-decorator":nt,"no-conflicting-lifecycle":st,"no-forward-ref":it,"no-host-metadata-property":pt,"no-input-prefix":ut,"no-input-rename":gt,"no-inputs-metadata-property":yt,"no-lifecycle-call":ht,"no-output-native":xt,"no-output-on-prefix":vt,"no-output-rename":bt,"no-outputs-metadata-property":It,"no-pipe-impure":wt,"no-queries-metadata-property":Dt,"no-empty-lifecycle-method":Ct,[Pt]:At,"prefer-output-readonly":kt,"relative-url-prefix":$t,"sort-ngmodule-metadata-arrays":_t,"use-component-selector":Rt,"use-component-view-encapsulation":Bt,"use-injectable-provided-in":Kt,"use-lifecycle-interface":Lt,"use-pipe-transform-interface":Ut,"pipe-prefix":Vt}};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare type MessageIds = 'preferOnPushComponentChangeDetection';
|
|
1
|
+
export declare type MessageIds = 'preferOnPushComponentChangeDetection' | 'suggestAddChangeDetectionOnPush';
|
|
2
2
|
export declare const RULE_NAME = "prefer-on-push-component-change-detection";
|
|
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;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const RULE_NAME = "sort-ngmodule-metadata-arrays";
|
|
2
1
|
export declare type MessageIds = 'sortNgmoduleMetadataArrays';
|
|
2
|
+
export declare const RULE_NAME = "sort-ngmodule-metadata-arrays";
|
|
3
3
|
declare const _default: import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleModule<"sortNgmoduleMetadataArrays", [], import("@typescript-eslint/experimental-utils/dist/ts-eslint/Rule").RuleListener>;
|
|
4
4
|
export default _default;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
declare type Options = [{
|
|
2
|
+
readonly ignoreClassNamePattern?: string;
|
|
3
|
+
}];
|
|
4
|
+
export declare type MessageIds = 'useInjectableProvidedIn' | 'suggestInjector';
|
|
2
5
|
export declare const RULE_NAME = "use-injectable-provided-in";
|
|
3
|
-
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>;
|
|
4
7
|
export default _default;
|
|
@@ -7,7 +7,10 @@ export declare const MODULE_CLASS_DECORATOR = "ClassDeclaration > Decorator[expr
|
|
|
7
7
|
export declare const INPUT_DECORATOR = "Decorator[expression.callee.name=\"Input\"]";
|
|
8
8
|
export declare const OUTPUT_DECORATOR = "Decorator[expression.callee.name=\"Output\"]";
|
|
9
9
|
export declare const LITERAL_OR_TEMPLATE_ELEMENT = ":matches(Literal, TemplateElement)";
|
|
10
|
-
export declare function metadataProperty
|
|
10
|
+
export declare function metadataProperty(key: RegExp): string;
|
|
11
|
+
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}])`;
|
|
12
|
+
export declare function methodDefinition(key: RegExp): string;
|
|
13
|
+
export declare function methodDefinition<TKey extends string>(key: TKey): `MethodDefinition:matches([key.name=${TKey}][computed=false], [key.value=${TKey}], [key.quasis.0.value.raw=${TKey}])`;
|
|
11
14
|
export declare const COMPONENT_SELECTOR_LITERAL: string;
|
|
12
15
|
export declare const DIRECTIVE_SELECTOR_LITERAL: string;
|
|
13
16
|
export declare const COMPONENT_OR_DIRECTIVE_SELECTOR_LITERAL: string;
|
package/dist/utils/utils.d.ts
CHANGED
|
@@ -82,13 +82,17 @@ export declare const ANGULAR_CLASS_DECORATORS: ReadonlySet<AngularClassDecorator
|
|
|
82
82
|
export declare const ANGULAR_CLASS_DECORATOR_MAPPER: ReadonlyMap<AngularClassDecoratorKeys, ReadonlySet<AngularInnerClassDecoratorKeys>>;
|
|
83
83
|
export declare function isCallExpression(node: TSESTree.Node): node is TSESTree.CallExpression;
|
|
84
84
|
export declare function isMemberExpression(node: TSESTree.Node): node is TSESTree.MemberExpression;
|
|
85
|
+
export declare function isIdentifierOrMemberExpression(node: TSESTree.Node): node is TSESTree.Identifier | TSESTree.MemberExpression;
|
|
85
86
|
export declare function isClassDeclaration(node: TSESTree.Node): node is TSESTree.ClassDeclaration;
|
|
86
87
|
export declare function isClassProperty(node: TSESTree.Node): node is TSESTree.ClassProperty;
|
|
87
88
|
export declare function isClassPropertyOrMethodDefinition(node: TSESTree.Node): node is TSESTree.ClassProperty | TSESTree.MethodDefinition;
|
|
89
|
+
export declare function isImportDefaultSpecifier(node: TSESTree.Node): node is TSESTree.ImportDefaultSpecifier;
|
|
90
|
+
export declare function isImportNamespaceSpecifier(node: TSESTree.Node): node is TSESTree.ImportNamespaceSpecifier;
|
|
88
91
|
export declare function isObjectExpression(node: TSESTree.Node): node is TSESTree.ObjectExpression;
|
|
89
92
|
export declare function isArrayExpression(node: TSESTree.Node): node is TSESTree.ArrayExpression;
|
|
90
93
|
export declare function isProperty(node: TSESTree.Node): node is TSESTree.Property;
|
|
91
94
|
export declare function isLiteral(node: TSESTree.Node): node is TSESTree.Literal;
|
|
95
|
+
export declare function isTemplateElement(node: TSESTree.Node): node is TSESTree.TemplateElement;
|
|
92
96
|
export declare function isTemplateLiteral(node: TSESTree.Node): node is TSESTree.TemplateLiteral;
|
|
93
97
|
export declare function isImportDeclaration(node: TSESTree.Node): node is TSESTree.ImportDeclaration;
|
|
94
98
|
/**
|
|
@@ -99,26 +103,37 @@ export declare function isImportDeclaration(node: TSESTree.Node): node is TSESTr
|
|
|
99
103
|
export declare function isStringLiteral(node: TSESTree.Node): node is TSESTree.StringLiteral;
|
|
100
104
|
export declare function isMethodDefinition(node: TSESTree.Node): node is TSESTree.MethodDefinition;
|
|
101
105
|
export declare function isSuper(node: TSESTree.Node): node is TSESTree.Super;
|
|
106
|
+
export declare function isImplementsToken(token: TSESTree.Token): token is TSESTree.KeywordToken & {
|
|
107
|
+
value: 'implements';
|
|
108
|
+
};
|
|
102
109
|
export declare function getNearestNodeFrom<T extends TSESTree.Node>({ parent }: TSESTree.Node, predicate: (parent: TSESTree.Node) => parent is T): T | null;
|
|
103
110
|
export declare function getImportDeclarations(node: TSESTree.Node, moduleName: string): readonly TSESTree.ImportDeclaration[] | undefined;
|
|
104
111
|
export declare function getImplementsRemoveFix(sourceCode: Readonly<TSESLint.SourceCode>, classDeclaration: TSESTree.ClassDeclaration, interfaceName: string, fixer: TSESLint.RuleFixer): TSESLint.RuleFix | undefined;
|
|
105
112
|
export declare function getNodeToCommaRemoveFix(sourceCode: Readonly<TSESLint.SourceCode>, node: TSESTree.Node, fixer: TSESLint.RuleFixer): TSESLint.RuleFix;
|
|
106
113
|
export declare function getLast<T extends readonly unknown[]>(items: T): T[number];
|
|
107
|
-
export declare function getImportAddFix(
|
|
108
|
-
|
|
109
|
-
|
|
114
|
+
export declare function getImportAddFix({ compatibleWithTypeOnlyImport, fixer, importName, moduleName, node, }: {
|
|
115
|
+
compatibleWithTypeOnlyImport?: boolean;
|
|
116
|
+
fixer: TSESLint.RuleFixer;
|
|
117
|
+
importName: string;
|
|
118
|
+
moduleName: string;
|
|
119
|
+
node: TSESTree.Node;
|
|
120
|
+
}): TSESLint.RuleFix | undefined;
|
|
121
|
+
export declare function getImportRemoveFix(sourceCode: Readonly<TSESLint.SourceCode>, importDeclarations: readonly TSESTree.ImportDeclaration[], importName: string, fixer: TSESLint.RuleFixer): TSESLint.RuleFix | undefined;
|
|
122
|
+
export declare function getImplementsSchemaFixer({ id, implements: classImplements }: TSESTree.ClassDeclaration, interfaceName: string): {
|
|
110
123
|
readonly implementsNodeReplace: TSESTree.TSClassImplements | TSESTree.Identifier;
|
|
111
124
|
readonly implementsTextReplace: string;
|
|
112
125
|
};
|
|
126
|
+
export declare function getDecoratorPropertyAddFix({ expression }: TSESTree.Decorator, fixer: TSESLint.RuleFixer, text: string): TSESLint.RuleFix | undefined;
|
|
113
127
|
export declare const getClassName: (node: TSESTree.Node) => string | undefined;
|
|
114
|
-
export declare const getDecorator: (node: TSESTree.ClassDeclaration, decoratorName: string) => TSESTree.Decorator | undefined;
|
|
128
|
+
export declare const getDecorator: (node: TSESTree.ClassDeclaration | TSESTree.ClassProperty | TSESTree.Identifier | TSESTree.MethodDefinition, decoratorName: string) => TSESTree.Decorator | undefined;
|
|
115
129
|
export declare const getAngularClassDecorator: ({ decorators, }: TSESTree.ClassDeclaration) => AngularClassDecoratorKeys | undefined;
|
|
116
130
|
export declare const getDecoratorArgument: ({ expression, }: TSESTree.Decorator) => TSESTree.ObjectExpression | undefined;
|
|
117
131
|
export declare const getDecoratorName: ({ expression, }: TSESTree.Decorator) => string | undefined;
|
|
118
132
|
export declare const getPipeDecorator: (node: TSESTree.ClassDeclaration) => TSESTree.Decorator | undefined;
|
|
119
|
-
export declare
|
|
120
|
-
export declare
|
|
121
|
-
export declare
|
|
133
|
+
export declare function getInterfaces(node: TSESTree.ClassDeclaration): readonly (TSESTree.Identifier | TSESTree.MemberExpression)[];
|
|
134
|
+
export declare function getInterface(node: TSESTree.ClassDeclaration, interfaceName: string): TSESTree.Identifier | TSESTree.MemberExpression | undefined;
|
|
135
|
+
export declare function getDeclaredInterfaceNames(node: TSESTree.ClassDeclaration): readonly string[];
|
|
136
|
+
export declare function getInterfaceName(interfaceMember: TSESTree.Identifier | TSESTree.MemberExpression): string | undefined;
|
|
122
137
|
export declare const getDeclaredAngularLifecycleInterfaces: (node: TSESTree.ClassDeclaration) => readonly AngularLifecycleInterfaceKeys[];
|
|
123
138
|
export declare const getDeclaredAngularLifecycleMethods: (node: TSESTree.ClassDeclaration) => readonly AngularLifecycleMethodKeys[];
|
|
124
139
|
export declare const ANGULAR_LIFECYCLE_INTERFACES: ReadonlySet<AngularLifecycleInterfaceKeys>;
|
|
@@ -138,11 +153,11 @@ export declare const isAngularInnerClassDecorator: (value: string) => value is A
|
|
|
138
153
|
* ['c'] // Literal
|
|
139
154
|
* }
|
|
140
155
|
*/
|
|
141
|
-
export declare function getClassPropertyName({ key }: TSESTree.ClassProperty): string;
|
|
156
|
+
export declare function getClassPropertyName({ computed, key, }: TSESTree.ClassProperty): string;
|
|
142
157
|
export declare const getDecoratorProperty: (decorator: TSESTree.Decorator, name: string) => TSESTree.Property | undefined;
|
|
143
158
|
export declare const getDecoratorPropertyValue: (decorator: TSESTree.Decorator, name: string) => TSESTree.Property['value'] | undefined;
|
|
144
159
|
export declare const getDeclaredMethods: ({ body: { body }, }: TSESTree.ClassDeclaration) => readonly TSESTree.MethodDefinition[];
|
|
145
|
-
export declare const getMethodName: (
|
|
160
|
+
export declare const getMethodName: ({ computed, key, }: TSESTree.MethodDefinition) => string | undefined;
|
|
146
161
|
export declare const getLifecycleInterfaceByMethodName: (methodName: AngularLifecycleMethodKeys) => AngularLifecycleInterfaceKeys;
|
|
147
162
|
/**
|
|
148
163
|
* Enforces the invariant that the input is an array.
|
|
@@ -163,7 +178,7 @@ export declare function isImportedFrom(identifier: TSESTree.Identifier, moduleNa
|
|
|
163
178
|
*/
|
|
164
179
|
export declare const toHumanReadableText: (items: readonly string[]) => string;
|
|
165
180
|
export declare const toPattern: (value: readonly unknown[]) => RegExp;
|
|
166
|
-
export declare function getRawText(node: TSESTree.
|
|
181
|
+
export declare function getRawText(node: TSESTree.Node): string;
|
|
167
182
|
export declare function getReplacementText(node: TSESTree.Literal | TSESTree.TemplateElement | TSESTree.TemplateLiteral, text: string): string;
|
|
168
183
|
export declare function capitalize<T extends string>(text: T): Capitalize<T>;
|
|
169
184
|
export declare function withoutBracketsAndWhitespaces(text: string): string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular-eslint/eslint-plugin",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.4.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.4.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": "b38d82894ed39358a48c4689dd79749ad9216dc1"
|
|
31
31
|
}
|