2019-07-29 12:55:39 +02:00
|
|
|
module.exports = {
|
|
|
|
'env': {
|
|
|
|
'browser': true,
|
|
|
|
'es6': true,
|
|
|
|
'node': true,
|
|
|
|
},
|
2019-09-13 00:16:42 +02:00
|
|
|
"parser": "@typescript-eslint/parser",
|
2019-07-30 09:35:42 +02:00
|
|
|
'extends': ['eslint:recommended'],
|
2020-01-29 20:03:55 +02:00
|
|
|
"settings": {
|
|
|
|
'react': {
|
|
|
|
'version': '16.12',
|
|
|
|
},
|
|
|
|
},
|
2019-07-29 12:55:39 +02:00
|
|
|
'globals': {
|
|
|
|
'Atomics': 'readonly',
|
2019-07-30 09:35:42 +02:00
|
|
|
'SharedArrayBuffer': 'readonly',
|
|
|
|
|
|
|
|
// Jasmine variables
|
|
|
|
'expect': 'readonly',
|
|
|
|
'describe': 'readonly',
|
|
|
|
'it': 'readonly',
|
2020-02-22 13:25:16 +02:00
|
|
|
'beforeAll': 'readonly',
|
|
|
|
'afterAll': 'readonly',
|
2019-07-30 09:35:42 +02:00
|
|
|
'beforeEach': 'readonly',
|
2020-02-22 13:25:16 +02:00
|
|
|
'afterEach': 'readonly',
|
2019-07-30 09:35:42 +02:00
|
|
|
'jasmine': 'readonly',
|
|
|
|
|
|
|
|
// React Native variables
|
|
|
|
'__DEV__': 'readonly',
|
|
|
|
|
|
|
|
// Clipper variables
|
|
|
|
'browserSupportsPromises_': true,
|
|
|
|
'chrome': 'readonly',
|
|
|
|
'browser': 'readonly',
|
2020-03-10 01:24:57 +02:00
|
|
|
|
|
|
|
'tinymce': 'readonly',
|
2019-07-29 12:55:39 +02:00
|
|
|
},
|
|
|
|
'parserOptions': {
|
|
|
|
'ecmaVersion': 2018,
|
|
|
|
"ecmaFeatures": {
|
|
|
|
"jsx": true,
|
|
|
|
},
|
2019-07-30 09:35:42 +02:00
|
|
|
"sourceType": "module",
|
2019-07-29 12:55:39 +02:00
|
|
|
},
|
|
|
|
'rules': {
|
2019-09-30 00:01:10 +02:00
|
|
|
// -------------------------------
|
|
|
|
// Code correctness
|
|
|
|
// -------------------------------
|
2019-07-29 12:55:39 +02:00
|
|
|
"react/jsx-uses-react": "error",
|
|
|
|
"react/jsx-uses-vars": "error",
|
2019-09-30 00:01:10 +02:00
|
|
|
"no-unused-vars": "error",
|
2020-05-02 17:41:07 +02:00
|
|
|
"@typescript-eslint/no-unused-vars": "error",
|
2019-07-29 13:48:43 +02:00
|
|
|
"no-constant-condition": 0,
|
|
|
|
"no-prototype-builtins": 0,
|
2019-09-30 00:01:10 +02:00
|
|
|
// This error is always a false positive so far since it detects
|
|
|
|
// possible race conditions in contexts where we know it cannot happen.
|
|
|
|
"require-atomic-updates": 0,
|
2020-03-14 01:46:14 +02:00
|
|
|
"prefer-const": ["error"],
|
|
|
|
"no-var": ["error"],
|
2020-05-20 02:17:09 +02:00
|
|
|
"no-new-func": ["error"],
|
2020-06-02 22:13:15 +02:00
|
|
|
"import/prefer-default-export": ["error"],
|
|
|
|
"import/first": ["error"],
|
2020-01-29 19:54:25 +02:00
|
|
|
|
2020-02-27 02:20:55 +02:00
|
|
|
// Checks rules of Hooks
|
|
|
|
"react-hooks/rules-of-hooks": "error",
|
|
|
|
// Checks effect dependencies
|
2020-03-14 01:46:14 +02:00
|
|
|
// Disable because of this: https://github.com/facebook/react/issues/16265
|
|
|
|
// "react-hooks/exhaustive-deps": "warn",
|
2020-02-27 02:20:55 +02:00
|
|
|
|
2019-09-30 00:01:10 +02:00
|
|
|
// -------------------------------
|
|
|
|
// Formatting
|
|
|
|
// -------------------------------
|
2019-07-30 09:35:42 +02:00
|
|
|
"space-in-parens": ["error", "never"],
|
2020-03-14 01:46:14 +02:00
|
|
|
"space-infix-ops": ["error"],
|
2020-03-14 01:57:34 +02:00
|
|
|
"curly": ["error", "multi-line", "consistent"],
|
2019-07-30 09:35:42 +02:00
|
|
|
"semi": ["error", "always"],
|
|
|
|
"eol-last": ["error", "always"],
|
|
|
|
"quotes": ["error", "single"],
|
|
|
|
"indent": ["error", "tab"],
|
|
|
|
"comma-dangle": ["error", "always-multiline"],
|
|
|
|
"no-trailing-spaces": "error",
|
2019-09-19 23:49:17 +02:00
|
|
|
"linebreak-style": ["error", "unix"],
|
|
|
|
"prefer-template": ["error"],
|
2019-09-30 00:01:10 +02:00
|
|
|
"template-curly-spacing": ["error", "never"],
|
2020-02-05 00:09:34 +02:00
|
|
|
"object-curly-spacing": ["error", "always"],
|
2020-02-05 00:11:35 +02:00
|
|
|
"array-bracket-spacing": ["error", "never"],
|
2019-09-30 00:01:10 +02:00
|
|
|
"key-spacing": ["error", {
|
|
|
|
"beforeColon": false,
|
|
|
|
"afterColon": true,
|
|
|
|
"mode": "strict"
|
|
|
|
}],
|
|
|
|
"block-spacing": ["error"],
|
2019-09-30 00:11:36 +02:00
|
|
|
"brace-style": ["error", "1tbs", { "allowSingleLine": true }],
|
2019-09-30 00:01:10 +02:00
|
|
|
"no-spaced-func": ["error"],
|
|
|
|
"func-call-spacing": ["error"],
|
2019-09-30 00:11:36 +02:00
|
|
|
"space-before-function-paren": ["error", {
|
|
|
|
"anonymous": "never",
|
|
|
|
"named": "never",
|
|
|
|
"asyncArrow": "always"
|
2019-10-09 21:24:07 +02:00
|
|
|
}],
|
|
|
|
"multiline-comment-style": ["error", "separate-lines"],
|
|
|
|
"space-before-blocks": "error",
|
|
|
|
"spaced-comment": ["error", "always"],
|
2020-03-14 01:46:14 +02:00
|
|
|
"keyword-spacing": ["error", { "before": true, "after": true }],
|
2019-07-29 12:55:39 +02:00
|
|
|
},
|
|
|
|
"plugins": [
|
|
|
|
"react",
|
2019-09-13 00:16:42 +02:00
|
|
|
"@typescript-eslint",
|
2020-06-02 22:13:15 +02:00
|
|
|
"react-hooks",
|
|
|
|
"import",
|
2019-07-29 12:55:39 +02:00
|
|
|
],
|
2020-02-22 13:25:16 +02:00
|
|
|
};
|