diff --git a/.eslintrc b/.eslintrc index eef7c04d72..4dc752de1f 100644 --- a/.eslintrc +++ b/.eslintrc @@ -2,13 +2,20 @@ "env": { "node": true }, - "extends": ["airbnb-base", "prettier"], + "extends": [ + "airbnb-base", + "prettier" + + ], + "parser": "@typescript-eslint/parser", "parserOptions": { "ecmaVersion": 2019 }, - "plugins": ["prettier"], + "plugins": ["prettier","@typescript-eslint"], "root": true, "rules": { + "@typescript-eslint/no-var-requires": 0, + "import/no-unresolved": 0, "class-methods-use-this": [0], "prettier/prettier": ["error"], "func-names": "off", @@ -28,5 +35,14 @@ } ] }, + "overrides": [ + { + // enable the rule specifically for TypeScript files + "files": ["*.ts", "*.tsx"], + "rules": { + "@typescript-eslint/explicit-module-boundary-types": ["error"] + } + } + ], "ignorePatterns": ["**/docs/api/oas/"] } diff --git a/package.json b/package.json index bd1a28caf4..f746f907fd 100644 --- a/package.json +++ b/package.json @@ -63,6 +63,8 @@ "snapshotDir": "snapshots" }, "dependencies": { + "@typescript-eslint/eslint-plugin": "^4.15.1", + "@typescript-eslint/parser": "^4.15.1", "async": "^3.1.0", "basic-auth": "^2.0.1", "compression": "^1.7.3",