Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

codelyzer

Package Overview
Dependencies
Maintainers
1
Versions
77
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

codelyzer - npm Package Compare versions

Comparing version 4.2.1 to 4.3.0

enforceComponentSelectorRule.d.ts

1

angular/templates/jitReflector.d.ts

@@ -13,2 +13,3 @@ import { CompileReflector, ExternalReference } from '@angular/compiler';

annotations(typeOrFunc: any): any[];
shallowAnnotations(typeOrFunc: any): any[];
propMetadata(typeOrFunc: any): {

@@ -15,0 +16,0 @@ [key: string]: any[];

@@ -33,2 +33,5 @@ "use strict";

};
JitReflector.prototype.shallowAnnotations = function (typeOrFunc) {
throw new Error('Not supported in JIT mode');
};
JitReflector.prototype.propMetadata = function (typeOrFunc) {

@@ -35,0 +38,0 @@ return this.reflectionCapabilities.propMetadata(typeOrFunc);

@@ -53,2 +53,5 @@ "use strict";

this.isInjectable = true;
this.isComponent = false;
this.isDirective = false;
this.isPipe = false;
};

@@ -58,2 +61,5 @@ ClassMetadataWalker.prototype.visitNgComponent = function (metadata) {

this.isComponent = true;
this.isInjectable = false;
this.isDirective = false;
this.isPipe = false;
};

@@ -63,2 +69,5 @@ ClassMetadataWalker.prototype.visitNgDirective = function (metadata) {

this.isDirective = true;
this.isInjectable = false;
this.isComponent = false;
this.isPipe = false;
};

@@ -68,2 +77,5 @@ ClassMetadataWalker.prototype.visitNgPipe = function (controller, decorator) {

this.isPipe = true;
this.isInjectable = false;
this.isComponent = false;
this.isDirective = false;
};

