Improve lint:js and lint:ts setup

- Use typescript to report unused variables
- Properly pass filenames-glob param to eslint
This commit is contained in:
Rene Saarsoo 2020-09-25 09:26:14 +03:00
parent ba11117cc8
commit a30b020ac9
3 changed files with 9 additions and 3 deletions

View File

@ -11,6 +11,8 @@ module.exports = {
"@typescript-eslint" "@typescript-eslint"
], ],
"rules": { "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",
} }
}; };

View File

@ -4,7 +4,7 @@
"license": "GPL-3.0-or-later", "license": "GPL-3.0-or-later",
"scripts": { "scripts": {
"lint:ts": "tsc --noEmit", "lint:ts": "tsc --noEmit",
"lint:js": "eslint src/**/* .eslintrc.js", "lint:js": "eslint 'src/**/*'",
"test": "jest", "test": "jest",
"test:watch": "jest --watch", "test:watch": "jest --watch",
"test:1": "ts-node src/index.ts examples/threshold-pushing.txt", "test:1": "ts-node src/index.ts examples/threshold-pushing.txt",

View File

@ -5,8 +5,12 @@
"sourceMap": true, "sourceMap": true,
"outDir": "dist", "outDir": "dist",
"strict": true, "strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
}, },
"include": [ "include": [
"src/**/*" "src/**/*"
] ],
} }