2020-05-26 03:30:55 +01:00
|
|
|
module.exports = {
|
|
|
|
env: {
|
|
|
|
browser: true,
|
2021-01-20 15:15:01 +00:00
|
|
|
es6: true,
|
2020-05-26 03:30:55 +01:00
|
|
|
},
|
2021-04-12 21:13:17 +01:00
|
|
|
plugins: ["@typescript-eslint", "no-null", "prefer-arrow", "react-hooks"],
|
2020-06-16 15:21:44 +01:00
|
|
|
extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
|
2020-05-26 03:30:55 +01:00
|
|
|
globals: {
|
|
|
|
Atomics: "readonly",
|
2021-01-20 15:15:01 +00:00
|
|
|
SharedArrayBuffer: "readonly",
|
2020-05-26 03:30:55 +01:00
|
|
|
},
|
|
|
|
parser: "@typescript-eslint/parser",
|
|
|
|
parserOptions: {
|
2021-05-04 17:12:54 +01:00
|
|
|
project: ["./tsconfig.json", "./tsconfig.test.json"],
|
2020-05-26 03:30:55 +01:00
|
|
|
ecmaFeatures: {
|
2021-01-20 15:15:01 +00:00
|
|
|
jsx: true,
|
2020-05-26 03:30:55 +01:00
|
|
|
},
|
|
|
|
ecmaVersion: 2018,
|
2021-01-20 15:15:01 +00:00
|
|
|
sourceType: "module",
|
2020-05-26 03:30:55 +01:00
|
|
|
},
|
|
|
|
overrides: [
|
|
|
|
{
|
|
|
|
files: ["**/*.tsx"],
|
2021-04-12 21:13:17 +01:00
|
|
|
extends: ["plugin:react/recommended"],
|
2021-01-20 15:15:01 +00:00
|
|
|
plugins: ["react"],
|
2020-05-26 03:30:55 +01:00
|
|
|
},
|
|
|
|
{
|
2020-09-30 21:42:33 +01:00
|
|
|
files: ["**/*.{test,spec}.{ts,tsx}"],
|
2020-05-26 03:30:55 +01:00
|
|
|
env: {
|
2021-01-20 15:15:01 +00:00
|
|
|
jest: true,
|
2020-05-26 03:30:55 +01:00
|
|
|
},
|
|
|
|
extends: ["plugin:jest/recommended"],
|
2021-01-20 15:15:01 +00:00
|
|
|
plugins: ["jest"],
|
|
|
|
},
|
2020-05-26 03:30:55 +01:00
|
|
|
],
|
|
|
|
rules: {
|
2021-01-19 22:31:55 +00:00
|
|
|
"no-console": ["error", { allow: ["error", "warn", "dir"] }],
|
2020-06-16 15:21:44 +01:00
|
|
|
curly: "error",
|
2021-05-04 17:12:54 +01:00
|
|
|
"@typescript-eslint/switch-exhaustiveness-check": "error",
|
2020-06-23 16:45:51 +01:00
|
|
|
"@typescript-eslint/no-unused-vars": "error",
|
|
|
|
"@typescript-eslint/no-extraneous-class": "error",
|
2020-07-27 22:40:04 +01:00
|
|
|
"@typescript-eslint/no-explicit-any": "error",
|
2020-08-22 01:51:36 +01:00
|
|
|
"prefer-arrow/prefer-arrow-functions": ["error", { allowStandaloneDeclarations: true }],
|
2020-10-26 21:50:31 +00:00
|
|
|
eqeqeq: "error",
|
2021-01-19 22:31:55 +00:00
|
|
|
"react/display-name": "off",
|
2021-04-12 21:13:17 +01:00
|
|
|
"react-hooks/rules-of-hooks": "warn", // TODO: error
|
|
|
|
"react-hooks/exhaustive-deps": "warn", // TODO: error
|
2020-10-26 21:50:31 +00:00
|
|
|
"no-restricted-syntax": [
|
|
|
|
"error",
|
|
|
|
{
|
|
|
|
selector: "CallExpression[callee.object.name='JSON'][callee.property.name='stringify'] Identifier[name=/$err/]",
|
2021-01-20 15:15:01 +00:00
|
|
|
message: "Do not use JSON.stringify(error). It will print '{}'",
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2020-05-26 03:30:55 +01:00
|
|
|
};
|