From d2c40cee188cd5bfffe000c564cde3e64997f826 Mon Sep 17 00:00:00 2001 From: Xymorot Date: Fri, 11 Oct 2019 22:14:30 +0200 Subject: [PATCH] config: add specific tslint file for tests, adjust eslint/tslint to fail on broken rule (error severity) --- .eslintrc.json | 8 ++++---- package.json | 2 +- tests/main/main.spec.ts | 2 +- tests/main/services/web-crawler.spec.ts | 2 +- tests/tslint.json | 6 ++++++ tslint.json | 2 +- 6 files changed, 14 insertions(+), 8 deletions(-) create mode 100644 tests/tslint.json diff --git a/.eslintrc.json b/.eslintrc.json index ae92b17..5518379 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -10,10 +10,10 @@ "ecmaVersion": 2018 }, "rules": { - "no-shadow": "warn", - "no-magic-numbers": ["warn", { "ignore": [0, 1, -1] }], - "no-param-reassign": "warn", - "prefer-template": "warn" + "no-shadow": "error", + "no-magic-numbers": ["error", { "ignore": [0, 1, -1] }], + "no-param-reassign": "error", + "prefer-template": "error" }, "overrides": [ { diff --git a/package.json b/package.json index b77cc56..13a2f86 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "eslint-check": "eslint --print-config gulpfile.js | eslint-config-prettier-check", "eslint": "eslint .", "tslint-check": "tslint-config-prettier-check ./tslint.json", - "tslint": "tslint -t stylish -c tslint.json -p tsconfig.json", + "tslint": "tslint -t stylish -p tsconfig.json", "prettier": "prettier --ignore-path .gitignore -c **/*.{html,json,{c,sc,sa,le}ss,yml,svelte,md,ts,js}", "prettier:write": "prettier --ignore-path .gitignore --write **/*.{html,json,{c,sc,sa,le}ss,yml,svelte,md,ts,js}", "forge:start": "electron-forge start", diff --git a/tests/main/main.spec.ts b/tests/main/main.spec.ts index 8fc2746..1f6d21c 100644 --- a/tests/main/main.spec.ts +++ b/tests/main/main.spec.ts @@ -5,7 +5,7 @@ import { Application } from 'spectron'; import packageJson from '../../package.json'; describe('Application', function(): void { - this.timeout('10s'); + this.timeout(10000); beforeEach(function(): any { this.app = new Application({ diff --git a/tests/main/services/web-crawler.spec.ts b/tests/main/services/web-crawler.spec.ts index a685d9b..4195e37 100644 --- a/tests/main/services/web-crawler.spec.ts +++ b/tests/main/services/web-crawler.spec.ts @@ -6,7 +6,7 @@ import sinon from 'sinon'; import { fetch } from '../../../src/main/services/web-crawler'; describe('Web Crawler', function(): void { - this.timeout('2s'); + this.timeout(2000); beforeEach(() => { if (!nock.isActive()) { diff --git a/tests/tslint.json b/tests/tslint.json new file mode 100644 index 0000000..4581e35 --- /dev/null +++ b/tests/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": ["../tslint.json"], + "rules": { + "no-magic-numbers": false + } +} diff --git a/tslint.json b/tslint.json index 34bac67..f54c277 100644 --- a/tslint.json +++ b/tslint.json @@ -1,6 +1,6 @@ { "extends": ["tslint:latest", "tslint-config-prettier"], - "defaultSeverity": "warn", + "defaultSeverity": "error", "rules": { "typedef": [ true,