@@ -70,0 +82,0 @@ ClassMetadataWalker.prototype.visitMethodDeclaration = function (method) {

7

i18nRule.js

@@ -72,9 +72,8 @@ "use strict";

I18NTextVisitor.prototype.visitElement = function (element, context) {
if (element.name !== 'ng-container') {
this.hasI18n = element.attrs.some(function (e) { return e.name === 'i18n'; });
}
var originalI18n = this.hasI18n;
this.hasI18n = originalI18n || element.attrs.some(function (e) { return e.name === 'i18n'; });
this.nestedElements.push(element.name);
_super.prototype.visitElement.call(this, element, context);
this.nestedElements.pop();
this.hasI18n = false;
this.hasI18n = originalI18n;
};

@@ -81,0 +80,0 @@ I18NTextVisitor.prototype.getOption = function () {

@@ -9,12 +9,14 @@ export { Rule as AngularWhitespaceRule } from './angularWhitespaceRule';

export { Rule as DirectiveSelectorRule } from './directiveSelectorRule';
export { Rule as EnforceComponentSelectorRule } from './enforceComponentSelectorRule';
export { Rule as I18nRule } from './i18nRule';
export { Rule as TemplateCyclomaticComplexityRule } from './templateCyclomaticComplexityRule';
export { Rule as TemplateConditionalComplexityRule } from './templateConditionalComplexityRule';
export { Rule as ImportDestructuringSpacingRule } from './importDestructuringSpacingRule';
export { Rule as MaxInlineDeclarationsRule } from './maxInlineDeclarationsRule';
export { Rule as NoAttributeParameterDecoratorRule } from './noAttributeParameterDecoratorRule';
export { Rule as NoConflictingLifeCycleHooksRule } from './noConflictingLifeCycleHooksRule';
export { Rule as NoForwardRefRule } from './noForwardRefRule';
export { Rule as NoInputPrefixRule } from './noInputPrefixRule';
export { Rule as NoInputRenameRule } from './noInputRenameRule';
export { Rule as NoLifeCycleCallRule } from './noLifeCycleCallRule';
export { Rule as NoOutputNamedAfterStandardEventRule } from './noOutputNamedAfterStandardEventRule';
export { Rule as NoOutputOnPrefixRule } from './noOutputOnPrefixRule';
export { Rule as NoInputPrefixRule } from './noInputPrefixRule';
export { Rule as NoOutputRenameRule } from './noOutputRenameRule';

@@ -24,2 +26,7 @@ export { Rule as NoUnusedCssRule } from './noUnusedCssRule';

export { Rule as PipeNamingRule } from './pipeNamingRule';
export { Rule as PreferOutputReadonlyRule } from './preferOutputReadonlyRule';
export { Rule as TemplateConditionalComplexityRule } from './templateConditionalComplexityRule';
export { Rule as TemplateCyclomaticComplexityRule } from './templateCyclomaticComplexityRule';
export { Rule as TemplatesNoNegatedAsync } from './templatesNoNegatedAsyncRule';
export { Rule as TrackByFunctionRule } from './trackByFunctionRule';
export { Rule as UseHostPropertyDecoratorRule } from './useHostPropertyDecoratorRule';

@@ -29,8 +36,6 @@ export { Rule as UseInputPropertyDecoratorRule } from './useInputPropertyDecoratorRule';

export { Rule as UseOutputPropertyDecoratorRule } from './useOutputPropertyDecoratorRule';
export { Rule as UsePipeDecoratorRule } from './usePipeDecoratorRule';
export { Rule as UsePipeTransformInterfaceRule } from './usePipeTransformInterfaceRule';
export { Rule as UsePipeDecoratorRule } from './usePipeDecoratorRule';
export { Rule as UseViewEncapsulationRule } from './useViewEncapsulationRule';
export { Rule as TemplatesNoNegatedAsync } from './templatesNoNegatedAsyncRule';
export { Rule as TrackByFunctionRule } from './trackByFunctionRule';
export * from './angular/config';
export declare const rulesDirectory = ".";

@@ -22,16 +22,22 @@ "use strict";

exports.DirectiveSelectorRule = directiveSelectorRule_1.Rule;
var enforceComponentSelectorRule_1 = require("./enforceComponentSelectorRule");
exports.EnforceComponentSelectorRule = enforceComponentSelectorRule_1.Rule;
var i18nRule_1 = require("./i18nRule");
exports.I18nRule = i18nRule_1.Rule;
var templateCyclomaticComplexityRule_1 = require("./templateCyclomaticComplexityRule");
exports.TemplateCyclomaticComplexityRule = templateCyclomaticComplexityRule_1.Rule;
var templateConditionalComplexityRule_1 = require("./templateConditionalComplexityRule");
exports.TemplateConditionalComplexityRule = templateConditionalComplexityRule_1.Rule;
var importDestructuringSpacingRule_1 = require("./importDestructuringSpacingRule");
exports.ImportDestructuringSpacingRule = importDestructuringSpacingRule_1.Rule;
var maxInlineDeclarationsRule_1 = require("./maxInlineDeclarationsRule");
exports.MaxInlineDeclarationsRule = maxInlineDeclarationsRule_1.Rule;
var noAttributeParameterDecoratorRule_1 = require("./noAttributeParameterDecoratorRule");
exports.NoAttributeParameterDecoratorRule = noAttributeParameterDecoratorRule_1.Rule;
var noConflictingLifeCycleHooksRule_1 = require("./noConflictingLifeCycleHooksRule");
exports.NoConflictingLifeCycleHooksRule = noConflictingLifeCycleHooksRule_1.Rule;
var noForwardRefRule_1 = require("./noForwardRefRule");
exports.NoForwardRefRule = noForwardRefRule_1.Rule;
var noInputPrefixRule_1 = require("./noInputPrefixRule");
exports.NoInputPrefixRule = noInputPrefixRule_1.Rule;
var noInputRenameRule_1 = require("./noInputRenameRule");
exports.NoInputRenameRule = noInputRenameRule_1.Rule;
var noLifeCycleCallRule_1 = require("./noLifeCycleCallRule");
exports.NoLifeCycleCallRule = noLifeCycleCallRule_1.Rule;
var noOutputNamedAfterStandardEventRule_1 = require("./noOutputNamedAfterStandardEventRule");

@@ -41,4 +47,2 @@ exports.NoOutputNamedAfterStandardEventRule = noOutputNamedAfterStandardEventRule_1.Rule;

exports.NoOutputOnPrefixRule = noOutputOnPrefixRule_1.Rule;
var noInputPrefixRule_1 = require("./noInputPrefixRule");
exports.NoInputPrefixRule = noInputPrefixRule_1.Rule;
var noOutputRenameRule_1 = require("./noOutputRenameRule");

@@ -52,2 +56,12 @@ exports.NoOutputRenameRule = noOutputRenameRule_1.Rule;

exports.PipeNamingRule = pipeNamingRule_1.Rule;
var preferOutputReadonlyRule_1 = require("./preferOutputReadonlyRule");
exports.PreferOutputReadonlyRule = preferOutputReadonlyRule_1.Rule;
var templateConditionalComplexityRule_1 = require("./templateConditionalComplexityRule");
exports.TemplateConditionalComplexityRule = templateConditionalComplexityRule_1.Rule;
var templateCyclomaticComplexityRule_1 = require("./templateCyclomaticComplexityRule");
exports.TemplateCyclomaticComplexityRule = templateCyclomaticComplexityRule_1.Rule;
var templatesNoNegatedAsyncRule_1 = require("./templatesNoNegatedAsyncRule");
exports.TemplatesNoNegatedAsync = templatesNoNegatedAsyncRule_1.Rule;
var trackByFunctionRule_1 = require("./trackByFunctionRule");
exports.TrackByFunctionRule = trackByFunctionRule_1.Rule;
var useHostPropertyDecoratorRule_1 = require("./useHostPropertyDecoratorRule");

@@ -61,13 +75,9 @@ exports.UseHostPropertyDecoratorRule = useHostPropertyDecoratorRule_1.Rule;

exports.UseOutputPropertyDecoratorRule = useOutputPropertyDecoratorRule_1.Rule;
var usePipeDecoratorRule_1 = require("./usePipeDecoratorRule");
exports.UsePipeDecoratorRule = usePipeDecoratorRule_1.Rule;
var usePipeTransformInterfaceRule_1 = require("./usePipeTransformInterfaceRule");
exports.UsePipeTransformInterfaceRule = usePipeTransformInterfaceRule_1.Rule;
var usePipeDecoratorRule_1 = require("./usePipeDecoratorRule");
exports.UsePipeDecoratorRule = usePipeDecoratorRule_1.Rule;
var useViewEncapsulationRule_1 = require("./useViewEncapsulationRule");
exports.UseViewEncapsulationRule = useViewEncapsulationRule_1.Rule;
var templatesNoNegatedAsyncRule_1 = require("./templatesNoNegatedAsyncRule");
exports.TemplatesNoNegatedAsync = templatesNoNegatedAsyncRule_1.Rule;
var trackByFunctionRule_1 = require("./trackByFunctionRule");
exports.TrackByFunctionRule = trackByFunctionRule_1.Rule;
__export(require("./angular/config"));
exports.rulesDirectory = '.';
import * as Lint from 'tslint';
import * as ts from 'typescript';
import { DirectiveMetadata } from './angular/metadata';
import { NgWalker } from './angular/ngWalker';

@@ -10,3 +11,5 @@ export declare class Rule extends Lint.Rules.AbstractRule {

export declare class InputMetadataWalker extends NgWalker {
private directiveSelector;
visitNgDirective(metadata: DirectiveMetadata): void;
visitNgInput(property: ts.PropertyDeclaration, input: ts.Decorator, args: string[]): void;
}

@@ -34,5 +34,3 @@ "use strict";

};
Rule.FAILURE_STRING = 'In the class "%s", the directive ' +
'input property "%s" should not be renamed.' +
'Please, consider the following use "@Input() %s: string"';
Rule.FAILURE_STRING = 'In the class "%s", the directive input property "%s" should not be renamed.';
return Rule;

@@ -46,10 +44,15 @@ }(Lint.Rules.AbstractRule));

}
InputMetadataWalker.prototype.visitNgDirective = function (metadata) {
this.directiveSelector =
(metadata.selector || '').replace(/[\[\]\s]/g, '').split(',');
};
InputMetadataWalker.prototype.visitNgInput = function (property, input, args) {
var className = property.parent.name.text;
var memberName = property.name.text;
if (args.length !== 0 && memberName !== args[0]) {
var failureConfig = [className, memberName, memberName];
failureConfig.unshift(Rule.FAILURE_STRING);
this.addFailure(this.createFailure(property.getStart(), property.getWidth(), sprintf_js_1.sprintf.apply(this, failureConfig)));
if (args.length === 0 ||
(this.directiveSelector && this.directiveSelector.indexOf(memberName) !== -1)) {
return;
}
var failureConfig = [Rule.FAILURE_STRING, className, memberName];
this.addFailureAtNode(property, sprintf_js_1.sprintf.apply(this, failureConfig));
};

@@ -56,0 +59,0 @@ return InputMetadataWalker;

@@ -34,3 +34,3 @@ "use strict";

Rule.FAILURE_STRING = 'In the class "%s", the output ' +
'property "%s" should not be named after a standard event.';
'property "%s" should not be named or renamed after a standard event.';
return Rule;

@@ -221,3 +221,4 @@ }(Lint.Rules.AbstractRule));

