Code Monkey home page Code Monkey logo

angularjs-eslint's Introduction

Build Status

This repository will give access to new rules for the ESLint tool. You should use it only if you are developping an AngularJS application.

Rules

ng_angularelement

The angular.element method should be used of the $ or jQuery object (if you are using jQuery of course). If the jQuery library is imported, angular.element will be a wrapper around the jQuery object.

ng_controller_name

All your controllers should have a name starting the parameter you can define in your config object

{ "rules": { "ng_controller_name": [2, "ng"] } }

ng_defineundefined

You should use the angular.isUndefined or angular.isDefined methods instead of using the keyword undefined (myVar === undefined)

ng_directive_name

All your directives should have a name starting the parameter you can define in your config object

{ "rules": { "ng_directive_name": [2, "ng"] } }

ng_filter_name

All your filters should have a name starting the parameter you can define in your config object

{ "rules": { "ng_filter_name": [2, "ng"] } }

ng_on_watch

Watch and On methods on the scope object should be assigned to a variable, in order to be deleted in a $destroy event handler

ng_service_name

All your services should have a name starting the parameter you can define in your config object

{ "rules": { "ng_service_name": [2, "ng"] } }

ng_typecheck_array

You should use the angular.isArray method instead of the default JavaScript implementation (typeof [] === "[object Array]").

ng_typecheck_boolean

You should use the angular.isBoolean method instead of the default JavaScript implementation (typeof true === "[object Boolean]").

ng_typecheck_date

You should use the angular.isDate method instead of the default JavaScript implementation (typeof new Date() === "[object Date]").

ng_typecheck_function

You should use the angular.isFunction method instead of the default JavaScript implementation (typeof function(){} ==="[object Function]").

ng_typecheck_number

You should use the angular.isNumber method instead of the default JavaScript implementation (typeof 3 === "[object Number]").

ng_typecheck_object

You should use the angular.isObject method instead of the default JavaScript implementation (typeof {} === "[object Object]").

ng_typecheck_string

You should use the angular.isString method instead of the default JavaScript implementation (typeof "" === "[object String]").

angularjs-eslint's People

Contributors

emmanueldemey avatar muratcorlu avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.