config: add specific tslint file for tests, adjust eslint/tslint to fail on broken rule (error severity)

This commit is contained in:
Xymorot 2019-10-11 22:14:30 +02:00
parent dd3fd42fea
commit d2c40cee18
6 changed files with 14 additions and 8 deletions

View File

@ -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": [
{

View File

@ -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",

View File

@ -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({

View File

@ -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()) {

6
tests/tslint.json Normal file
View File

@ -0,0 +1,6 @@
{
"extends": ["../tslint.json"],
"rules": {
"no-magic-numbers": false
}
}

View File

@ -1,6 +1,6 @@
{
"extends": ["tslint:latest", "tslint-config-prettier"],
"defaultSeverity": "warn",
"defaultSeverity": "error",
"rules": {
"typedef": [
true,