Refactor codebase

This commit is contained in:
proteriax
2021-07-08 02:05:41 -04:00
parent 490d289330
commit 0230f32aab
19 changed files with 1010 additions and 119 deletions

131
.eslintrc
View File

@ -1,7 +1,7 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"plugins": ["@typescript-eslint", "import"],
"env": {
"node": true,
"browser": true
@ -9,11 +9,57 @@
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended"
"plugin:react/recommended",
"plugin:import/errors",
"plugin:import/typescript",
"plugin:react-hooks/recommended",
"prettier"
],
"settings": {
"react": {
"version": "detect"
},
"import/parsers": {
"@typescript-eslint/parser": [".ts", ".tsx"]
},
"import/resolver": {
"typescript": {
"alwaysTryTypes": true
}
}
},
"rules": {
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/consistent-type-imports": [
"error",
{
"disallowTypeAnnotations": false
}
],
"@typescript-eslint/ban-types": [
"error",
{
"extendDefaults": false,
"types": {
"String": {
"message": "Use string instead",
"fixWith": "string"
},
"Number": {
"message": "Use number instead",
"fixWith": "number"
},
"Boolean": {
"message": "Use boolean instead",
"fixWith": "boolean"
},
"Symbol": {
"message": "Use symbol instead",
"fixWith": "symbol"
}
}
}
],
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-empty-function": "off",
@ -23,22 +69,70 @@
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/triple-slash-reference": "off",
"@typescript-eslint/no-empty-interface": "off",
"arrow-body-style": ["error", "as-needed"],
"class-methods-use-this": ["warn", { "exceptMethods": ["toString"] }],
"complexity": ["warn", { "max": 100 }],
"class-methods-use-this": [
"warn",
{
"exceptMethods": ["toString", "shouldComponentUpdate"]
}
],
"complexity": [
"warn",
{
"max": 100
}
],
"curly": ["error", "multi-line", "consistent"],
"eqeqeq": ["error", "smart"],
"no-async-promise-executor": "off",
"no-case-declarations": "off",
"no-constant-condition": ["error", { "checkLoops": false }],
"no-empty": ["error", { "allowEmptyCatch": true }],
"no-constant-condition": [
"error",
{
"checkLoops": false
}
],
"no-debugger": "off",
"no-empty": [
"error",
{
"allowEmptyCatch": true
}
],
"no-inner-declarations": "off",
"no-lonely-if": "error",
"no-template-curly-in-string": "error",
"no-var": "error",
"object-shorthand": "error",
"one-var": ["error", { "var": "never", "let": "never" }],
"import/export": "off",
"import/order": [
"error",
{
"groups": ["builtin", "external"]
}
],
"object-shorthand": [
"error",
"always",
{
"ignoreConstructors": true
}
],
"one-var": [
"error",
{
"var": "never",
"let": "never"
}
],
"prefer-arrow-callback": "error",
"prefer-const": ["error", { "destructuring": "all" }],
"prefer-const": [
"error",
{
"destructuring": "all"
}
],
"prefer-destructuring": "warn",
"prefer-object-spread": "error",
"prefer-rest-params": "warn",
"prefer-spread": "warn",
@ -46,7 +140,20 @@
"react/display-name": "off",
"react/no-children-prop": "off",
"react/prop-types": "off",
"spaced-comment": "error",
"yoda": ["error", "never", { "exceptRange": true }]
"react/react-in-jsx-scope": "off",
"spaced-comment": [
"error",
"always",
{
"markers": ["/"]
}
],
"yoda": [
"error",
"never",
{
"exceptRange": true
}
]
}
}