var memberName = property.name.text;
if (memberName && this.standardEventNames.get(memberName)) {
var outputName = args.length === 0 ? memberName : args[0];
if (outputName && this.standardEventNames.get(outputName)) {
var failureConfig = [Rule.FAILURE_STRING, className, memberName];

@@ -224,0 +225,0 @@ var errorMessage = sprintf_js_1.sprintf.apply(null, failureConfig);

{
"name": "codelyzer",
"version": "4.2.1",
"version": "4.3.0",
"description": "Linting for Angular applications, following angular.io/styleguide.",

@@ -37,5 +37,2 @@ "main": "index.js",

"@angular/core": ">=2.3.1 <7.0.0 || >6.0.0-beta <7.0.0",
"@angular/platform-browser-dynamic": ">=2.3.1 <7.0.0 || >6.0.0-beta <7.0.0",
"@angular/platform-browser": ">=2.3.1 <7.0.0 || >6.0.0-beta <7.0.0",
"@angular/common": ">=2.3.1 <7.0.0 || >6.0.0-beta <7.0.0",
"tslint": "^5.0.0"

@@ -48,5 +45,5 @@ },

"semver-dsl": "^1.0.1",
"source-map": "^0.5.6",
"source-map": "^0.5.7",
"sprintf-js": "^1.0.3"
}
}

