eslint-plugin-angular
Advanced tools
Comparing version 2.2.1 to 2.3.0
58
index.js
@@ -20,3 +20,59 @@ 'use strict'; | ||
rules: rules, | ||
environments: require('./environments') | ||
environments: require('./environments'), | ||
configs: { | ||
johnpapa: { | ||
plugins: [ | ||
'angular' | ||
], | ||
rules: { | ||
'angular/component-name': 2, | ||
'angular/constant-name': 2, | ||
'angular/controller-as-route': 2, | ||
'angular/controller-as-vm': 2, | ||
'angular/controller-as': 2, | ||
'angular/controller-name': 2, | ||
'angular/directive-name': 2, | ||
'angular/directive-restrict': 2, | ||
'angular/document-service': 2, | ||
'angular/factory-name': 2, | ||
'angular/file-name': 2, | ||
'angular/filter-name': 2, | ||
'angular/function-type': 2, | ||
'angular/interval-service': 2, | ||
'angular/module-getter': 2, | ||
'angular/module-name': 2, | ||
'angular/module-setter': 2, | ||
'angular/no-run-logic': 2, | ||
'angular/no-service-method': 2, | ||
'angular/provider-name': 2, | ||
'angular/service-name': 2, | ||
'angular/timeout-service': 2, | ||
'angular/value-name': 2, | ||
'angular/window-service': 2 | ||
} | ||
}, | ||
bestpractices: { | ||
plugins: [ | ||
'angular' | ||
], | ||
rules: { | ||
'angular/component-name': 2, | ||
'angular/constant-name': 2, | ||
'angular/controller-as-route': 2, | ||
'angular/controller-as-vm': 2, | ||
'angular/controller-as': 2, | ||
'angular/deferred': 2, | ||
'angular/di-unused': 2, | ||
'angular/directive-restrict': 2, | ||
'angular/empty-controller': 2, | ||
'angular/no-controller': 2, | ||
'angular/no-inline-template': 2, | ||
'angular/no-run-logic': 2, | ||
'angular/no-service-method': 2, | ||
'angular/no-services': 2, | ||
'angular/on-watch': 2, | ||
'angular/prefer-component': 2 | ||
} | ||
} | ||
} | ||
}; |
{ | ||
"name": "eslint-plugin-angular", | ||
"version": "2.2.1", | ||
"version": "2.3.0", | ||
"description": "ESLint rules for AngularJS projects", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -34,4 +34,2 @@ # eslint plugin angular [![Npm version](https://img.shields.io/npm/v/eslint-plugin-angular.svg)](https://www.npmjs.com/package/eslint-plugin-angular) [![Npm downloads per month](https://img.shields.io/npm/dm/eslint-plugin-angular.svg)](https://www.npmjs.com/package/eslint-plugin-angular) | ||
Users may use the shareable [eslint-config-angular](https://github.com/dustinspecker/eslint-config-angular) to quickly setup eslint-plugin-angular. It also marks Angular as a global variable and defines required ESLint rules to use this plugin. | ||
1. Install `eslint` as a dev-dependency: | ||
@@ -49,12 +47,6 @@ | ||
3. Install `eslint-config-angular` as a dev-dependency: | ||
3. Use the shareable config by adding it to your `.eslintrc`: | ||
```shell | ||
npm install --save-dev eslint-config-angular | ||
``` | ||
4. Use the shareable config by adding it to your `.eslintrc`: | ||
```yaml | ||
extends: angular | ||
extends: plugin:angular/johnpapa | ||
``` | ||
@@ -105,2 +97,3 @@ | ||
* [avoid-scope-typos](docs/avoid-scope-typos.md) - Avoid mistakes when naming methods defined on the scope object | ||
* [module-getter](docs/module-getter.md) - disallow to reference modules with variables and require to use the getter syntax instead `angular.module('myModule')` ([y022](https://github.com/johnpapa/angular-styleguide/blob/master/a1/README.md#style-y022)) | ||
@@ -107,0 +100,0 @@ * [module-setter](docs/module-setter.md) - disallow to assign modules to variables (linked to [module-getter](docs/module-getter.md) ([y021](https://github.com/johnpapa/angular-styleguide/blob/master/a1/README.md#style-y021)) |
@@ -202,3 +202,3 @@ 'use strict'; | ||
} | ||
if (node.type === 'FunctionExpression' || node.type === 'FunctionDeclaration') { | ||
if (node.type === 'FunctionExpression' || node.type === 'ArrowFunctionExpression' || node.type === 'FunctionDeclaration') { | ||
return node; | ||
@@ -205,0 +205,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
282569
77
4594
312