From 99e7ec00bf78c936f6cd0c0317e5871d7f58404d Mon Sep 17 00:00:00 2001 From: Yuri Cherepanov Date: Mon, 18 Nov 2019 01:24:07 +0200 Subject: [PATCH] eslint-migration - disable warnings/errors Disable warnings and errors on initial code empty functions/require remove transations stub from spec test --- e2e/common-setup.ts | 5 ++++- e2e/main.spec.ts | 4 +++- eslintrc.json | 7 +------ main.ts | 1 + src/app/app.component.spec.ts | 5 ----- src/app/home/home.component.ts | 5 +++-- .../components/page-not-found/page-not-found.component.ts | 4 +++- src/app/shared/directives/webview/webview.directive.ts | 1 + src/test.ts | 1 + 9 files changed, 17 insertions(+), 16 deletions(-) diff --git a/e2e/common-setup.ts b/e2e/common-setup.ts index 7f6ebfd11..e6c0436cf 100644 --- a/e2e/common-setup.ts +++ b/e2e/common-setup.ts @@ -1,8 +1,11 @@ +/* eslint "@typescript-eslint/no-var-requires": 0 */ const Application = require('spectron').Application; +/* eslint "@typescript-eslint/no-var-requires": 0 */ const electronPath = require('electron'); // Require Electron from the binaries included in node_modules. +/* eslint "@typescript-eslint/no-var-requires": 0 */ const path = require('path'); -export default function setup() { +export default function setup(): void { beforeEach(async function () { this.app = new Application({ // Your electron path can be any binary diff --git a/e2e/main.spec.ts b/e2e/main.spec.ts index a20d48461..ec90683cc 100644 --- a/e2e/main.spec.ts +++ b/e2e/main.spec.ts @@ -1,4 +1,4 @@ -import {expect, assert} from 'chai'; +import {expect} from 'chai'; import {SpectronClient} from 'spectron'; import commonSetup from './common-setup'; @@ -6,11 +6,13 @@ import commonSetup from './common-setup'; describe('angular-electron App', function () { commonSetup.apply(this); + /* eslint "@typescript-eslint/no-explicit-any": 0 */ let browser: any; let client: SpectronClient; beforeEach(function () { client = this.app.client; + /* eslint "@typescript-eslint/no-explicit-any": 0 */ browser = client as any; }); diff --git a/eslintrc.json b/eslintrc.json index 3e88df3c9..a1f75f922 100644 --- a/eslintrc.json +++ b/eslintrc.json @@ -15,10 +15,5 @@ "parserOptions": { "tsconfigRootDir": "." }, - "plugins": ["@typescript-eslint"], - "rules": { - "no-empty-function": ["warn"], - "@typescript-eslint/no-empty-function": ["warn"], - "@typescript-eslint/no-var-requires": ["warn"] - } + "plugins": ["@typescript-eslint"] } diff --git a/main.ts b/main.ts index e38690786..35dd37aad 100644 --- a/main.ts +++ b/main.ts @@ -24,6 +24,7 @@ function createWindow(): BrowserWindow { }); if (serve) { + /* eslint "@typescript-eslint/no-var-requires": 0 */ require('electron-reload')(__dirname, { electron: require(`${__dirname}/node_modules/electron`) }); diff --git a/src/app/app.component.spec.ts b/src/app/app.component.spec.ts index 4deab6e5e..cdccbff38 100644 --- a/src/app/app.component.spec.ts +++ b/src/app/app.component.spec.ts @@ -1,7 +1,6 @@ import { TestBed, async } from '@angular/core/testing'; import { RouterTestingModule } from '@angular/router/testing'; import { AppComponent } from './app.component'; -import { TranslateModule } from '@ngx-translate/core'; import { ElectronService } from './core/services'; describe('AppComponent', () => { @@ -19,7 +18,3 @@ describe('AppComponent', () => { expect(app).toBeTruthy(); })); }); - -class TranslateServiceStub { - setDefaultLang(lang: string): void {} -} diff --git a/src/app/home/home.component.ts b/src/app/home/home.component.ts index f56c8c173..739960791 100644 --- a/src/app/home/home.component.ts +++ b/src/app/home/home.component.ts @@ -7,9 +7,10 @@ import { Component, OnInit } from '@angular/core'; }) export class HomeComponent implements OnInit { + /* eslint "no-empty-function":0, "@typescript-eslint/no-empty-function": 0 */ constructor() { } - ngOnInit() { - } + /* eslint "no-empty-function":0, "@typescript-eslint/no-empty-function": 0 */ + ngOnInit(): void { } } diff --git a/src/app/shared/components/page-not-found/page-not-found.component.ts b/src/app/shared/components/page-not-found/page-not-found.component.ts index 7d66ed4c1..2aca12676 100644 --- a/src/app/shared/components/page-not-found/page-not-found.component.ts +++ b/src/app/shared/components/page-not-found/page-not-found.component.ts @@ -6,7 +6,9 @@ import { Component, OnInit } from '@angular/core'; styleUrls: ['./page-not-found.component.scss'] }) export class PageNotFoundComponent implements OnInit { + /* eslint "no-empty-function":0, "@typescript-eslint/no-empty-function": 0 */ constructor() {} - ngOnInit() {} + /* eslint "no-empty-function":0, "@typescript-eslint/no-empty-function": 0 */ + ngOnInit(): void {} } diff --git a/src/app/shared/directives/webview/webview.directive.ts b/src/app/shared/directives/webview/webview.directive.ts index 579b0f98c..cbe497e3f 100644 --- a/src/app/shared/directives/webview/webview.directive.ts +++ b/src/app/shared/directives/webview/webview.directive.ts @@ -4,5 +4,6 @@ import { Directive } from '@angular/core'; selector: '[webview]' }) export class WebviewDirective { + /* eslint "no-empty-function":0, "@typescript-eslint/no-empty-function": 0 */ constructor() {} } diff --git a/src/test.ts b/src/test.ts index 16317897b..2f09f7f2c 100644 --- a/src/test.ts +++ b/src/test.ts @@ -7,6 +7,7 @@ import { platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing'; +/* eslint "@typescript-eslint/no-explicit-any":0 */ declare const require: any; // First, initialize the Angular testing environment.