Add eslint to the backend

This commit is contained in:
Felipe Knorr Kuhn 2022-07-05 04:29:11 -07:00
parent 570d8cfc74
commit 54334a1854
No known key found for this signature in database
GPG Key ID: 79619B52BB097C1A
4 changed files with 2625 additions and 7 deletions

2
backend/.eslintignore Normal file
View File

@ -0,0 +1,2 @@
node_modules
dist

32
backend/.eslintrc Normal file
View File

@ -0,0 +1,32 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
],
"rules": {
"@typescript-eslint/ban-ts-comment": 1,
"@typescript-eslint/ban-types": 1,
"@typescript-eslint/no-empty-function": 1,
"@typescript-eslint/no-explicit-any": 1,
"@typescript-eslint/no-inferrable-types": 1,
"@typescript-eslint/no-namespace": 1,
"@typescript-eslint/no-this-alias": 1,
"@typescript-eslint/no-var-requires": 1,
"no-console": 1,
"no-constant-condition": 1,
"no-dupe-else-if": 1,
"no-empty": 1,
"no-prototype-builtins": 1,
"no-self-assign": 1,
"no-useless-catch": 1,
"no-var": 1,
"prefer-const": 1,
"prefer-rest-params": 1
}
}

2591
backend/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -24,7 +24,9 @@
"build": "npm run tsc", "build": "npm run tsc",
"start": "node --max-old-space-size=2048 dist/index.js", "start": "node --max-old-space-size=2048 dist/index.js",
"start-production": "node --max-old-space-size=4096 dist/index.js", "start-production": "node --max-old-space-size=4096 dist/index.js",
"test": "echo \"Error: no test specified\" && exit 1" "test": "echo \"Error: no test specified\" && exit 1",
"lint": "eslint . --ext .ts",
"lint:fix": "eslint . --ext .ts --fix"
}, },
"dependencies": { "dependencies": {
"@mempool/electrum-client": "^1.1.7", "@mempool/electrum-client": "^1.1.7",
@ -43,6 +45,9 @@
"@types/compression": "^1.7.2", "@types/compression": "^1.7.2",
"@types/express": "^4.17.13", "@types/express": "^4.17.13",
"@types/ws": "~8.5.3", "@types/ws": "~8.5.3",
"@typescript-eslint/eslint-plugin": "^5.30.5",
"@typescript-eslint/parser": "^5.30.5",
"eslint": "^8.19.0",
"tslint": "^6.1.0" "tslint": "^6.1.0"
} }
} }