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

eslint-plugin-angular

Package Overview
Dependencies
Maintainers
1
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-angular - npm Package Compare versions

Comparing version 1.4.1 to 1.5.0

2

package.json
{
"name": "eslint-plugin-angular",
"version": "1.4.1",
"version": "1.5.0",
"description": "ESLint rules for AngularJS projects",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -9,2 +9,3 @@ /**

* @category angularWrapper
* @sinceAngularVersion 1.x
*/

@@ -11,0 +12,0 @@ 'use strict';

@@ -14,2 +14,3 @@ /**

* @category bestPractice
* @sinceAngularVersion 1.x
*/

@@ -16,0 +17,0 @@ 'use strict';

@@ -10,2 +10,3 @@ /**

* @category naming
* @sinceAngularVersion 1.x
*/

@@ -12,0 +13,0 @@ 'use strict';

@@ -9,2 +9,3 @@ /**

* @category bestPractice
* @sinceAngularVersion 1.x
*/

@@ -11,0 +12,0 @@ 'use strict';

@@ -15,2 +15,3 @@ /**

* @category bestPractice
* @sinceAngularVersion 1.x
*/

@@ -17,0 +18,0 @@ 'use strict';

@@ -11,2 +11,3 @@ /**

* @category bestPractice
* @sinceAngularVersion 1.x
*/

@@ -13,0 +14,0 @@ 'use strict';

@@ -12,2 +12,3 @@ /**

* @category naming
* @sinceAngularVersion 1.x
*/

@@ -14,0 +15,0 @@ 'use strict';

@@ -8,2 +8,3 @@ /**

* @category bestPractice
* @sinceAngularVersion 1.x
*/

@@ -10,0 +11,0 @@ 'use strict';

@@ -9,2 +9,3 @@ /**

* @category angularWrapper
* @sinceAngularVersion 1.x
*/

@@ -11,0 +12,0 @@ 'use strict';

@@ -10,2 +10,3 @@ /**

* @category conventions
* @sinceAngularVersion 1.x
*/

@@ -12,0 +13,0 @@ 'use strict';

@@ -8,2 +8,3 @@ /**

* @category bestPractice
* @sinceAngularVersion 1.x
*/

@@ -10,0 +11,0 @@ 'use strict';

@@ -8,2 +8,3 @@ /**

* @category conventions
* @sinceAngularVersion 1.x
*/

@@ -20,2 +21,5 @@ 'use strict';

var extra = context.options[1] || {};
var matchNames = extra.matchNames !== false;
function report(node) {

@@ -32,3 +36,3 @@ context.report(node, 'You should use the {{syntax}} syntax for DI', {

((utils.isLiteralType(node.left.property) && node.left.property.value === '$inject') ||
(utils.isIdentifierType(node.left.property) && node.left.property.name === '$inject'))) {
(utils.isIdentifierType(node.left.property) && node.left.property.name === '$inject'))) {
$injectProperties[node.left.object.name] = node.right;

@@ -49,8 +53,11 @@ }

}
var invalidArray = fn.params.filter(function(e, i) {
return e.name !== fn.parent.elements[i].value;
});
if (invalidArray.length > 0) {
context.report(fn, 'You have an error in your DI configuration. Each items of the array should match exactly one function parameter', {});
return;
if (matchNames) {
var invalidArray = fn.params.filter(function(e, i) {
return e.name !== fn.parent.elements[i].value;
});
if (invalidArray.length > 0) {
context.report(fn, 'You have an error in your DI configuration. Each items of the array should match exactly one function parameter', {});
return;
}
}

@@ -80,8 +87,11 @@ } else {

}
var invalidInjectArray = fn.params.filter(function(e, i) {
return e.name !== $injectArray.elements[i].value;
});
if (invalidInjectArray.length > 0) {
context.report(fn, 'You have an error in your DI configuration. Each items of the array should match exactly one function parameter', {});
return;
if (matchNames) {
var invalidInjectArray = fn.params.filter(function(e, i) {
return e.name !== $injectArray.elements[i].value;
});
if (invalidInjectArray.length > 0) {
context.report(fn, 'You have an error in your DI configuration. Each items of the array should match exactly one function parameter', {});
return;
}
}

@@ -123,2 +133,9 @@ } else {

]
}, {
type: 'object',
properties: {
matchNames: {
type: 'boolean'
}
}
}];

