aboutsummaryrefslogtreecommitdiffstats
path: root/dashboard/assets/.eslintrc
diff options
context:
space:
mode:
Diffstat (limited to 'dashboard/assets/.eslintrc')
-rw-r--r--dashboard/assets/.eslintrc97
1 files changed, 64 insertions, 33 deletions
diff --git a/dashboard/assets/.eslintrc b/dashboard/assets/.eslintrc
index 04ae15d01..67c11dcc0 100644
--- a/dashboard/assets/.eslintrc
+++ b/dashboard/assets/.eslintrc
@@ -16,37 +16,68 @@
// React syntax style mostly according to https://github.com/airbnb/javascript/tree/master/react
{
- "plugins": [
- "react"
- ],
- "parser": "babel-eslint",
- "parserOptions": {
- "ecmaFeatures": {
- "jsx": true,
- "modules": true
- }
- },
- "rules": {
- "react/prefer-es6-class": 2,
- "react/prefer-stateless-function": 2,
- "react/jsx-pascal-case": 2,
- "react/jsx-closing-bracket-location": [1, {"selfClosing": "tag-aligned", "nonEmpty": "tag-aligned"}],
- "react/jsx-closing-tag-location": 1,
- "jsx-quotes": ["error", "prefer-double"],
- "no-multi-spaces": "error",
- "react/jsx-tag-spacing": 2,
- "react/jsx-curly-spacing": [2, {"when": "never", "children": true}],
- "react/jsx-boolean-value": 2,
- "react/no-string-refs": 2,
- "react/jsx-wrap-multilines": 2,
- "react/self-closing-comp": 2,
- "react/jsx-no-bind": 2,
- "react/require-render-return": 2,
- "react/no-is-mounted": 2,
- "key-spacing": ["error", {"align": {
- "beforeColon": false,
- "afterColon": true,
- "on": "value"
- }}]
- }
+ 'env': {
+ 'browser': true,
+ 'node': true,
+ 'es6': true,
+ },
+ 'parser': 'babel-eslint',
+ 'parserOptions': {
+ 'sourceType': 'module',
+ 'ecmaVersion': 6,
+ 'ecmaFeatures': {
+ 'jsx': true,
+ }
+ },
+ 'extends': 'airbnb',
+ 'plugins': [
+ 'flowtype',
+ 'react',
+ ],
+ 'rules': {
+ 'no-tabs': 'off',
+ 'indent': ['error', 'tab'],
+ 'react/jsx-indent': ['error', 'tab'],
+ 'react/jsx-indent-props': ['error', 'tab'],
+ 'react/prefer-stateless-function': 'off',
+
+ // Specifies the maximum length of a line.
+ 'max-len': ['warn', 120, 2, {
+ 'ignoreUrls': true,
+ 'ignoreComments': false,
+ 'ignoreRegExpLiterals': true,
+ 'ignoreStrings': true,
+ 'ignoreTemplateLiterals': true,
+ }],
+ // Enforces spacing between keys and values in object literal properties.
+ 'key-spacing': ['error', {'align': {
+ 'beforeColon': false,
+ 'afterColon': true,
+ 'on': 'value'
+ }}],
+ // Prohibits padding inside curly braces.
+ 'object-curly-spacing': ['error', 'never'],
+ 'no-use-before-define': 'off', // messageAPI
+ 'default-case': 'off',
+
+ 'flowtype/boolean-style': ['error', 'boolean'],
+ 'flowtype/define-flow-type': 'warn',
+ 'flowtype/generic-spacing': ['error', 'never'],
+ 'flowtype/no-primitive-constructor-types': 'error',
+ 'flowtype/no-weak-types': 'error',
+ 'flowtype/object-type-delimiter': ['error', 'comma'],
+ 'flowtype/require-valid-file-annotation': 'error',
+ 'flowtype/semi': ['error', 'always'],
+ 'flowtype/space-after-type-colon': ['error', 'always'],
+ 'flowtype/space-before-generic-bracket': ['error', 'never'],
+ 'flowtype/space-before-type-colon': ['error', 'never'],
+ 'flowtype/union-intersection-spacing': ['error', 'always'],
+ 'flowtype/use-flow-type': 'warn',
+ 'flowtype/valid-syntax': 'warn',
+ },
+ 'settings': {
+ 'flowtype': {
+ 'onlyFilesWithFlowAnnotation': true,
+ }
+ },
}