refstack/.eslintrc
Paul Van Eck d23adad7f6 Update eslint and update angular style to match
With an updated eslint version and the addition of eslint-config-openstack
and eslint-plugin-angular, there are several more stylistic guidelines to
follow. However, this is what other OpenStack angular projects follow such
as Horizon. Some notable changes are:

* Wrapped javascript content in anonymous functions. This is a safeguard to
  keep the code from conflicting with other variables with the same name in
  other scripts on the same page.

* Explicitly inject dependencies and have controllers, factories, etc as
  explicitly declared functions.

* Use angular "controller as" syntax instead of assigning variables to $scope.

* Added eslint rule that requires JSDoc for every function declaration.

Note these are mainly stylistic changes and all the functionality of RefStack
should remain the same.

Change-Id: I044b1f473d589681a2ae9d2704700dd85687cbb6
2015-09-30 13:47:20 -07:00

70 lines
1.4 KiB
Plaintext

{
// For a detailed list of all options, please see here:
// http://eslint.org/docs/configuring/
"ecmaFeatures": {
"arrowFunctions": false,
"binaryLiterals": false,
"blockBindings": false,
"defaultParams": false,
"forOf": false,
"generators": false,
"objectLiteralComputedProperties": false,
"objectLiteralDuplicateProperties": false,
"objectLiteralShorthandProperties": false,
"octalLiterals": false,
"regexUFlag": false,
"superInFunctions": false,
"templateStrings": false,
"unicodeCodePointEscapes": false,
"globalReturn": false,
"jsx": false
},
"env": {
"browser": true,
"node": false,
"amd": false,
"mocha": false,
"jasmine": true,
"phantomjs": false,
"jquery": false,
"prototypejs": false,
"shelljs": false
},
"extends": "openstack",
"globals": {
"require": false,
"exports": false,
"angular": false, // AngularJS
"module": false,
"inject": false,
"element": false,
"by": false,
"browser": false
},
"plugins": [
"angular"
],
"rules": {
"quotes": [2, "single"],
"eol-last": 2,
"no-trailing-spaces": 2,
"camelcase": 0,
"no-extra-boolean-cast": 0,
"operator-linebreak": 0,
"require-jsdoc": 2,
// Stylistic
"indent": [2, 4, {SwitchCase: 1}],
"max-len": [2, 80],
"no-undefined": 2,
// Angular Plugin
"angular/controller-as-vm": [1, "ctrl"]
}
}