cosmos-explorer/.eslintrc.js

63 lines
1.7 KiB
JavaScript
Raw Normal View History

module.exports = {
env: {
browser: true,
2021-01-20 15:15:01 +00:00
es6: true,
},
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"],
globals: {
Atomics: "readonly",
2021-01-20 15:15:01 +00:00
SharedArrayBuffer: "readonly",
},
parser: "@typescript-eslint/parser",
parserOptions: {
project: ["./tsconfig.json", "./tsconfig.test.json"],
ecmaFeatures: {
2021-01-20 15:15:01 +00:00
jsx: true,
},
ecmaVersion: 2018,
2021-01-20 15:15:01 +00:00
sourceType: "module",
},
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"],
},
{
files: ["**/*.{test,spec}.{ts,tsx}"],
env: {
2021-01-20 15:15:01 +00:00
jest: true,
},
extends: ["plugin:jest/recommended"],
2021-01-20 15:15:01 +00:00
plugins: ["jest"],
},
],
rules: {
"no-console": ["error", { allow: ["error", "warn", "dir"] }],
2020-06-16 15:21:44 +01:00
curly: "error",
"@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",
"@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",
"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 '{}'",
},
],
2024-01-09 11:15:45 +00:00
"react/no-deprecated": "off",
2021-01-20 15:15:01 +00:00
},
settings: {
react: {
version: "detect",
},
},
};