fuel-ui/.eslintrc

106 lines
3.0 KiB
Plaintext

---
root: true
extends: openstack
plugins:
- react
ecmaFeatures:
arrowFunctions: true
classes: true
defaultParams: true
destructuring: true
jsx: true
modules: true
objectLiteralComputedProperties: true
objectLiteralShorthandMethods: true
objectLiteralShorthandProperties: true
restParams: true
spread: true
superInFunctions: true
rules:
# 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"
# overriden rules from openstack config
brace-style: [2, 1tbs, {allowSingleLine: true}] # overriden to set allowSingleLine to true
# to be fixed and enabled
complexity: 0
eqeqeq: 0
no-script-url: 0
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
no-undef: 2
no-use-before-define: 2
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
new-cap: [2, {newIsCap: true, capIsNew: false}]
no-array-constructor: 2
no-lonely-if: 2
no-new-object: 2
no-spaced-func: 2
object-curly-spacing: 2
padded-blocks: [2, never]
quotes: [2, single, avoid-escape]
space-before-function-paren: [2, never]
space-before-keywords: 2
# es6
arrow-parens: 2
arrow-spacing: 2
constructor-super: 2
#no-arrow-condition: 2
no-class-assign: 2
no-const-assign: 2
no-dupe-class-members: 2
no-this-before-super: 2
no-var: 0
object-shorthand: [2, methods]
prefer-arrow-callback: 2
prefer-const: 0
prefer-spread: 2
prefer-template: 0
# react
react/jsx-boolean-value: [2, never]
react/jsx-closing-bracket-location: [2, {nonEmpty: false, selfClosing: line-aligned}]
react/jsx-curly-spacing: [2, never]
react/jsx-indent-props: [2, 4]
react/jsx-key: 2
react/jsx-no-duplicate-props: 2
react/jsx-no-literals: 0
react/jsx-no-undef: 2
react/jsx-uses-react: 2
react/jsx-uses-vars: 2
react/no-unknown-property: 2
react/prop-types: 0
react/react-in-jsx-scope: 2
react/self-closing-comp: 2
react/sort-comp: 0
env:
browser: true
globals:
app: false