From a30b020ac9637318be51c330b8940cf089a03c92 Mon Sep 17 00:00:00 2001 From: Rene Saarsoo Date: Fri, 25 Sep 2020 09:26:14 +0300 Subject: [PATCH] Improve lint:js and lint:ts setup - Use typescript to report unused variables - Properly pass filenames-glob param to eslint --- .eslintrc.js | 4 +++- package.json | 2 +- tsconfig.json | 6 +++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index cda58a6..a599ae4 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -11,6 +11,8 @@ module.exports = { "@typescript-eslint" ], "rules": { - "@typescript-eslint/explicit-module-boundary-types": "off" + "@typescript-eslint/explicit-module-boundary-types": "off", + // Better handled by TypeScript + "@typescript-eslint/no-unused-vars": "off", } }; diff --git a/package.json b/package.json index 6a9e213..c432b3e 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "license": "GPL-3.0-or-later", "scripts": { "lint:ts": "tsc --noEmit", - "lint:js": "eslint src/**/* .eslintrc.js", + "lint:js": "eslint 'src/**/*'", "test": "jest", "test:watch": "jest --watch", "test:1": "ts-node src/index.ts examples/threshold-pushing.txt", diff --git a/tsconfig.json b/tsconfig.json index f175db5..447fd13 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,8 +5,12 @@ "sourceMap": true, "outDir": "dist", "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, }, "include": [ "src/**/*" - ] + ], }