Socket
Socket
Sign inDemoInstall

eslint-plugin-angular

Package Overview
Dependencies
0
Maintainers
1
Versions
74
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.6.4 to 2.0.0

2

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

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

@@ -16,3 +16,3 @@ /**

var utils = require('./utils/utils');
const utils = require('./utils/utils');

@@ -28,6 +28,6 @@ module.exports = {

create: function(context) {
var angularObjectList = ['controller', 'filter', 'directive'];
var badServices;
var map;
var message = 'REST API calls should be implemented in a specific service';
let angularObjectList = ['controller', 'filter', 'directive'];
let badServices = [];
let map;
let message = 'REST API calls should be implemented in a specific service';

@@ -43,3 +43,3 @@ function isArray(item) {

if (context.options[0] === undefined) {
badServices = ['$http', '$resource', 'Restangular', '$q', '$filter'];
badServices = ['/\$http/', '/\$resource/', 'Restangular', '/\$q/', '/\$filter/'];
}

@@ -57,5 +57,6 @@

map = context.options[0];
var result = [];
var prop;
let result = [];
let prop;
for (prop in map) {

@@ -72,5 +73,5 @@ if (map.hasOwnProperty(prop)) {

if (map) {
return map[angularObjectName].indexOf(serviceName) >= 0;
return map[angularObjectName].find(object => utils.convertPrefixToRegex(object).test(serviceName));
}
return badServices.indexOf(serviceName) >= 0;
return badServices.find(object => utils.convertPrefixToRegex(object).test(serviceName));
}

@@ -81,3 +82,3 @@

CallExpression: function(node) {
var callee = node.callee;
let callee = node.callee;

@@ -84,0 +85,0 @@ if (utils.isAngularComponent(node) && callee.type === 'MemberExpression' && angularObjectList.indexOf(callee.property.name) >= 0) {

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc