
This patch adds eslint, a permissively licensed (as opposed to jshint or jslint) javascript style linter. It also enables the use of 'npm run lint', which may be used in OpenStack's gate to cause build failures when improperly formed javascript is committed. Existing javascript was updated to pass linting rules. Note that most of these changes were formatting and file length concerns. The noted stylistic change that we should probably discuss is the use of singlequote vs. doublequote. Single is the pep8 standard used in python, and thus enforcing that seems to make the most sense. Change-Id: I52768fe6e7ee1f76f0d67f44273fdc48b159489a
58 lines
1.2 KiB
Plaintext
58 lines
1.2 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
|
|
},
|
|
|
|
"globals": {
|
|
"require": false,
|
|
"exports": false,
|
|
"angular": false, // AngularJS
|
|
"module": false,
|
|
"inject": false,
|
|
"element": false,
|
|
"by": false,
|
|
"browser": false
|
|
},
|
|
|
|
"rules": {
|
|
"quotes": [2, "single"],
|
|
"eol-last": 2,
|
|
"no-trailing-spaces": 2,
|
|
"camelcase": 0,
|
|
"no-extra-boolean-cast": 0,
|
|
|
|
// Stylistic
|
|
"indent": [2, 4],
|
|
"max-len": [2, 80],
|
|
"no-undefined": 2
|
|
}
|
|
} |