@@ -12,2 +12,3 @@ /**

* @category naming
* @sinceAngularVersion 1.x
*/

@@ -14,0 +15,0 @@ 'use strict';

@@ -12,2 +12,3 @@ /**

* @category bestPractice
* @sinceAngularVersion 1.x
*/

@@ -14,0 +15,0 @@ 'use strict';

@@ -9,2 +9,3 @@ /**

* @category angularWrapper
* @sinceAngularVersion 1.x
*/

@@ -11,0 +12,0 @@ 'use strict';

@@ -9,2 +9,3 @@ /**

* @category conventions
* @sinceAngularVersion 1.x
*/

@@ -11,0 +12,0 @@ 'use strict';

@@ -9,2 +9,3 @@ /**

* @category bestPractice
* @sinceAngularVersion 1.x
*/

@@ -11,0 +12,0 @@ 'use strict';

@@ -18,2 +18,3 @@ /**

* @category naming
* @sinceAngularVersion 1.x
*/

@@ -20,0 +21,0 @@ 'use strict';

@@ -10,2 +10,3 @@ /**

* @category naming
* @sinceAngularVersion 1.x
*/

@@ -12,0 +13,0 @@ 'use strict';

@@ -8,2 +8,3 @@ /**

* @category angularWrapper
* @sinceAngularVersion 1.x
*/

@@ -10,0 +11,0 @@ 'use strict';

@@ -12,2 +12,3 @@ /**

* @category conventions
* @sinceAngularVersion 1.x
*/

@@ -14,0 +15,0 @@ 'use strict';

@@ -9,2 +9,3 @@ /**

* @category angularWrapper
* @sinceAngularVersion 1.x
*/

@@ -11,0 +12,0 @@ 'use strict';

@@ -9,2 +9,3 @@ /**

* @category angularWrapper
* @sinceAngularVersion 1.x
*/

@@ -11,0 +12,0 @@ 'use strict';

@@ -7,2 +7,3 @@ /**

* @category angularWrapper
* @sinceAngularVersion 1.x
*/

@@ -9,0 +10,0 @@ 'use strict';

@@ -14,2 +14,3 @@ /**

* @category conventions
* @sinceAngularVersion 1.x
*/

@@ -16,0 +17,0 @@ 'use strict';

@@ -10,2 +10,3 @@ /**

* @category possibleError
* @sinceAngularVersion 1.x
*/

@@ -12,0 +13,0 @@ 'use strict';

@@ -11,2 +11,3 @@ /**

* @category naming
* @sinceAngularVersion 1.x
*/

@@ -13,0 +14,0 @@ 'use strict';

@@ -10,2 +10,3 @@ /**

* @category possibleError
* @sinceAngularVersion 1.x
*/

@@ -12,0 +13,0 @@ 'use strict';

@@ -28,2 +28,4 @@ /**

* for more information on this topic.
*
* @sinceAngularVersion 1.x
*/

@@ -30,0 +32,0 @@ 'use strict';

@@ -8,2 +8,3 @@ /**

* @category bestPractice
* @sinceAngularVersion 1.x
*/

@@ -10,0 +11,0 @@ 'use strict';

@@ -9,2 +9,3 @@ /**

* @category deprecatedAngularFeature
* @sinceAngularVersion 1.x
*/

@@ -11,0 +12,0 @@ 'use strict';

@@ -11,2 +11,3 @@ /**

* @category deprecatedAngularFeature
* @sinceAngularVersion 1.x
*/

@@ -13,0 +14,0 @@ 'use strict';

@@ -9,2 +9,3 @@ /**

* @category deprecatedAngularFeature
* @sinceAngularVersion 1.x
*/

@@ -11,0 +12,0 @@ 'use strict';

@@ -10,2 +10,3 @@ /**

* @category bestPractice
* @sinceAngularVersion 1.x
*/

@@ -12,0 +13,0 @@ 'use strict';

@@ -7,2 +7,3 @@ /**

* @category angularWrapper
* @sinceAngularVersion 1.x
*/

@@ -9,0 +10,0 @@ 'use strict';

@@ -10,2 +10,3 @@ /**

* @category possibleError
* @sinceAngularVersion 1.x
*/

@@ -12,0 +13,0 @@ 'use strict';

@@ -9,2 +9,3 @@ /**

* @category bestPractice
* @sinceAngularVersion 1.x
*/

@@ -11,0 +12,0 @@ 'use strict';

@@ -9,2 +9,3 @@ /**

* @category conventions
* @sinceAngularVersion 1.x
*/

@@ -11,0 +12,0 @@ 'use strict';

@@ -12,2 +12,3 @@ /**

* @category bestPractice
* @sinceAngularVersion 1.x
*/

@@ -14,0 +15,0 @@ 'use strict';

@@ -7,2 +7,3 @@ /**

* @category misspelling
* @sinceAngularVersion 1.x
*/

@@ -9,0 +10,0 @@ 'use strict';

@@ -7,2 +7,3 @@ /**

* @category bestPractice
* @sinceAngularVersion 1.x
*/

@@ -9,0 +10,0 @@ 'use strict';

@@ -8,2 +8,3 @@ /**

* @category conventions
* @sinceAngularVersion 1.x
*/

@@ -10,0 +11,0 @@ 'use strict';

@@ -9,2 +9,3 @@ /**

* @category conventions
* @sinceAngularVersion 1.x
*/

@@ -11,0 +12,0 @@ 'use strict';

@@ -11,2 +11,3 @@ /**

* @category naming
* @sinceAngularVersion 1.x
*/

@@ -13,0 +14,0 @@ 'use strict';

@@ -9,2 +9,3 @@ /**

* @category angularWrapper
* @sinceAngularVersion 1.x
*/

@@ -11,0 +12,0 @@ 'use strict';

@@ -8,2 +8,3 @@ /**

* @category angularWrapper
* @sinceAngularVersion 1.x
*/

@@ -10,0 +11,0 @@ 'use strict';

@@ -8,2 +8,3 @@ /**

* @category angularWrapper
* @sinceAngularVersion 1.x
*/

@@ -10,0 +11,0 @@ 'use strict';

@@ -8,2 +8,3 @@ /**

* @category angularWrapper
* @sinceAngularVersion 1.x
*/

@@ -10,0 +11,0 @@ 'use strict';

@@ -8,2 +8,3 @@ /**

* @category angularWrapper
* @sinceAngularVersion 1.x
*/

@@ -10,0 +11,0 @@ 'use strict';

@@ -8,2 +8,3 @@ /**

* @category angularWrapper
* @sinceAngularVersion 1.x
*/

@@ -10,0 +11,0 @@ 'use strict';

@@ -8,2 +8,3 @@ /**

* @category angularWrapper
* @sinceAngularVersion 1.x
*/

@@ -10,0 +11,0 @@ 'use strict';

@@ -89,3 +89,3 @@ 'use strict';

if (prefix[0] === '/' && prefix[prefix.length - 1] === '/') {
prefix = prefix.substring(1, prefix.length - 2);
prefix = prefix.substring(1, prefix.length - 1);
}

@@ -267,3 +267,6 @@

function isAngularComponentDeclaration(node) {
return isAngularComponent(node) &&
return node.arguments !== undefined &&
node.arguments.length === 2 &&
isLiteralType(node.arguments[0]) &&
node.arguments[1].type === 'ObjectExpression' &&
isMemberExpression(node.callee) &&

@@ -270,0 +273,0 @@ node.callee.property.name === 'component';

@@ -9,2 +9,3 @@ /**

* @category conventions
* @sinceAngularVersion 1.x
*/

@@ -11,0 +12,0 @@ 'use strict';

@@ -9,2 +9,3 @@ /**

* @category angularWrapper
* @sinceAngularVersion 1.x
*/

@@ -11,0 +12,0 @@ 'use strict';

@@ -183,2 +183,3 @@ 'use strict';

rule.deprecated = !!mainRuleComment.deprecated;
rule.sinceAngularVersion = mainRuleComment.sinceAngularVersion;

@@ -185,0 +186,0 @@ if (rule.deprecated) {

@@ -11,2 +11,6 @@ <!-- WARNING: Generated documentation. Edit docs and examples in the rule and examples file ('<%= sourcePath %>', '<%= examplesPath %>'). -->

<% if(sinceAngularVersion) { %>
**Rule based on Angular <%= sinceAngularVersion %>**
<% } %>
<% if(styleguideReferences.length > 0) { %>

@@ -13,0 +17,0 @@ **Styleguide Reference**

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