@@ -73,3 +73,3 @@ [![npm version](https://badge.fury.io/js/codelyzer.svg)](https://badge.fury.io/js/codelyzer)

TSLint will now complain that there are rules which requlre type checking. In order to fix this, use thw `-p` config option:
TSLint will now complain that there are rules which require type checking. In order to fix this, use thw `-p` config option:

@@ -85,3 +85,3 @@ ```bash

```shell
npm i codelyzer@~4.0.0 tslint@^5.0.0 typescript@2.4.0 @angular/core@~5.0.1 @angular/compiler@~5.0.1 rxjs@5.5.0 zone.js@~0.8.4
npm i codelyzer@~4.2.0 tslint@^5.0.0 @angular/core@~5.2.0 @angular/compiler@~5.2.0
```

@@ -102,2 +102,6 @@

"component-selector": [true, "element", "sg", "kebab-case"],
"max-inline-declarations": true,
"prefer-output-readonly": true,
"no-conflicting-life-cycle-hooks": true,
"enforce-component-selector": true,
"use-input-property-decorator": true,

@@ -121,3 +125,5 @@ "use-output-property-decorator": true,

"pipe-impure": true,
"i18n": [true, "check-id", "check-text"]
"i18n": [true, "check-id", "check-text"],
"template-cyclomatic-complexity": [true, 5],
"template-conditional-complexity": [true, 4]
}

@@ -156,2 +162,6 @@ }

"component-selector": [true, "element", "sg", "kebab-case"],
"max-inline-declarations": true,
"prefer-output-readonly": true,
"no-conflicting-life-cycle-hooks": true,
"enforce-component-selector": true,
"use-input-property-decorator": true,

@@ -175,3 +185,5 @@ "use-output-property-decorator": true,

"pipe-impure": true,
"i18n": [true, "check-id", "check-text"]
"i18n": [true, "check-id", "check-text"],
"template-cyclomatic-complexity": [true, 5],
"template-conditional-complexity": [true, 4]
}

@@ -262,2 +274,6 @@ }

"no-output-named-after-standard-event": true,
"max-inline-declarations": true,
"prefer-output-readonly": true,
"no-conflicting-life-cycle-hooks": true,
"enforce-component-selector": true,

@@ -282,2 +298,3 @@ // [ENABLED, "SUFFIX"]

| `no-forward-ref` | Stable |
| `no-input-prefix` | Stable |
| `no-input-rename` | Stable |

@@ -300,5 +317,11 @@ | `no-output-on-prefix` | Stable |

| `no-output-named-after-standard-event` | Stable |
| `max-inline-declarations` | Stable |
| `prefer-output-readonly` | Stable |
| `no-conflicting-life-cycle-hooks` | Stable |
| `enforce-component-selector` | Stable |
| `i18n` | *Experimental* |
| `no-unused-css` | *Experimental* |
| `angular-whitespace` | *Experimental* |
| `template-cyclomatic-complexity` | *Experimental* |
| `template-conditional-complexity` | *Experimental* |
| `pipe-naming` | *Deprecated* |

@@ -377,28 +400,32 @@

[<img alt="mgechev" src="https://avatars1.githubusercontent.com/u/455023?v=4&s=117" width="117">](https://github.com/mgechev) |[<img alt="preslavsh" src="https://avatars2.githubusercontent.com/u/6237138?v=4&s=117" width="117">](https://github.com/preslavsh) |[<img alt="wKoza" src="https://avatars2.githubusercontent.com/u/11403260?v=4&s=117" width="117">](https://github.com/wKoza) |[<img alt="rokerkony" src="https://avatars3.githubusercontent.com/u/156132?v=4&s=117" width="117">](https://github.com/rokerkony) |[<img alt="GregOnNet" src="https://avatars3.githubusercontent.com/u/444278?v=4&s=117" width="117">](https://github.com/GregOnNet) |[<img alt="eppsilon" src="https://avatars1.githubusercontent.com/u/5643?v=4&s=117" width="117">](https://github.com/eppsilon) |
[<img alt="mgechev" src="https://avatars1.githubusercontent.com/u/455023?v=4&s=117" width="117">](https://github.com/mgechev) |[<img alt="wKoza" src="https://avatars2.githubusercontent.com/u/11403260?v=4&s=117" width="117">](https://github.com/wKoza) |[<img alt="preslavsh" src="https://avatars2.githubusercontent.com/u/6237138?v=4&s=117" width="117">](https://github.com/preslavsh) |[<img alt="rokerkony" src="https://avatars3.githubusercontent.com/u/156132?v=4&s=117" width="117">](https://github.com/rokerkony) |[<img alt="GregOnNet" src="https://avatars3.githubusercontent.com/u/444278?v=4&s=117" width="117">](https://github.com/GregOnNet) |[<img alt="alan-agius4" src="https://avatars3.githubusercontent.com/u/17563226?v=4&s=117" width="117">](https://github.com/alan-agius4) |
:---: |:---: |:---: |:---: |:---: |:---: |
[mgechev](https://github.com/mgechev) |[preslavsh](https://github.com/preslavsh) |[wKoza](https://github.com/wKoza) |[rokerkony](https://github.com/rokerkony) |[GregOnNet](https://github.com/GregOnNet) |[eppsilon](https://github.com/eppsilon) |
[mgechev](https://github.com/mgechev) |[wKoza](https://github.com/wKoza) |[preslavsh](https://github.com/preslavsh) |[rokerkony](https://github.com/rokerkony) |[GregOnNet](https://github.com/GregOnNet) |[alan-agius4](https://github.com/alan-agius4) |
[<img alt="csvn" src="https://avatars2.githubusercontent.com/u/8770194?v=4&s=117" width="117">](https://github.com/csvn) |[<img alt="ghsyeung" src="https://avatars0.githubusercontent.com/u/1243185?v=4&s=117" width="117">](https://github.com/ghsyeung) |[<img alt="Kobzol" src="https://avatars0.githubusercontent.com/u/4539057?v=4&s=117" width="117">](https://github.com/Kobzol) |[<img alt="lazarljubenovic" src="https://avatars3.githubusercontent.com/u/7661457?v=4&s=117" width="117">](https://github.com/lazarljubenovic) |[<img alt="clydin" src="https://avatars2.githubusercontent.com/u/19598772?v=4&s=117" width="117">](https://github.com/clydin) |[<img alt="connor4312" src="https://avatars0.githubusercontent.com/u/2230985?v=4&s=117" width="117">](https://github.com/connor4312) |
[<img alt="csvn" src="https://avatars2.githubusercontent.com/u/8770194?v=4&s=117" width="117">](https://github.com/csvn) |[<img alt="eppsilon" src="https://avatars1.githubusercontent.com/u/5643?v=4&s=117" width="117">](https://github.com/eppsilon) |[<img alt="rafaelss95" src="https://avatars0.githubusercontent.com/u/11965907?v=4&s=117" width="117">](https://github.com/rafaelss95) |[<img alt="ghsyeung" src="https://avatars0.githubusercontent.com/u/1243185?v=4&s=117" width="117">](https://github.com/ghsyeung) |[<img alt="Kobzol" src="https://avatars0.githubusercontent.com/u/4539057?v=4&s=117" width="117">](https://github.com/Kobzol) |[<img alt="lazarljubenovic" src="https://avatars3.githubusercontent.com/u/7661457?v=4&s=117" width="117">](https://github.com/lazarljubenovic) |
:---: |:---: |:---: |:---: |:---: |:---: |
[csvn](https://github.com/csvn) |[ghsyeung](https://github.com/ghsyeung) |[Kobzol](https://github.com/Kobzol) |[lazarljubenovic](https://github.com/lazarljubenovic) |[clydin](https://github.com/clydin) |[connor4312](https://github.com/connor4312) |
[csvn](https://github.com/csvn) |[eppsilon](https://github.com/eppsilon) |[rafaelss95](https://github.com/rafaelss95) |[ghsyeung](https://github.com/ghsyeung) |[Kobzol](https://github.com/Kobzol) |[lazarljubenovic](https://github.com/lazarljubenovic) |
[<img alt="Foxandxss" src="https://avatars2.githubusercontent.com/u/1087957?v=4&s=117" width="117">](https://github.com/Foxandxss) |[<img alt="Hotell" src="https://avatars0.githubusercontent.com/u/1223799?v=4&s=117" width="117">](https://github.com/Hotell) |[<img alt="comfroels" src="https://avatars2.githubusercontent.com/u/4616177?v=4&s=117" width="117">](https://github.com/comfroels) |[<img alt="plantain-00" src="https://avatars0.githubusercontent.com/u/7639395?v=4&s=117" width="117">](https://github.com/plantain-00) |[<img alt="nexus-uw" src="https://avatars2.githubusercontent.com/u/3188890?v=4&s=117" width="117">](https://github.com/nexus-uw) |[<img alt="sagittarius-rev" src="https://avatars0.githubusercontent.com/u/23564517?v=4&s=117" width="117">](https://github.com/sagittarius-rev) |
[<img alt="sagittarius-rev" src="https://avatars0.githubusercontent.com/u/23564517?v=4&s=117" width="117">](https://github.com/sagittarius-rev) |[<img alt="connor4312" src="https://avatars0.githubusercontent.com/u/2230985?v=4&s=117" width="117">](https://github.com/connor4312) |[<img alt="Foxandxss" src="https://avatars2.githubusercontent.com/u/1087957?v=4&s=117" width="117">](https://github.com/Foxandxss) |[<img alt="gbilodeau" src="https://avatars2.githubusercontent.com/u/532543?v=4&s=117" width="117">](https://github.com/gbilodeau) |[<img alt="NagRock" src="https://avatars2.githubusercontent.com/u/5803314?v=4&s=117" width="117">](https://github.com/NagRock) |[<img alt="Hotell" src="https://avatars0.githubusercontent.com/u/1223799?v=4&s=117" width="117">](https://github.com/Hotell) |
:---: |:---: |:---: |:---: |:---: |:---: |
[Foxandxss](https://github.com/Foxandxss) |[Hotell](https://github.com/Hotell) |[comfroels](https://github.com/comfroels) |[plantain-00](https://github.com/plantain-00) |[nexus-uw](https://github.com/nexus-uw) |[sagittarius-rev](https://github.com/sagittarius-rev) |
[sagittarius-rev](https://github.com/sagittarius-rev) |[connor4312](https://github.com/connor4312) |[Foxandxss](https://github.com/Foxandxss) |[gbilodeau](https://github.com/gbilodeau) |[NagRock](https://github.com/NagRock) |[Hotell](https://github.com/Hotell) |
[<img alt="leosvelperez" src="https://avatars3.githubusercontent.com/u/12051310?v=4&s=117" width="117">](https://github.com/leosvelperez) |[<img alt="alan-agius4" src="https://avatars3.githubusercontent.com/u/17563226?v=4&s=117" width="117">](https://github.com/alan-agius4) |[<img alt="Gillespie59" src="https://avatars2.githubusercontent.com/u/555768?v=4&s=117" width="117">](https://github.com/Gillespie59) |[<img alt="eromano" src="https://avatars1.githubusercontent.com/u/1030050?v=4&s=117" width="117">](https://github.com/eromano) |[<img alt="gbilodeau" src="https://avatars2.githubusercontent.com/u/532543?v=4&s=117" width="117">](https://github.com/gbilodeau) |[<img alt="Manduro" src="https://avatars0.githubusercontent.com/u/2545042?v=4&s=117" width="117">](https://github.com/Manduro) |
[<img alt="Martin-Wegner" src="https://avatars1.githubusercontent.com/u/8995517?v=4&s=117" width="117">](https://github.com/Martin-Wegner) |[<img alt="comfroels" src="https://avatars2.githubusercontent.com/u/4616177?v=4&s=117" width="117">](https://github.com/comfroels) |[<img alt="plantain-00" src="https://avatars0.githubusercontent.com/u/7639395?v=4&s=117" width="117">](https://github.com/plantain-00) |[<img alt="nexus-uw" src="https://avatars2.githubusercontent.com/u/3188890?v=4&s=117" width="117">](https://github.com/nexus-uw) |[<img alt="muhammadghazali" src="https://avatars3.githubusercontent.com/u/863947?v=4&s=117" width="117">](https://github.com/muhammadghazali) |[<img alt="alisd23" src="https://avatars2.githubusercontent.com/u/5804010?v=4&s=117" width="117">](https://github.com/alisd23) |
:---: |:---: |:---: |:---: |:---: |:---: |
[leosvelperez](https://github.com/leosvelperez) |[alan-agius4](https://github.com/alan-agius4) |[Gillespie59](https://github.com/Gillespie59) |[eromano](https://github.com/eromano) |[gbilodeau](https://github.com/gbilodeau) |[Manduro](https://github.com/Manduro) |
[Martin-Wegner](https://github.com/Martin-Wegner) |[comfroels](https://github.com/comfroels) |[plantain-00](https://github.com/plantain-00) |[nexus-uw](https://github.com/nexus-uw) |[muhammadghazali](https://github.com/muhammadghazali) |[alisd23](https://github.com/alisd23) |
[<img alt="karol-depka" src="https://avatars1.githubusercontent.com/u/958486?v=4&s=117" width="117">](https://github.com/karol-depka) |[<img alt="kevinphelps" src="https://avatars1.githubusercontent.com/u/7399499?v=4&s=117" width="117">](https://github.com/kevinphelps) |[<img alt="alisd23" src="https://avatars2.githubusercontent.com/u/5804010?v=4&s=117" width="117">](https://github.com/alisd23) |[<img alt="Martin-Wegner" src="https://avatars1.githubusercontent.com/u/8995517?v=4&s=117" width="117">](https://github.com/Martin-Wegner) |[<img alt="rtfpessoa" src="https://avatars0.githubusercontent.com/u/902384?v=4&s=117" width="117">](https://github.com/rtfpessoa) |[<img alt="scttcper" src="https://avatars3.githubusercontent.com/u/1400464?v=4&s=117" width="117">](https://github.com/scttcper) |
[<img alt="eromano" src="https://avatars1.githubusercontent.com/u/1030050?v=4&s=117" width="117">](https://github.com/eromano) |[<img alt="Manduro" src="https://avatars0.githubusercontent.com/u/2545042?v=4&s=117" width="117">](https://github.com/Manduro) |[<img alt="karol-depka" src="https://avatars1.githubusercontent.com/u/958486?v=4&s=117" width="117">](https://github.com/karol-depka) |[<img alt="kevinphelps" src="https://avatars1.githubusercontent.com/u/7399499?v=4&s=117" width="117">](https://github.com/kevinphelps) |[<img alt="leosvelperez" src="https://avatars3.githubusercontent.com/u/12051310?v=4&s=117" width="117">](https://github.com/leosvelperez) |[<img alt="Gillespie59" src="https://avatars2.githubusercontent.com/u/555768?v=4&s=117" width="117">](https://github.com/Gillespie59) |
:---: |:---: |:---: |:---: |:---: |:---: |
[karol-depka](https://github.com/karol-depka) |[kevinphelps](https://github.com/kevinphelps) |[alisd23](https://github.com/alisd23) |[Martin-Wegner](https://github.com/Martin-Wegner) |[rtfpessoa](https://github.com/rtfpessoa) |[scttcper](https://github.com/scttcper) |
[eromano](https://github.com/eromano) |[Manduro](https://github.com/Manduro) |[karol-depka](https://github.com/karol-depka) |[kevinphelps](https://github.com/kevinphelps) |[leosvelperez](https://github.com/leosvelperez) |[Gillespie59](https://github.com/Gillespie59) |
[<img alt="lacolaco" src="https://avatars3.githubusercontent.com/u/1529180?v=4&s=117" width="117">](https://github.com/lacolaco) |[<img alt="tmair" src="https://avatars2.githubusercontent.com/u/1596276?v=4&s=117" width="117">](https://github.com/tmair) |[<img alt="cexbrayat" src="https://avatars3.githubusercontent.com/u/411874?v=4&s=117" width="117">](https://github.com/cexbrayat) |[<img alt="reduckted" src="https://avatars0.githubusercontent.com/u/10321525?v=4&s=117" width="117">](https://github.com/reduckted) |
:---: |:---: |:---: |:---: |
[lacolaco](https://github.com/lacolaco) |[tmair](https://github.com/tmair) |[cexbrayat](https://github.com/cexbrayat) |[reduckted](https://github.com/reduckted) |
[<img alt="rwlogel" src="https://avatars2.githubusercontent.com/u/3373178?v=4&s=117" width="117">](https://github.com/rwlogel) |[<img alt="rtfpessoa" src="https://avatars0.githubusercontent.com/u/902384?v=4&s=117" width="117">](https://github.com/rtfpessoa) |[<img alt="scttcper" src="https://avatars3.githubusercontent.com/u/1400464?v=4&s=117" width="117">](https://github.com/scttcper) |[<img alt="lacolaco" src="https://avatars3.githubusercontent.com/u/1529180?v=4&s=117" width="117">](https://github.com/lacolaco) |[<img alt="tmair" src="https://avatars2.githubusercontent.com/u/1596276?v=4&s=117" width="117">](https://github.com/tmair) |[<img alt="cexbrayat" src="https://avatars3.githubusercontent.com/u/411874?v=4&s=117" width="117">](https://github.com/cexbrayat) |
:---: |:---: |:---: |:---: |:---: |:---: |
[rwlogel](https://github.com/rwlogel) |[rtfpessoa](https://github.com/rtfpessoa) |[scttcper](https://github.com/scttcper) |[lacolaco](https://github.com/lacolaco) |[tmair](https://github.com/tmair) |[cexbrayat](https://github.com/cexbrayat) |
[<img alt="reduckted" src="https://avatars0.githubusercontent.com/u/10321525?v=4&s=117" width="117">](https://github.com/reduckted) |
:---: |
[reduckted](https://github.com/reduckted) |
## License
MIT

@@ -50,3 +50,3 @@ "use strict";

};
Rule.COMPLEXITY_FAILURE_STRING = 'The condition complexity (cost \'%s\') exceeded the defined limit (cost \'%s\'). The conditional expression should be move in the component\'s template.';
Rule.COMPLEXITY_FAILURE_STRING = 'The condition complexity (cost \'%s\') exceeded the defined limit (cost \'%s\'). The conditional expression should be moved into the component.';
Rule.COMPLEXITY_MAX = 3;

@@ -91,3 +91,3 @@ return Rule;

var span = prop.sourceSpan;
var failureConfig = [String(complexity), String(Rule.COMPLEXITY_MAX)];
var failureConfig = [String(complexity), String(complexityMax)];
failureConfig.unshift(Rule.COMPLEXITY_FAILURE_STRING);

@@ -94,0 +94,0 @@ this.addFailure(this.createFailure(span.start.offset, span.end.offset - span.start.offset, sprintf_js_1.sprintf.apply(this, failureConfig)));

@@ -72,3 +72,3 @@ "use strict";

var span = prop.sourceSpan;
var failureConfig = [String(Rule.COMPLEXITY_MAX)];
var failureConfig = [String(complexityMax)];
failureConfig.unshift(Rule.COMPLEXITY_FAILURE_STRING);

@@ -75,0 +75,0 @@ this.addFailure(this.createFailure(span.start.offset, span.end.offset - span.start.offset, sprintf_js_1.sprintf.apply(this, failureConfig)));

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc