Use eslint-config-openstack as a base

This commit modifies fuel-ui .eslintrc to use
eslint-config-openstack as a base with overrides of some rules.
No code was changed, but some FIXMEs were added to be changed
in future.

Also, ESLint and React plugin were updated.

Change-Id: I4ba51878705e89fd86369420c50590f5623206e5
This commit is contained in:
Vitaly Kramskikh 2016-01-14 20:14:08 +03:00
parent 369bd85b81
commit 51eec66c9d
3 changed files with 337 additions and 234 deletions

136
.eslintrc
View File

@ -1,5 +1,6 @@
---
root: true
extends: openstack
plugins:
- react
ecmaFeatures:
@ -16,126 +17,59 @@
spread: true
superInFunctions: true
rules:
# possible errors
comma-dangle: 2
no-cond-assign: 2
no-console: 2
no-constant-condition: 2
no-debugger: 2
no-dupe-args: 2
no-dupe-keys: 2
no-duplicate-case: 2
no-empty-character-class: 2
no-ex-assign: 2
no-extra-boolean-cast: 2
no-extra-parens: 0
no-extra-semi: 2
no-func-assign: 2
no-inner-declarations: 2
no-invalid-regexp: 2
no-irregular-whitespace: 2
no-negated-in-lhs: 2
no-obj-calls: 2
no-regex-spaces: 2
no-sparse-arrays: 2
no-unexpected-multiline: 2
no-unreachable: 2
use-isnan: 2
valid-typeof: 2
# disabled rules from openstack config
no-empty: 0 # we use empty blocks with try-catch
no-extra-parens: 0 # extra parens are preferred with JSX
valid-jsdoc: 0 # eslint treats multiline comments as JSDoc
consistent-return: 0 # we have lots of code where consistent return isn't needed
curly: 0 # we're ok with one-line if
operator-linebreak: 0 # disabled due to heavy use of ternary operator in JSX
no-warning-comments: 0 # we're ok with FIXMEs
no-undefined: 0 # we're ok with using undefined
no-process-env: 0 # we use it in a few places and are ok with it
no-sync: 0 # it affects our browser code with Sync in function names, like "onModelSync"
# best practices
block-scoped-var: 2
# overriden rules from openstack config
brace-style: [2, 1tbs, {allowSingleLine: true}] # overriden to set allowSingleLine to true
# to be fixed and enabled
complexity: 0
consistent-return: 0
dot-location: [2, property]
dot-notation: 2
no-alert: 2
no-caller: 2
no-else-return: 0
no-empty-label: 2
no-empty-pattern: 2
no-eq-null: 2
no-eval: 2
no-implied-eval: 2
no-extend-native: 2
no-extra-bind: 2
no-fallthrough: 2
no-floating-decimal: 2
no-lone-blocks: 2
no-loop-func: 2
no-multi-spaces: 2
no-native-reassign: 2
no-new-wrappers: 2
no-new-func: 2
no-new: 2
no-octal-escape: 2
no-octal: 2
no-param-reassign: 0
no-proto: 2
no-redeclare: 2
no-return-assign: 2
eqeqeq: 0
no-script-url: 0
no-self-compare: 2
no-sequences: 2
no-throw-literal: 2
no-unused-expressions: 2
no-useless-call: 2
no-with: 2
radix: 0
no-mixed-requires: 0
indent: [0, 2, {SwitchCase: 1}]
one-var: [0, {uninitialized: always, initialized: never}]
max-len: [0, 120]
# extra rules
no-unexpected-multiline: 2
dot-location: [2, property]
no-empty-pattern: 2
no-useless-call: 2
yoda: 2
# strict mode
strict: 2
# variables
no-delete-var: 2
no-shadow-restricted-names: 2
no-undef-init: 2
no-undef: 2
no-unused-vars: 2
no-use-before-define: 2
# stylistic issues
array-bracket-spacing: [2, never]
brace-style: [2, 1tbs, {allowSingleLine: true}]
camelcase: [2, {properties: never}]
comma-style: [2, last]
comma-spacing: [2, {before: false, after: true}]
computed-property-spacing: [2, never]
eol-last: 2
id-length: [0, {min: 2, exceptions: ['$', '_', 'e']}]
array-bracket-spacing: 2
comma-spacing: 2
computed-property-spacing: 2
id-match: [2, '^([A-Za-z\d_$]+)$', {properties: true}]
jsx-quotes: [2, prefer-single]
key-spacing: [2, {beforeColon: false, afterColon: true}]
linebreak-style: [2, unix]
max-nested-callbacks: [0, 5]
key-spacing: 2
new-cap: [2, {newIsCap: true, capIsNew: false}]
no-array-constructor: 2
no-new-object: 2
no-lonely-if: 2
no-multiple-empty-lines: [2, {max: 1}]
no-new-object: 2
no-spaced-func: 2
no-unneeded-ternary: 2
object-curly-spacing: 2
operator-linebreak: [0, after, {overrides: {':': null}}]
padded-blocks: [2, never]
quote-props: [2, as-needed]
quotes: [2, single, avoid-escape]
semi-spacing: [2, {before: false, after: true}]
semi: [2, always]
space-after-keywords: [2, always]
space-before-blocks: [2, always]
space-before-function-paren: [2, never]
space-before-keywords: [2, always]
space-in-parens: [2, never]
space-infix-ops: 2
space-return-throw-case: 2
space-unary-ops: [2, {words: true, nonwords: false}]
spaced-comment: [0, always]
space-before-keywords: 2
# es6
arrow-parens: [2, always]
arrow-spacing: [2, {before: true, after: true}]
arrow-parens: 2
arrow-spacing: 2
constructor-super: 2
#no-arrow-condition: 2
no-class-assign: 2

430
npm-shrinkwrap.json generated
View File

@ -1201,8 +1201,8 @@
"from": "es5-shim@4.1.11"
},
"eslint": {
"version": "1.7.3",
"from": "eslint@1.7.3",
"version": "1.10.3",
"from": "eslint@1.10.3",
"dependencies": {
"chalk": {
"version": "1.1.1",
@ -1251,11 +1251,11 @@
"from": "typedarray@~0.0.5"
},
"readable-stream": {
"version": "2.0.4",
"version": "2.0.5",
"from": "readable-stream@~2.0.0",
"dependencies": {
"core-util-is": {
"version": "1.0.1",
"version": "1.0.2",
"from": "core-util-is@~1.0.0"
},
"isarray": {
@ -1263,8 +1263,8 @@
"from": "isarray@0.0.1"
},
"process-nextick-args": {
"version": "1.0.3",
"from": "process-nextick-args@~1.0.0"
"version": "1.0.6",
"from": "process-nextick-args@~1.0.6"
},
"string_decoder": {
"version": "0.10.31",
@ -1289,8 +1289,8 @@
}
},
"doctrine": {
"version": "0.7.0",
"from": "doctrine@^0.7.0",
"version": "0.7.2",
"from": "doctrine@^0.7.1",
"dependencies": {
"esutils": {
"version": "1.1.6",
@ -1303,23 +1303,23 @@
}
},
"escape-string-regexp": {
"version": "1.0.3",
"version": "1.0.4",
"from": "escape-string-regexp@^1.0.2"
},
"escope": {
"version": "3.2.0",
"from": "escope@^3.2.0",
"version": "3.3.0",
"from": "escope@^3.3.0",
"dependencies": {
"es6-map": {
"version": "0.1.2",
"from": "es6-map@^0.1.1",
"version": "0.1.3",
"from": "es6-map@^0.1.2",
"dependencies": {
"d": {
"version": "0.1.1",
"from": "d@~0.1.1"
},
"es5-ext": {
"version": "0.10.8",
"version": "0.10.11",
"from": "es5-ext@~0.10.8"
},
"es6-iterator": {
@ -1327,12 +1327,12 @@
"from": "es6-iterator@2"
},
"es6-set": {
"version": "0.1.2",
"from": "es6-set@~0.1.2"
"version": "0.1.3",
"from": "es6-set@~0.1.3"
},
"es6-symbol": {
"version": "3.0.1",
"from": "es6-symbol@3"
"version": "3.0.2",
"from": "es6-symbol@~3.0.1"
},
"event-emitter": {
"version": "0.3.4",
@ -1341,44 +1341,36 @@
}
},
"es6-weak-map": {
"version": "0.1.4",
"from": "es6-weak-map@^0.1.2",
"version": "2.0.1",
"from": "es6-weak-map@^2.0.1",
"dependencies": {
"d": {
"version": "0.1.1",
"from": "d@~0.1.1"
},
"es5-ext": {
"version": "0.10.8",
"from": "es5-ext@~0.10.6",
"dependencies": {
"es6-iterator": {
"version": "2.0.0",
"from": "es6-iterator@2"
},
"es6-symbol": {
"version": "3.0.1",
"from": "es6-symbol@3"
}
}
"version": "0.10.11",
"from": "es5-ext@~0.10.8"
},
"es6-iterator": {
"version": "0.1.3",
"from": "es6-iterator@~0.1.3"
"version": "2.0.0",
"from": "es6-iterator@2"
},
"es6-symbol": {
"version": "2.0.1",
"from": "es6-symbol@~2.0.1"
"version": "3.0.2",
"from": "es6-symbol@~3.0.1"
}
}
},
"esrecurse": {
"version": "3.1.1",
"from": "esrecurse@^3.1.1"
},
"estraverse": {
"version": "3.1.0",
"from": "estraverse@^3.1.0"
"from": "esrecurse@^3.1.1",
"dependencies": {
"estraverse": {
"version": "3.1.0",
"from": "estraverse@~3.1.0"
}
}
}
}
},
@ -1388,7 +1380,7 @@
},
"estraverse": {
"version": "4.1.1",
"from": "estraverse@^4.1.0"
"from": "estraverse@^4.1.1"
},
"estraverse-fb": {
"version": "1.3.1",
@ -1407,12 +1399,12 @@
"from": "flat-cache@^1.0.9",
"dependencies": {
"del": {
"version": "2.0.2",
"version": "2.2.0",
"from": "del@^2.0.2",
"dependencies": {
"globby": {
"version": "3.0.1",
"from": "globby@^3.0.0",
"version": "4.0.0",
"from": "globby@^4.0.0",
"dependencies": {
"array-union": {
"version": "1.0.1",
@ -1425,8 +1417,38 @@
}
},
"arrify": {
"version": "1.0.0",
"version": "1.0.1",
"from": "arrify@^1.0.0"
},
"glob": {
"version": "6.0.4",
"from": "glob@^6.0.1",
"dependencies": {
"inflight": {
"version": "1.0.4",
"from": "inflight@^1.0.4",
"dependencies": {
"wrappy": {
"version": "1.0.1",
"from": "wrappy@1"
}
}
},
"inherits": {
"version": "2.0.1",
"from": "inherits@2"
},
"once": {
"version": "1.3.3",
"from": "once@^1.3.0",
"dependencies": {
"wrappy": {
"version": "1.0.1",
"from": "wrappy@1"
}
}
}
}
}
}
},
@ -1449,12 +1471,12 @@
"from": "pify@^2.0.0"
},
"pinkie-promise": {
"version": "1.0.0",
"from": "pinkie-promise@^1.0.0",
"version": "2.0.0",
"from": "pinkie-promise@^2.0.0",
"dependencies": {
"pinkie": {
"version": "1.0.0",
"from": "pinkie@^1.0.0"
"version": "2.0.1",
"from": "pinkie@^2.0.0"
}
}
}
@ -1465,37 +1487,27 @@
"from": "graceful-fs@^4.1.2"
},
"read-json-sync": {
"version": "1.1.0",
"from": "read-json-sync@^1.1.0",
"dependencies": {
"graceful-fs": {
"version": "3.0.8",
"from": "graceful-fs@^3.0.5"
}
}
"version": "1.1.1",
"from": "read-json-sync@^1.1.0"
},
"write": {
"version": "0.2.1",
"from": "write@^0.2.1"
}
}
},
"object-assign": {
"version": "4.0.1",
"from": "object-assign@^4.0.1"
}
}
},
"globals": {
"version": "8.11.0",
"version": "8.18.0",
"from": "globals@^8.11.0"
},
"handlebars": {
"version": "4.0.4",
"version": "4.0.5",
"from": "handlebars@^4.0.0",
"dependencies": {
"async": {
"version": "1.5.0",
"version": "1.5.2",
"from": "async@^1.4.0"
},
"optimist": {
@ -1521,17 +1533,151 @@
"from": "amdefine@>=0.0.4"
}
}
},
"uglify-js": {
"version": "2.6.1",
"from": "uglify-js@^2.6",
"dependencies": {
"async": {
"version": "0.2.10",
"from": "async@~0.2.6"
},
"source-map": {
"version": "0.5.3",
"from": "source-map@~0.5.1"
},
"uglify-to-browserify": {
"version": "1.0.2",
"from": "uglify-to-browserify@~1.0.0"
},
"yargs": {
"version": "3.10.0",
"from": "yargs@~3.10.0",
"dependencies": {
"camelcase": {
"version": "1.2.1",
"from": "camelcase@^1.0.2"
},
"cliui": {
"version": "2.1.0",
"from": "cliui@^2.1.0",
"dependencies": {
"center-align": {
"version": "0.1.2",
"from": "center-align@^0.1.1",
"dependencies": {
"align-text": {
"version": "0.1.3",
"from": "align-text@^0.1.0",
"dependencies": {
"kind-of": {
"version": "2.0.1",
"from": "kind-of@^2.0.0",
"dependencies": {
"is-buffer": {
"version": "1.1.1",
"from": "is-buffer@^1.0.2"
}
}
},
"longest": {
"version": "1.0.1",
"from": "longest@^1.0.1"
},
"repeat-string": {
"version": "1.5.2",
"from": "repeat-string@^1.5.2"
}
}
},
"lazy-cache": {
"version": "0.2.7",
"from": "lazy-cache@^0.2.4"
}
}
},
"right-align": {
"version": "0.1.3",
"from": "right-align@^0.1.1",
"dependencies": {
"align-text": {
"version": "0.1.3",
"from": "align-text@^0.1.1",
"dependencies": {
"kind-of": {
"version": "2.0.1",
"from": "kind-of@^2.0.0",
"dependencies": {
"is-buffer": {
"version": "1.1.1",
"from": "is-buffer@^1.0.2"
}
}
},
"longest": {
"version": "1.0.1",
"from": "longest@^1.0.1"
},
"repeat-string": {
"version": "1.5.2",
"from": "repeat-string@^1.5.2"
}
}
}
}
},
"wordwrap": {
"version": "0.0.2",
"from": "wordwrap@0.0.2"
}
}
},
"decamelize": {
"version": "1.1.2",
"from": "decamelize@^1.0.0"
},
"window-size": {
"version": "0.1.0",
"from": "window-size@0.1.0"
}
}
}
}
}
}
},
"inquirer": {
"version": "0.9.0",
"from": "inquirer@^0.9.0",
"version": "0.11.2",
"from": "inquirer@^0.11.0",
"dependencies": {
"ansi-escapes": {
"version": "1.1.1",
"from": "ansi-escapes@^1.1.0"
},
"ansi-regex": {
"version": "2.0.0",
"from": "ansi-regex@^2.0.0"
},
"cli-cursor": {
"version": "1.0.2",
"from": "cli-cursor@^1.0.1",
"dependencies": {
"restore-cursor": {
"version": "1.0.1",
"from": "restore-cursor@^1.0.1",
"dependencies": {
"exit-hook": {
"version": "1.1.1",
"from": "exit-hook@^1.0.0"
},
"onetime": {
"version": "1.1.0",
"from": "onetime@^1.0.0"
}
}
}
}
},
"cli-width": {
"version": "1.1.0",
"from": "cli-width@^1.0.1"
@ -1541,22 +1687,32 @@
"from": "figures@^1.3.5"
},
"readline2": {
"version": "0.1.1",
"from": "readline2@^0.1.1",
"version": "1.0.1",
"from": "readline2@^1.0.1",
"dependencies": {
"mute-stream": {
"version": "0.0.4",
"from": "mute-stream@0.0.4"
},
"strip-ansi": {
"version": "2.0.1",
"from": "strip-ansi@^2.0.1",
"code-point-at": {
"version": "1.0.0",
"from": "code-point-at@^1.0.0",
"dependencies": {
"ansi-regex": {
"version": "1.1.1",
"from": "ansi-regex@^1.0.0"
"number-is-nan": {
"version": "1.0.0",
"from": "number-is-nan@^1.0.0"
}
}
},
"is-fullwidth-code-point": {
"version": "1.0.0",
"from": "is-fullwidth-code-point@^1.0.0",
"dependencies": {
"number-is-nan": {
"version": "1.0.0",
"from": "number-is-nan@^1.0.0"
}
}
},
"mute-stream": {
"version": "0.0.5",
"from": "mute-stream@0.0.5"
}
}
},
@ -1565,7 +1721,7 @@
"from": "run-async@^0.1.0",
"dependencies": {
"once": {
"version": "1.3.2",
"version": "1.3.3",
"from": "once@^1.3.0",
"dependencies": {
"wrappy": {
@ -1577,8 +1733,8 @@
}
},
"rx-lite": {
"version": "2.5.2",
"from": "rx-lite@^2.5.2"
"version": "3.1.2",
"from": "rx-lite@^3.1.2"
},
"strip-ansi": {
"version": "3.0.0",
@ -1629,8 +1785,8 @@
}
},
"js-yaml": {
"version": "3.4.3",
"from": "js-yaml@^3.2.5",
"version": "3.4.5",
"from": "js-yaml@3.4.5",
"dependencies": {
"argparse": {
"version": "1.0.3",
@ -1643,7 +1799,7 @@
}
},
"esprima": {
"version": "2.7.0",
"version": "2.7.1",
"from": "esprima@^2.6.0"
}
}
@ -1685,7 +1841,7 @@
}
},
"lodash._basefor": {
"version": "3.0.2",
"version": "3.0.3",
"from": "lodash._basefor@^3.0.0"
},
"lodash.isarray": {
@ -1701,7 +1857,7 @@
"from": "lodash._getnative@^3.0.0"
},
"lodash.isarguments": {
"version": "3.0.4",
"version": "3.0.5",
"from": "lodash.isarguments@^3.0.0"
}
}
@ -1749,7 +1905,7 @@
"from": "lodash._getnative@^3.0.0"
},
"lodash.isarguments": {
"version": "3.0.4",
"version": "3.0.5",
"from": "lodash.isarguments@^3.0.0"
},
"lodash.isarray": {
@ -1761,13 +1917,13 @@
"from": "lodash.isplainobject@^3.0.0",
"dependencies": {
"lodash._basefor": {
"version": "3.0.2",
"version": "3.0.3",
"from": "lodash._basefor@^3.0.0"
}
}
},
"lodash.istypedarray": {
"version": "3.0.2",
"version": "3.0.3",
"from": "lodash.istypedarray@^3.0.0"
},
"lodash.keys": {
@ -1827,7 +1983,7 @@
"from": "lodash._baseflatten@^3.0.0",
"dependencies": {
"lodash.isarguments": {
"version": "3.0.4",
"version": "3.0.5",
"from": "lodash.isarguments@^3.0.0"
},
"lodash.isarray": {
@ -1849,7 +2005,7 @@
"from": "lodash._pickbycallback@^3.0.0",
"dependencies": {
"lodash._basefor": {
"version": "3.0.2",
"version": "3.0.3",
"from": "lodash._basefor@^3.0.0"
}
}
@ -1859,7 +2015,7 @@
"from": "lodash.keysin@^3.0.0",
"dependencies": {
"lodash.isarguments": {
"version": "3.0.4",
"version": "3.0.5",
"from": "lodash.isarguments@^3.0.0"
},
"lodash.isarray": {
@ -1875,16 +2031,16 @@
}
},
"minimatch": {
"version": "2.0.10",
"from": "minimatch@^2.0.1",
"version": "3.0.0",
"from": "minimatch@^3.0.0",
"dependencies": {
"brace-expansion": {
"version": "1.1.1",
"version": "1.1.2",
"from": "brace-expansion@^1.0.0",
"dependencies": {
"balanced-match": {
"version": "0.2.1",
"from": "balanced-match@^0.2.0"
"version": "0.3.0",
"from": "balanced-match@^0.3.0"
},
"concat-map": {
"version": "0.0.1",
@ -1905,12 +2061,12 @@
}
},
"object-assign": {
"version": "2.1.1",
"from": "object-assign@^2.0.0"
"version": "4.0.1",
"from": "object-assign@^4.0.1"
},
"optionator": {
"version": "0.5.0",
"from": "optionator@^0.5.0",
"version": "0.6.0",
"from": "optionator@^0.6.0",
"dependencies": {
"prelude-ls": {
"version": "1.1.2",
@ -1918,14 +2074,14 @@
},
"deep-is": {
"version": "0.1.3",
"from": "deep-is@~0.1.2"
"from": "deep-is@~0.1.3"
},
"wordwrap": {
"version": "0.0.3",
"from": "wordwrap@~0.0.2"
},
"type-check": {
"version": "0.3.1",
"version": "0.3.2",
"from": "type-check@~0.3.1"
},
"levn": {
@ -1934,7 +2090,7 @@
},
"fast-levenshtein": {
"version": "1.0.7",
"from": "fast-levenshtein@~1.0.0"
"from": "fast-levenshtein@~1.0.6"
}
}
},
@ -1947,8 +2103,8 @@
"from": "path-is-inside@^1.0.1"
},
"shelljs": {
"version": "0.3.0",
"from": "shelljs@^0.3.0"
"version": "0.5.3",
"from": "shelljs@^0.5.3"
},
"strip-json-comments": {
"version": "1.0.4",
@ -1958,29 +2114,15 @@
"version": "0.2.0",
"from": "text-table@~0.2.0"
},
"to-double-quotes": {
"version": "1.0.2",
"from": "to-double-quotes@^1.0.1",
"dependencies": {
"get-stdin": {
"version": "3.0.2",
"from": "get-stdin@^3.0.0"
}
}
},
"to-single-quotes": {
"version": "1.0.4",
"from": "to-single-quotes@^1.0.3",
"dependencies": {
"get-stdin": {
"version": "3.0.2",
"from": "get-stdin@^3.0.0"
}
}
},
"user-home": {
"version": "1.1.1",
"from": "user-home@^1.0.0"
"version": "2.0.0",
"from": "user-home@^2.0.0",
"dependencies": {
"os-homedir": {
"version": "1.0.1",
"from": "os-homedir@^1.0.0"
}
}
},
"xml-escape": {
"version": "1.0.0",
@ -1989,8 +2131,8 @@
}
},
"eslint-plugin-react": {
"version": "3.9.0",
"from": "eslint-plugin-react@3.9.0"
"version": "3.15.0",
"from": "eslint-plugin-react@3.15.0"
},
"exports-loader": {
"version": "0.6.2",
@ -8474,6 +8616,32 @@
"react-addons-transition-group": {
"version": "0.14.3",
"from": "react-addons-transition-group@"
},
"eslint-config-openstack": {
"version": "1.2.3",
"from": "eslint-config-openstack@",
"dependencies": {
"js-yaml": {
"version": "3.3.1",
"from": "js-yaml@3.3.1",
"dependencies": {
"argparse": {
"version": "1.0.3",
"from": "argparse@~1.0.2",
"dependencies": {
"sprintf-js": {
"version": "1.0.3",
"from": "sprintf-js@~1.0.2"
}
}
},
"esprima": {
"version": "2.2.0",
"from": "esprima@~2.2.0"
}
}
}
}
}
}
}

View File

@ -64,8 +64,9 @@
"devDependencies": {
"chai": "~3.2.0",
"es5-shim": "4.1.11",
"eslint": "1.7.3",
"eslint-plugin-react": "3.9.0",
"eslint": "1.10.3",
"eslint-config-openstack": "1.2.3",
"eslint-plugin-react": "3.15.0",
"glob": "~5.0.5",
"gulp-eslint": "1.0.0",
"gulp-lintspaces": "0.3.2",